%%
%% This is file `lwarp.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% lwarp.dtx  (with options: `package')
%% This is a generated file.
%% Copyright 2016-2017 Brian Dunn
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{lwarp}
    [2017/08/08 v0.35  Allows LaTeX to directly produce HTML5 output.]





\RequirePackage{iftex}

\ifLuaTeX
\RequirePackage{luatex85}% until the geometry package is updated
\fi

\RequirePackage{newunicodechar}

\newunicodechar{⨯}{\texttimes}

\ifPDFTeX
\newunicodechar{ﬀ}{ff}% the first arguments are ligatures
\newunicodechar{ﬁ}{fi}
\newunicodechar{ﬂ}{fl}
\newunicodechar{ﬃ}{ffi}
\newunicodechar{ﬄ}{ffl}
\newunicodechar{—}{---}
\newunicodechar{–}{--}
\RequirePackage{upquote}
\else
\fi

\RequirePackage{etoolbox}[2011/01/03]

\RequirePackage{ifplatform}% sense op-system platform
\RequirePackage{comment}
\excludecomment{testing}

\RequirePackage{letltxmacro}

\newbool{usingOSWindows}
\boolfalse{usingOSWindows}


\newcommand*{\OSPathSymbol}{/}


\newcommand*{\LWR@setOSWindows}
{
\booltrue{usingOSWindows}
\renewcommand*{\OSPathSymbol}{\@backslashchar}
}
\ifwindows
\LWR@setOSWindows
\fi


\RequirePackage{kvoptions}
\SetupKeyvalOptions{family=LWR,prefix=LWR@}

\newbool{warpingprint}
\newbool{warpingHTML}
\newbool{mathjax}
\newcommand{\warpprintonly}[1]{\ifbool{warpingprint}{#1}{}}
\newcommand{\warpHTMLonly}[1]{\ifbool{warpingHTML}{#1}{}}

\includecomment{warpall}

\DeclareVoidOption{warpprint}{%
\PackageInfo{lwarp}{Using option 'warpprint'}
\includecomment{warpprint}%
\excludecomment{warpHTML}%
\booltrue{warpingprint}%
\boolfalse{warpingHTML}%
}

\DeclareVoidOption{warpHTML}{%
\PackageInfo{lwarp}{Using option 'warpHTML'}
\excludecomment{warpprint}%
\includecomment{warpHTML}%
\booltrue{warpingHTML}%
\boolfalse{warpingprint}%
}

\DeclareVoidOption{mathsvg}{%
\PackageInfo{lwarp}{Using option 'mathsvg'}
\boolfalse{mathjax}%
}
\DeclareVoidOption{mathjax}{%
\PackageInfo{lwarp}{Using option 'mathjax'}
\booltrue{mathjax}%
}

\DeclareStringOption[\jobname]{BaseJobname}

\DeclareStringOption[english]{IndexLanguage}

\DeclareStringOption[lwarp.xdy]{xdyFilename}

\DeclareVoidOption{lwarpmk}{
\PackageInfo{lwarp}{Using option 'lwarpmk'}
\includecomment{LWR@createlwarpmk}
}

\DeclareVoidOption{OSWindows}{
\PackageInfo{lwarp}{Using option 'OSWindows'}
\LWR@setOSWindows
}

\DeclareStringOption[]{HomeHTMLFilename}

\DeclareStringOption[]{HTMLFilename}

\DeclareBoolOption[false]{latexmk}

\includecomment{warpprint}%
\excludecomment{warpHTML}%
\booltrue{warpingprint}%
\boolfalse{warpingHTML}%
\boolfalse{mathjax}%

\excludecomment{LWR@createlwarpmk}

\ProcessKeyvalOptions*\relax

\providecommand*{\BaseJobname}{\LWR@BaseJobname}

\ifcsempty{LWR@HomeHTMLFilename}{
\newcommand*{\HomeHTMLFilename}{\BaseJobname}
}{
\csedef{HomeHTMLFilename}{\LWR@HomeHTMLFilename}
}

\csedef{HTMLFilename}{\LWR@HTMLFilename}



\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.}
}
{}
}

\newcommand*{\LWR@loadbefore}[1]{%
\@ifpackageloaded{#1}
{}
{
\PackageError{lwarp}
{Package #1 must be loaded before lwarp}
{Move \detokenize{\usepackage}{#1} before \detokenize{\usepackage}{lwarp}.}
}
}

\newcommand*{\LWR@loadnever}[2]{%
\PackageError{lwarp}
{Package #1 is not supported by lwarp's HTML conversion.
Package(s) #2 may be useful instead}
{Package #1 might conflict with lwarp in some way,
or is superceded by another package.
For a possible alternative, see package(s) #2.}
}

\LWR@loadafter{abstract}
\LWR@loadafter{afterpage}
\LWR@loadafter{algorithmicx}
\LWR@loadafter{alltt}
\LWR@loadafter{amsthm}
\LWR@loadafter{array}
\LWR@loadafter{balance}
\LWR@loadafter{bookmark}
\LWR@loadafter{booktabs}
\LWR@loadafter{boxedminipage}
\LWR@loadafter{boxedminipage2e}
\LWR@loadafter{ccaption}
\LWR@loadafter{changepage}
\LWR@loadafter{crop}
\LWR@loadafter{cutwin}
\LWR@loadafter{dcolumn}
\LWR@loadafter{draftwatermark}
\LWR@loadafter{ellipsis}
\LWR@loadafter{emptypage}
\LWR@loadafter{enumerate}
\LWR@loadafter{enumitem}
\LWR@loadafter{epigraph}
\LWR@loadafter{eso-pic}
\LWR@loadafter{everypage}
\LWR@loadafter{everyshi}
\LWR@loadafter{extramarks}
\LWR@loadafter{fancybox}
\LWR@loadafter{fancyhdr}
\LWR@loadafter{fancyvrb}
\LWR@loadafter{figcaps}
\LWR@loadafter{float}
\LWR@loadafter{floatflt}
\LWR@loadafter{floatpag}
\LWR@loadafter{floatrow}
\LWR@loadafter{flushend}
\LWR@loadafter{ftnright}
\LWR@loadafter{fullpage}
\LWR@loadafter{geometry}
\LWR@loadafter{glossaries}
\LWR@loadafter{hyperref}
\LWR@loadafter{hyperxmp}
\LWR@loadafter{idxlayout}
\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{marginfit}
\LWR@loadafter{marginfix}
\LWR@loadafter{marginnote}
\LWR@loadafter{mcaption}
\LWR@loadafter{mdframed}
\LWR@loadafter{microtype}
\LWR@loadafter{moreverb}
\LWR@loadafter{mparhack}
\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{paralist}
\LWR@loadafter{parskip}
\LWR@loadafter{pdflscape}
\LWR@loadafter{pdfsync}
\LWR@loadafter{placeins}
\LWR@loadafter{prelim2e}
\LWR@loadafter{ragged2e}
\LWR@loadafter{rotating}
\LWR@loadafter{rotfloat}
\LWR@loadafter{savetrees}
\LWR@loadafter{setspace}
\LWR@loadafter{shadow}
\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}
\LWR@loadafter{xmpincl}



\begin{warpall}


\RequirePackage{iftex}
\newif\ifxetexorluatex
\ifXeTeX
    \xetexorluatextrue
\else
    \ifLuaTeX
        \xetexorluatextrue
    \else
        \xetexorluatexfalse
    \fi
\fi

\end{warpall}

\begin{warpHTML}
\ifxetexorluatex
\defaultfontfeatures[\rmfamily]{Ligatures={NoCommon,TeX}}
\defaultfontfeatures[\sffamily]{Ligatures={NoCommon,TeX}}
\defaultfontfeatures[\ttfamily]{Ligatures=NoCommon}
\else


\RequirePackage {microtype}

\microtypesetup{
protrusion=false,
expansion=false,
tracking=false,
kerning=false,
spacing=false}

\DisableLigatures[f,q,t,T,Q]{encoding = *,family = *}
\fi
\end{warpHTML}

\begin{warpHTML}
\RequirePackage[paperheight=190in,paperwidth=20in,%
left=2in,right=12in,%
top=1in,bottom=1in,%
]{geometry}
\@twosidefalse
\@mparswitchfalse
\end{warpHTML}

\begin{warpall}

\RequirePackage{xparse}

\end{warpall}

\begin{warpHTML}

\RequirePackage{expl3}



\RequirePackage{gettitlestring}

\RequirePackage{everyhook}
\end{warpHTML}

\begin{warpall}

\RequirePackage{filecontents}

\@ifpackagelater{filecontents}{2011/10/09}%
{}
{
\newwrite\fcwrite
\let\LWR@origfilec@ntents\filec@ntents
\def\filec@ntents{\def\chardef##1\write{\let\reserved@c\fcwrite}\LWR@origfilec@ntents}
}

\end{warpall}

\begin{warpHTML}

\RequirePackage{xifthen}

\RequirePackage{xstring}

\RequirePackage{verbatim}

\RequirePackage{makeidx}
\makeindex

\RequirePackage{calc}

\RequirePackage{refcount}

\RequirePackage{newfloat}

\RequirePackage{caption}


\end{warpHTML}

\begin{warpall}

\RequirePackage{titling}

\RequirePackage{environ}

\end{warpall}

\begin{warpHTML}

\RequirePackage{zref}

\PassOptionsToPackage{leqno}{amsmath}
\RequirePackage{amsmath}


\RequirePackage{xfrac}

\RequirePackage{printlen}

\end{warpHTML}

\begin{warpHTML}

\LetLtxMacro{\LWR@origRequirePackage}{\RequirePackage}

\newcommand*{\LWR@requirepackagenames}{}

\newcommand*\LWR@findword[3][,]{%
    \StrBetween[#3,\numexpr#3+1]{#1#2#1}{#1}{#1}%
}
\newcommand*{\LWR@lookforpackagename}[1]{%
\LWR@findword{\LWR@requirepackagenames}{#1}[\LWR@strresult]%
\StrSubstitute[100]{\LWR@strresult}{ }{}[\LWR@strresulttwo]%
\IfStrEq{\LWR@strresulttwo}{}%
{}% no filename
{% yes filename
\IfFileExists{lwarp-\LWR@strresulttwo.sty}%
{% lwarp-* file found
\StrSubstitute%
{\LWR@requirepackagenames}%
{\LWR@strresult}%
{lwarp-\LWR@strresulttwo}[\LWR@requirepackagenames]%
}%
{}% no lwarp-* file
}% yes filename
}
\RenewDocumentCommand{\RequirePackage}{o m o}{%
\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}
\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}}
}
}
\LetLtxMacro{\usepackage}{\RequirePackage}

\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}}
}

\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{warpHTML}


\begin{warpHTML}

\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
  \immediate\write\copyfile{\unexpanded\expandafter{\fileline}}%
\repeat
\closeout\copyfile
\endgroup
}

\end{warpHTML}


\begin{warpall}

\newbool{LWR@tracinglwarp}
\newcommand{\tracinglwarp}{\booltrue{LWR@tracinglwarp}}
\newcommand{\LWR@traceinfo}[1]{%
\ifbool{LWR@tracinglwarp}%
{%
\typeout{*** lwarp: #1}%
}%
{}%
}

\newbool{HTMLDebugComments}
\boolfalse{HTMLDebugComments}

\AfterEndPreamble{
\LWR@traceinfo{AfterEndPreamble}
}

\AtBeginDocument{
\LWR@traceinfo{AtBeginDocument}
}

\newbool{FormatEPUB}
\boolfalse{FormatEPUB}
\newbool{FormatWordProcessor}
\boolfalse{FormatWordProcessor}
\newbool{HTMLMarkFloats}
\booltrue{HTMLMarkFloats}

\end{warpall}


\begin{warpHTML}

\LetLtxMacro{\LWR@origtextrm}{\textrm}
\LetLtxMacro{\LWR@origtextsf}{\textsf}
\LetLtxMacro{\LWR@origtexttt}{\texttt}
\LetLtxMacro{\LWR@origtextnormal}{\textnormal}
\LetLtxMacro{\LWR@origtextbf}{\textbf}
\LetLtxMacro{\LWR@origtextmd}{\textmd}
\LetLtxMacro{\LWR@origtextit}{\textit}
\LetLtxMacro{\LWR@origtextsl}{\textsl}
\LetLtxMacro{\LWR@origtextsc}{\textsc}
\LetLtxMacro{\LWR@origtextup}{\textup}
\LetLtxMacro{\LWR@origemph}{\emph}

\LetLtxMacro{\LWR@origrmfamily}{\rmfamily}
\LetLtxMacro{\LWR@origsffamily}{\sffamily}
\LetLtxMacro{\LWR@origttfamily}{\ttfamily}
\LetLtxMacro{\LWR@origbfseries}{\bfseries}
\LetLtxMacro{\LWR@origmdseries}{\mdseries}
\LetLtxMacro{\LWR@origupshape}{\upshape}
\LetLtxMacro{\LWR@origslshape}{\slshape}
\LetLtxMacro{\LWR@origscshape}{\scshape}
\LetLtxMacro{\LWR@origitshape}{\itshape}
\LetLtxMacro{\LWR@origem}{\em}
\LetLtxMacro{\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@origpagestyle\pagestyle
\let\LWR@origthispagestyle\thispagestyle
\let\LWR@origpagenumbering\pagenumbering

\LetLtxMacro{\LWR@origminipage}{\minipage}
\let\LWR@origendminipage\endminipage
\LetLtxMacro{\LWR@origparbox}{\parbox}

\let\LWR@orignewline\newline

\LetLtxMacro{\LWR@origitem}{\item}

\LetLtxMacro{\LWR@origitemize}{\itemize}
\LetLtxMacro{\LWR@endorigitemize}{\enditemize}
\LetLtxMacro{\LWR@origenumerate}{\enumerate}
\LetLtxMacro{\LWR@endorigenumerate}{\endenumerate}
\LetLtxMacro{\LWR@origdescription}{\description}
\LetLtxMacro{\LWR@endorigdescription}{\enddescription}

\let\LWR@origpar\par

\LetLtxMacro{\LWR@origfootnote}{\footnote}
\let\LWR@orig@mpfootnotetext\@mpfootnotetext

\let\LWR@origclearpage\clearpage
\let\clearpage\relax
\let\cleardoublepage\relax

\end{warpHTML}



\begin{warpprint}
\typeout{lwarp: generating configuration files}
\end{warpprint}

\begin{warpprint}
\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{\input}\string{\jobname.tex\string }%
}
\immediate\closeout\LWR@file
\end{warpprint}

\begin{warpprint}
\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}}
\immediate\openout\LWR@file=lwarpmk.conf
\ifbool{usingOSWindows}{
\immediate\write\LWR@file{opsystem = "Windows"}
}{
\immediate\write\LWR@file{opsystem = "Unix"}
}
\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 = "\HTMLFilename"}
\immediate\write\LWR@file{latexmk = "\ifbool{LWR@latexmk}{true}{false}"}
\immediate\write\LWR@file{language = "\LWR@IndexLanguage"}
\immediate\write\LWR@file{xdyfile = "\LWR@xdyFilename"}
\immediate\closeout\LWR@file
\end{warpprint}

\begin{warpprint}
\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}}
\immediate\openout\LWR@file=\jobname.lwarpmkconf
\ifbool{usingOSWindows}{
\immediate\write\LWR@file{opsystem = "Windows"}
}{
\immediate\write\LWR@file{opsystem = "Unix"}
}
\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 = "\HTMLFilename"}
\immediate\write\LWR@file{latexmk = "\ifbool{LWR@latexmk}{true}{false}"}
\immediate\write\LWR@file{language = "\LWR@IndexLanguage"}
\immediate\write\LWR@file{xdyfile = "\LWR@xdyFilename"}
\immediate\closeout\LWR@file
\end{warpprint}


\begin{warpprint}
\begin{filecontents*}{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, span.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% ;
}

pre { padding: 3pt ; }

span.strong { font-weight: bold; }

span.textmd { font-weight: normal; }

span.textsc { font-variant: small-caps; }

span.textsl { font-style: oblique; }

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;
}

span.listinglabel {
    display: inline-block ;
    font-size: 70% ;
    width: 4em ;
    text-align: right ;
    margin-right: 2em ;
}

div.abstract {
  margin: 2em 5% 2em 5% ;
  padding: 1ex 1em 1ex 1em ;
/*  font-weight: bold ; */
  font-size: 90% ;
}

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 ;}

.shadowbox, .shabox {
   border: 1px solid black;
    box-shadow: 3px 3px 3px #808080 ;
     border-radius: 0px ;
    padding: .4ex .3em .4ex .3em ;
    margin: 0pt .3ex 0pt .3ex ;
  display: inline-block ;
}

.doublebox {
   border: 3px double black;
     border-radius: 0px ;
    padding: .4ex .3em .4ex .3em ;
    margin: 0pt .3ex 0pt .3ex ;
  display: inline-block ;
}

.ovalbox, .Ovalbox {
   border: 1px solid black;
     border-radius: 1ex ;
    padding: .4ex .3em .4ex .3em ;
    margin: 0pt .3ex 0pt .3ex ;
  display: inline-block ;
}

.Ovalbox { border-width: 2px ; }

.framebox {
   border: 1px solid black;
     border-radius: 0px ;
    padding: .3ex .2em 0ex .2em ;
    margin: 0pt .1ex 0pt .1ex ;
  display: inline-block ;
}

.mdframed {
/*     padding: 0ex ; */
/*    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, pre.boxedverbatim {
    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;
margin-left: 1em ;
    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.tdat { text-align: center ; vertical-align: middle ; padding: 0px ; margin: 0px ; }
table td.tdbang { text-align: center ; vertical-align: middle ; }
table td.tdr { text-align: right ; vertical-align: middle ; }
table td.tdp { text-align: left ; vertical-align: bottom ; }
table td.tdm { text-align: left ; vertical-align: middle ; }
table td.tdb { text-align: left ; vertical-align: top ; }
table td.tdP { text-align: center ; vertical-align: bottom ; }
table td.tdM { text-align: center ; vertical-align: middle ; }
table td.tdB { text-align: center ; vertical-align: top ; }
table td.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.tdatrule { text-align: center ; border-top: 1px solid silver ;
    vertical-align: middle ;  padding: 0px ; margin: 0px ; }
table td.tdbangrule { text-align: center ; border-top: 1px solid silver ;
    vertical-align: middle ; } /* for cmidrule */
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 ;}

/* Fancybox */
div.Btrivlist table tr td { padding: .2ex 0em ; }

/* program listing callouts: */
span.callout {
     font-family: "DejaVu Sans", "Bitstream Vera Sans",
        Geneva, Verdana, sans-serif ;
    border-radius: .5em;
    background-color:black;
    color:white;
    padding:0px .25em 0px .25em;
margin: 0 ;
    font-weight: bold;
    font-size:.72em ;
}

div.programlisting pre.verbatim span.callout{
font-size: .85em ;
}

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{filecontents*}
\end{warpprint}


\begin{warpprint}
\begin{filecontents*}{lwarp_sagebrush.css}
@import url("lwarp.css") ;

A:link {color:#105030 ; text-decoration: none ; }
A:visited {color:#705030 ; text-shadow:1px 1px 2px #a0a0a0;}
A:hover {color:#006000 ; text-decoration: underline ; text-shadow:0px 0px 2px #a0a0a0;}
A:active {color:#00C000 ; text-shadow:1px 1px 2px #a0a0a0;}

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{filecontents*}
\end{warpprint}


\begin{warpprint}
\begin{filecontents*}{lwarp_formal.css}
@import url("lwarp.css") ;

A:link {color:#802020 ; text-decoration:none; }
A:visited {color:#802020 ; text-shadow:none ;}
A:hover {color:#400000 ; text-shadow:none ;}
A:active {color:#C00000 ; text-shadow:none ;}

body {
    font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
        "Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
        "Liberation Serif", "Nimbus Roman No 9 L",  "FreeSerif", Times,
        "Times New Roman", serif;
    background: #fffcf5;
}

span.textrm {
    font-family: "Linux Libertine O", "Hoefler Text", "Garamond",
        "Bembo", "Janson", "TeX Gyre Pagella", "Palatino",
        "Liberation Serif", "Nimbus Roman No 9 L",  "FreeSerif", Times,
        "Times New Roman", serif;
}

span.textsf {
     font-family: "DejaVu Sans", "Bitstream Vera Sans",
        Geneva, Verdana, sans-serif ;
}

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{filecontents*}
\end{warpprint}


\begin{warpprint}
\begin{filecontents*}{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{filecontents*}
\end{warpprint}


\begin{warpprint}
\begin{filecontents*}{lwarp.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{filecontents*}
\end{warpprint}


\begin{warpprint}
\begin{filecontents*}{lwarp_mathjax.txt}
<!-- https://groups.google.com/forum/#!topic/
                               mathjax-users/jUtewUcE2bY -->
<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX AMSmath Ready",function () {
    var seteqsectionDefault = {name: "", num: 0};
    var seteqsections = {}, seteqsection = seteqsectionDefault;
    var TEX = MathJax.InputJax.TeX, PARSE = TEX.Parse;
    var AMS = MathJax.Extension["TeX/AMSmath"];
    TEX.Definitions.Add({
    macros: {
        seteqsection: "mySection",
        seteqnumber: "mySetEqNumber"
    }
    });

    PARSE.Augment({
    mySection: function (name) {
        seteqsection.num = AMS.number;
        var n = this.GetArgument(name);
        if (n === "") {
        seteqsection = seteqsectionDefault;
        } else {
        if (!seteqsections["_"+n])
            seteqsections["_"+n] = {name:n, num:0};
        seteqsection = seteqsections["_"+n];
        }
        AMS.number = seteqsection.num;
    },
    mySetEqNumber: function (name) {
        var n = this.GetArgument(name);
        if (!n || !n.match(/^ *[0-9]+ *$/))
            n = ""; else n = parseInt(n)-1;
        <!-- $ syntax highlighting -->
        if (n === "" || n < 1)
            TEX.Error
            ("Argument to "+name+" should be a positive integer");
        AMS.number = n;
    }
    });
    MathJax.Hub.Config({
    TeX: {
        equationNumbers: {
        formatTag: function (n)
            {return "("+(seteqsection.name+"."+n).replace(/^\./,"")+")"},
        formatID: function (n) {
            n = (seteqsection.name+'.'+n).replace
                (/[:"'<>&]/g,"").replace(/^\./,"");
            return 'mjx-eqn-' + n;
        }
        }
    }
    });
});
</script>

<!-- http://docs.mathjax.org/en/latest/options/ThirdParty.html -->
<script type="text/x-mathjax-config">
  MathJax.Ajax.config.path["Contrib"] =
    "https://cdn.mathjax.org/mathjax/contrib";
</script>

<!-- https://github.com/mathjax/MathJax-third-party-extensions/
                                           tree/master/siunitx -->
<script type="text/x-mathjax-config">
 MathJax.Hub.Config({
   extensions: ["tex2jax.js","[Contrib]/siunitx/siunitx.js"],
   jax: ["input/TeX","output/HTML-CSS"],
   tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
   TeX: {extensions: ["AMSmath.js","AMSsymbols.js", "sinuitx.js"]}
 });
 </script>

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    TeX: {
    equationNumbers: {
        autoNumber: "AMS"
    }
    }
});
</script>

<!-- Alternative CDN provider: -->
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML-full">
</script>

<!-- No longer supported after April 30, 2017: -->
<!--
<script
  src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full">
</script>
-->

\end{filecontents*}
\end{warpprint}


\begin{LWR@createlwarpmk}

\begin{filecontents*}{lwarpmk.lua}
#!/usr/bin/env texlua

-- Copyright 2016-2017 Brian Dunn

-- Print the usage of the lwarpmk command:

printversion = "v0.35"

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 <project>.lwarpmkconf project file:
--
opsystem = "Unix"   (or "Windows")
latexname = "pdflatex"  (or "lualatex", or "xelatex")
sourcename = "projectname"  (the source-code filename w/o .tex)
homehtmlfilename = "index"  (or perhaps the project name)
htmlfilename = ""  (or "projectname" - filename prefix)
latexmk = "false"  (or "true" to use latexmk to build PDFs)
languge = "english"  (use a language supported by xindy)
xdyfile = "lwarp.xdy" (or a custom file based on lwarp.xdy)
--
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 <!--|Start file|newfilename|*

function splitfile (destfile,sourcefile)
print ("lwarpmk: Splitting " .. sourcefile .. " into " .. destfile) ;
local sfile = io.open(sourcefile)
io.output(destfile)
for line in sfile:lines() do
i,j,copen,cstart,newfilename = string.find (line,"(.*)|(.*)|(.*)|") ;
if ( (i~= nil) and (copen == "<!--") and (cstart == "Start file")) then -- split the file
io.output(newfilename) ;
else -- not a splitpoint
io.write (line .. "\n") ;
end
end -- do
io.close(sfile)
end -- function

-- Incorrect value, so print an error and exit.

function cvalueerror ( line, linenum , cvalue )
    print ( linenum .. " : " .. line ) ;
    print ("lwarpmk: incorrect variable value \"" .. cvalue .. "\" in lwarpmk.conf.\n" ) ;
    printconf () ;
    os.exit(1) ;
end

-- Load settings from the project's "lwarpmk.conf" file:

function loadconf ()
-- Default configuration filename:
local conffile = "lwarpmk.conf"
-- Optional configuration filename:
if arg[2] ~= nil then conffile = arg[2]..".lwarpmkconf" end
-- Default language:
language = "english"
-- Default xdyfile:
xdyfile = "lwarp.xdy"
-- Verify the file exists:
if (lfs.attributes(conffile,"mode")==nil) then -- file not exists
print("lwarpmk: " .. conffile .." does not exist.")
print("lwarpmk: " .. arg[2] .. " does not appear to be a project name.\n")
printhelp () ;
os.exit(1) -- exit the entire lwarpmk script
else -- file exists
-- Read the file:
print ("lwarpmk: Reading " .. conffile ..".")
local cfile = io.open(conffile)
-- Scan each line:
local linenum = 0
for line in cfile:lines() do -- scan lines
linenum = linenum + 1
i,j,cvarname,cvalue = string.find (line,"([%w-_]*)%s*=%s*\"([%w%-_%.]*)\"") ;
-- Error if incorrect enclosing characters:
if ( i == nil ) then
print ( linenum .. " : " .. line ) ;
print ( "lwarpmk: Incorrect entry in " .. conffile ..".\n" ) ;
printconf () ;
os.exit(1) ;
end
if ( cvarname == "opsystem" ) then
    -- Verify choice of opsystem:
    if ( (cvalue == "Unix") or (cvalue == "Windows") ) then
        opsystem = cvalue
    else
        cvalueerror ( line, linenum , cvalue )
    end
elseif ( cvarname == "latexname" ) then
    -- Verify choice of LaTeX compiler:
    if (
        (cvalue == "pdflatex") or
        (cvalue == "xelatex") or
        (cvalue == "lualatex")
    ) then
        latexname = cvalue
    else
        cvalueerror ( line, linenum , cvalue )
    end
elseif ( cvarname == "sourcename" ) then sourcename = cvalue
elseif ( cvarname == "homehtmlfilename" ) then homehtmlfilename = cvalue
elseif ( cvarname == "htmlfilename" ) then htmlfilename = cvalue
elseif ( cvarname == "latexmk" ) then latexmk = cvalue
elseif ( cvarname == "language" ) then language = cvalue
elseif ( cvarname == "xdyfile" ) then xdyfile = cvalue
else
print ( linenum .. " : " .. line ) ;
print ("lwarpmk: Incorrect variable name \"" .. cvarname .. "\" in " .. conffile ..".\n" ) ;
printconf () ;
os.exit(1) ;
end
end -- do scan lines
io.close(cfile)
end -- file exists
-- Select some operating-system commands:
if opsystem=="Unix" then  -- For Unix / Linux / Mac OS:
rmname = "rm"
mvname = "mv"
touchnamepre = "touch"
touchnamepost = ""
dirslash = "/"
opquote= "\'"
elseif opsystem=="Windows" then -- For Windows
rmname = "DEL"
mvname = "MOVE"
touchnamepre = "COPY /b"
touchnamepost = "+,,"
dirslash = "\\"
opquote= "\""
else print ( "lwarpmk: Select Unix or Windows for opsystem" )
end --- for Windows

-- set xindycmd according to pdflatex vs xelatex/lualatex:
if ( latexname == "pdflatex" ) then
xindycmd = "texindy  -C utf8"
glossarycmd = "xindy -C utf8"
else
xindycmd = "xindy  -M texindy  -C utf8"
glossarycmd = "xindy -C utf8"
end

end -- loadconf

function refreshdate ()
os.execute(touchnamepre .. " " .. sourcename .. ".tex " .. touchnamepost)
end

-- Scan the LaTeX log file for the phrase "Rerun to get",
-- indicating that the file should be compiled again.
-- Return true if found.

function reruntoget (filesource)
local fsource = io.open(filesource)
for line in fsource:lines() do
if ( string.find(line,"Rerun to get") ~= nil ) then
io.close(fsource)
return true
end
end
io.close(fsource)
return false
end

-- Compile one time, return true if should compile again.
-- fsuffix is "" for print, "_html" for HTML output.

function onetime (fsuffix)
print("lwarpmk: Compiling with " .. latexname .. " " .. sourcename..fsuffix)
err = os.execute(
--    "echo " ..
    latexname .. " " .. sourcename..fsuffix )
if ( err ~= 0 ) then print ( "lwarpmk: Compile error.") ; os.exit(1) ; end
return (reruntoget(sourcename .. fsuffix .. ".log") ) ;
end

-- Compile up to five times.
-- fsuffix is "" for print, "_html" for HTML output

function manytimes (fsuffix)
if onetime(fsuffix) == true then
if onetime(fsuffix) == true then
if onetime(fsuffix) == true then
if onetime(fsuffix) == true then
if onetime(fsuffix) == true then
end end end end end
end

-- Exit if the given file does not exist.

function verifyfileexists (filename)
if (lfs.attributes ( filename , "modification" ) == nil ) then
print ( "lwarpmk: " .. filename .. " not found." ) ;
os.exit (1) ;
end
end

-- Convert <project>_html.pdf into HTML files:

function pdftohtml ()
    -- Convert to text:
    print ("lwarpmk: Converting " .. sourcename
        .."_html.pdf to " .. sourcename .. "_html.html")
    os.execute("pdftotext  -enc UTF-8  -nopgbrk  -layout "
        .. sourcename .. "_html.pdf " .. sourcename .. "_html.html")
    -- Split the result into individual HTML files:
    splitfile (homehtmlfilename .. ".html" , sourcename .. "_html.html")
end

-- Remove auxiliary files:

function removeaux ()
    os.execute ( rmname .. " " ..
        sourcename ..".aux " .. sourcename .. "_html.aux " ..
        sourcename ..".toc " .. sourcename .. "_html.toc " ..
        sourcename ..".lof " .. sourcename .. "_html.lof " ..
        sourcename ..".lot " .. sourcename .. "_html.lot " ..
        sourcename ..".idx " .. sourcename .. "_html.idx " ..
        sourcename ..".ind " .. sourcename .. "_html.ind " ..
        sourcename ..".log " .. sourcename .. "_html.log " ..
        sourcename ..".gl* " .. sourcename .. "_html.gl* "
        )
end

-- Create lateximages based on lateximages.txt:
function createlateximages ()
print ("lwarpmk: Creating lateximages.")
local limagesfile = io.open("lateximages.txt")
-- Create the lateximages directory, ignore error if already exists
err = os.execute("mkdir lateximages")
-- Scan lateximages.txt
for line in limagesfile:lines() do
-- lwimgpage is the page number in the PDF which has the image
-- lwimgnum is the sequential lateximage number to assign for the image
i,j,lwimgpage,lwimgnum = string.find (line,"|(.*)|(.*)|")
-- For each entry:
if ( (i~=nil) ) then
-- Separate out the image into its own single-page pdf:
err = os.execute(
"pdfseparate -f " .. lwimgpage .. " -l " ..
 lwimgpage .. " " .. sourcename .."_html.pdf lateximagetemp-%d.pdf")
-- Crop the image:
err = os.execute(
"pdfcrop --hires lateximagetemp-" .. lwimgpage ..".pdf lateximage-" .. lwimgnum ..".pdf")
if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end
-- Convert the image to svg:
err = os.execute(
"pdftocairo -svg lateximage-" .. lwimgnum ..".pdf lateximage-" .. lwimgnum ..".svg")
if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end
-- Move the result into lateximages/:
err = os.execute(
mvname .. " lateximage-" .. lwimgnum ..".svg lateximages" .. dirslash )
if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end
-- Remove the temporary files:
err = os.execute(
rmname .. " lateximage-" .. lwimgnum ..".pdf lateximagetemp-" .. lwimgpage ..".pdf")
if ( err ~= 0 ) then print ( "lwarpmk: File error.") ; os.exit(1) ; end
end
end -- do
io.close(limagesfile)
end -- function

-- Use latexmk to compile source and index:
-- fsuffix is "" for print, or "_html" for HTML
function compilelatexmk ( fsuffix )
    -- The recorder option is required to detect changes in <project>.tex
    -- while we are loading <project>_html.tex.
    err=os.execute ( "latexmk -pdf -dvi- -ps- -recorder "
        .. "-e "
        .. opquote
        .. "$makeindex = q/" -- $
        .. xindycmd
        .. "  -M " .. xdyfile
        .. "  -L " .. language .. " /"
        .. opquote
        .. " -pdflatex=\"" .. latexname .." %O %S\" "
        .. sourcename..fsuffix ..".tex" ) ;
    if ( err ~= 0 ) then print ( "lwarpmk: Compile error.") ; os.exit(1) ; end
end

-- lwarpmk --version :

if (arg[1] == "--version") then
print ( "lwarpmk: " .. printversion )

else -- not -- version

-- print intro:

print ("lwarpmk: " .. printversion .. "  Automated make for the LaTeX lwarp package.")

-- lwarpmk print:

if arg[1] == "print" then
loadconf ()
if ( latexmk == "true" ) then
    compilelatexmk ("")
    print ("lwarpmk: Done.")
else -- not latexmk
    verifyfileexists (sourcename .. ".tex") ;
    -- See if up to date:
    if (
        ( lfs.attributes ( sourcename .. ".pdf" , "modification" ) == nil ) or
        (
            lfs.attributes ( sourcename .. ".tex" , "modification" ) >
            lfs.attributes ( sourcename .. ".pdf" , "modification" )
        )
    ) then
        -- Recompile if not yet up to date:
        manytimes("")
        print ("lwarpmk: Done.") ;
    else
        print ("lwarpmk: " .. sourcename .. ".pdf is up to date.") ;
    end
end -- not latexmk

-- lwarp printindex:
-- Compile the index then touch the source
-- to trigger a recompile of the document:

elseif arg[1] == "printindex" then
loadconf ()
print ("lwarpmk: Processing the index.")
os.execute(
    xindycmd
    .. "  -M " .. xdyfile
    .. "  -L " .. language
    .. " " .. sourcename .. ".idx")
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
print ("lwarpmk: Done.")

-- lwarp printglossary:
-- Compile the glossary then touch the source
-- to trigger a recompile of the document:

elseif arg[1] == "printglossary" then
loadconf ()
print ("lwarpmk: Processing the glossary.")

os.execute(glossarycmd .. "  -L " .. language .. "  -I xindy -M " .. sourcename ..
    " -t " .. sourcename .. ".glg -o " .. sourcename .. ".gls "
    .. sourcename .. ".glo")
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
print ("lwarpmk: Done.")

-- lwarpmk html:

elseif arg[1] == "html" then
loadconf ()
if ( latexmk == "true" ) then
    compilelatexmk ("_html")
    pdftohtml ()
    print ("lwarpmk: Done.")
else -- not latexmk
    verifyfileexists ( sourcename .. ".tex" ) ;
    -- See if exists and is up to date:
    if (
        ( lfs.attributes ( homehtmlfilename .. ".html" , "modification" ) == nil ) or
        (
            lfs.attributes ( sourcename .. ".tex" , "modification" ) >
            lfs.attributes ( homehtmlfilename .. ".html" , "modification" )
        )
    ) then
        -- Recompile if not yet up to date:
        manytimes("_html")
        pdftohtml ()
        print ("lwarpmk: Done.")
    else
        print ("lwarpmk: " .. homehtmlfilename .. ".html is up to date.")
    end
end -- not latexmk

elseif arg[1] == "pdftohtml" then
    loadconf ()
    pdftohtml ()

-- lwarpmk htmlindex:
-- Compile the index then touch the source
-- to trigger a recompile of the document:

elseif arg[1] == "htmlindex" then
loadconf ()
print ("lwarpmk: Processing the index.")
os.execute(
    xindycmd
    .. "  -M " .. xdyfile
    .. "  -L " .. language
    .. " " .. sourcename .. "_html.idx"
)
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
print ("lwarpmk: Done.")

-- lwarpmk htmlglossary:
-- Compile the glossary then touch the source
-- to trigger a recompile of the document:

elseif arg[1] == "htmlglossary" then
loadconf ()
print ("lwarpmk: Processing the glossary.")

os.execute(glossarycmd .. "  -L " .. language .. "  -I xindy -M " ..sourcename ..
    "_html -t " .. sourcename .. "_html.glg -o " ..sourcename ..
    "_html.gls " ..sourcename .. "_html.glo")

print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
print ("lwarpmk: Done.")

-- lwarpmk limages:
-- Scan the lateximages.txt file to create lateximages,
-- then touch the source to trigger a recompile.

elseif arg[1] == "limages" then
loadconf ()
print ("lwarpmk: Processing images.")
createlateximages ()
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
print ("lwarpmk: Done.")

-- lwarpmk again:
-- Touch the source to trigger a recompile.

elseif arg[1] == "again" then
loadconf ()
print ("lwarpmk: Forcing an update of " .. sourcename ..".tex.")
refreshdate ()
print ("lwarpmk: " .. sourcename ..".tex is ready to be recompiled.")
print ("lwarpmk: Done.")

-- lwarpmk clean:
-- Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log, .gl*

elseif arg[1] == "clean" then
loadconf ()
removeaux ()
print ("lwarpmk: Done.")

-- lwarpmk cleanall
-- Remove project.aux, .toc, .lof, .lot, .idx, .ind, .log, .gl*
--    and also project.pdf, *.html

elseif arg[1] == "cleanall" then
loadconf ()
removeaux ()
os.execute ( rmname .. " " ..
    sourcename .. ".pdf " .. sourcename .. "_html.pdf " ..
    "*.html"
    )
print ("lwarpmk: Done.")

-- lwarpmk with no argument :

elseif (arg[1] == nil) then
printhelp ()

-- lwarpmk -h or lwarpmk --help :

elseif (arg[1] == "-h" ) or (arg[1] == "--help") then
printusage ()

else
print ("lwarpmk: Unknown command \""..arg[1].."\".\n")
printhelp ()
end

end -- not --version
\end{filecontents*}
\end{LWR@createlwarpmk}


\begin{warpHTML}



\newcommand*{\LWR@depthnone}{-5}
\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}
\newcommand*{\LWR@depthlist}{6}
\newcommand*{\LWR@depthlistitem}{7}


\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}{}




\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}



\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
}


\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{warpHTML}

\begin{warpHTML}
\NewDocumentCommand{\LWR@setexparray}{m m m}{%
\ifthenelse{\isempty{#3}}%
{\csdef{#1#2}{}}
{\expandafter\edef\csname #1#2\endcsname{\expandonce#3}}%
}
\newcommand*{\LWR@getexparray}[2]{\csuse{#1#2}}

\end{warpHTML}


\begin{warpHTML}

\let\LWR@origampersand\&
\newcommand*{\HTMLentity}[1]{%
\begingroup%
\LWR@FBcancel%
\LWR@origampersand#1;%
\endgroup
}
\newcommand*{\HTMLunicode}[1]{\HTMLentity{\#x#1}}

\renewcommand*{\&}{\HTMLentity{amp}}

\let\LWR@origtextless\textless
\renewcommand*{\textless}{\HTMLentity{lt}}

\let\LWR@origtextgreater\textgreater
\renewcommand*{\textgreater}{\HTMLentity{gt}}

\end{warpHTML}



\begin{warpall}

\providecommand*{\BaseJobname}{\jobname}

\providecommand*{\HTMLFilename}{}
\providecommand*{\HomeHTMLFilename}{\BaseJobname}

\newcommand*{\SetHTMLFileNumber}[1]{%
\setcounter{LWR@htmlfilenumber}{#1}%
}

\newbool{FileSectionNames}
\booltrue{FileSectionNames}

\end{warpall}

\begin{warpHTML}

\newcounter{LWR@htmlfilenumber}
\setcounter{LWR@htmlfilenumber}{0}

\newcommand*{\LWR@htmlsectionfilename}[1]{%
\LWR@traceinfo{LWR@htmlsectionfilename A}%
\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%
}%
{%
\LWR@traceinfo{LWR@htmlsectionfilename C \LWR@tempone}%
\ifthenelse{%
\equal{\HTMLFilename}{} \AND \equal{\LWR@tempone}{Index} \OR \equal{\LWR@tempone}{index}%
}%
{%
\LWR@traceinfo{prefixing the index name with an underscore.}%
\_#1.html}%
{\HTMLFilename#1.html}%
}%
\LWR@traceinfo{LWR@htmlsectionfilename Z}%
}

\newcommand*{\LWR@htmlrefsectionfilename}[1]{%
\LWR@traceinfo{LWR@htmlrefsectionfilename A: !#1!}%
\LWR@htmlsectionfilename{\LWR@htmlfileref{#1}}%
\LWR@traceinfo{LWR@htmlrefsectionfilename B}%
}

\end{warpHTML}


\begin{warpHTML}

\newcommand*{\LinkHome}{%
\LWR@subhyperrefclass{%
\HomeHTMLFilename.html}%
{Home}{linkhome}%
}

\newcommand*{\LWR@topnavigation}{
\LWR@htmlelementclassline{nav}{topnavigation}{\LinkHome}
}

\newcommand*{\LWR@botnavigation}{
\LWR@htmlelementclassline{nav}{botnavigation}{\LinkHome}
}

\end{warpHTML}



\begin{warpHTML}

\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{warpHTML}


\begin{warpHTML}

\newcommand*{\LWR@closeoneprevious}{%

\LWR@closeone{}

\popclose{}
}

\newcommand*{\LWR@closeprevious}[1]{
\LWR@stoppars
\whiledo{\not\(\LWR@closedepthone<#1\)}{\LWR@closeoneprevious}
}

\end{warpHTML}


\begin{warpHTML}

\newcommand{\LWR@forcenewpage}{%
\LWR@stoppars\LWR@orignewpage\LWR@startpars%
}

\renewcommand*{\pagestyle}[1]{}
\renewcommand*{\thispagestyle}[1]{}
\renewcommand*{\pagenumbering}[1]{}

\end{warpHTML}


\begin{warpHTML}


\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}


\@ifpackagewith{babel}{french}{
\renewcommand*{\FBcolonspace}{~}
\renewcommand*{\FBthinspace}{\,}
}{}

\@ifpackagewith{babel}{french}{%
\newcommand{\LWR@FBcancel}{%
\csdef{FBcolonspace}{}%
\csdef{FBthinspace}{}%
}
}
{% not french:
\newcommand{\LWR@FBcancel}{}
}%

\newcommand*{\LWR@htmltagc}[1]{%
{%
\begingroup%
\LWR@FBcancel%
\ifmmode\else\protect\LWR@origttfamily\fi%
\protect\LWR@origtextless#1\protect\LWR@origtextgreater%
\endgroup%
}%
}

\newcommand*{\LWR@nestspanitem}{%
\if@newlist\else{\LWR@htmltagc{br /}}\fi%
\LWR@origitem%
}

\newenvironment*{LWR@nestspan}
{%
\LWR@traceinfo{LWR@nestspan}%
\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}%
{%
\LWR@traceinfo{LWR@nestspan: inside a lateximage}%
}%
{% not in a lateximage
\LWR@traceinfo{LWR@nestspan: NOT inside a lateximage}%
\addtocounter{LWR@spandepth}{1}%
\RenewDocumentEnvironment{minipage}{O{t} o O{t} m}{}{}%
\RenewDocumentEnvironment{BlockClass}{o m}{}{}%
\renewcommand{\BlockClassSingle}[2]{##2}%
\renewcommand{\LWR@forcenewpage}{}%
\renewcommand{\LWR@itemizestart}{%
\let\item\LWR@nestspanitem%
}%
\renewcommand{\LWR@itemizeend}{}%
\renewcommand{\LWR@enumeratestart}{%
\let\item\LWR@nestspanitem%
}%
\renewcommand{\LWR@enumerateend}{}%
\renewcommand{\LWR@descriptionstart}{%
\let\item\LWR@nestspanitem%
}%
\renewcommand{\LWR@descriptionend}{}%
}% not in a lateximage
}%
{%
\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}%
{}%
{\addtocounter{LWR@spandepth}{-1}}%
\LWR@traceinfo{LWR@nestspan: done}%
}

\AfterEndEnvironment{LWR@nestspan}{\global\let\par\LWR@closeparagraph}

\NewDocumentCommand{\LWR@htmlspan}{m +m}{%
\LWR@ensuredoingapar%
\LWR@htmltagc{#1}%
\begin{LWR@nestspan}%
#2%
\LWR@htmltagc{/#1}%
\end{LWR@nestspan}%
}

\NewDocumentCommand{\LWR@htmlspanclass}{o m +m}{%
\LWR@ensuredoingapar%
\LWR@subhtmlelementclass{span}[#1]{#2}%
\begin{LWR@nestspan}%
#3%
\LWR@htmltagc{/span}%
\end{LWR@nestspan}%
}


\newcommand*{\LWR@htmltagb}[1]{%
\LWR@htmltagc{#1}%
\endgroup%
}

\newcommand*{\LWR@htmltag}{%
\begingroup\catcode`\_=12
\LWR@htmltagb%
}


\newcommand*{\LWR@htmlopencomment}{%
{%
\begingroup%
\LWR@FBcancel%
\ifmmode\else\protect\LWR@origttfamily\fi%
\LWR@origtextless{}!{-}{-}%
\endgroup%
}%
}

\newcommand*{\LWR@htmlclosecomment}{%
{%
\begingroup%
\LWR@FBcancel%
\ifmmode\else\protect\LWR@origttfamily\fi%
{-}{-}\LWR@origtextgreater{}%
\endgroup%
}%
}

\newcommand{\LWR@htmlcomment}[1]{%
\LWR@htmlopencomment{}%
{%
\LWR@origttfamily% break ligatures
#1%
}%
\LWR@htmlclosecomment{}}
\newcommand{\LWR@htmlblockcommentb}[1]
{\LWR@stoppars\LWR@htmlcomment{#1}\LWR@startpars\endgroup}

\newcommand{\LWR@htmlblockcomment}
{%
\begingroup\catcode`\_=12%
\LWR@htmlblockcommentb%
}

\newcommand*{\LWR@htmlblocktag}[1]{%
\LWR@stoppars%
\LWR@htmltag{#1}%
\LWR@startpars%
}


\NewDocumentCommand{\LWR@subhtmlelementclass}{m o m}{%
\IfValueTF{#2}%
{% option
\ifthenelse{\equal{#2}{}}%
{\LWR@htmltag{#1 class="#3"}}% empty option
{\LWR@htmltag{#1 class="#3" style="#2"}}% non-empty option
}% option
{\LWR@htmltag{#1 class="#3"}}% no option
}

\NewDocumentCommand{\LWR@htmlelementclass}{m o m}{%
\LWR@stoppars%
\LWR@subhtmlelementclass{#1}[#2]{#3}%
\LWR@startpars%
}

\newcommand*{\LWR@htmlelementclassend}[2]{%
\LWR@stoppars%
\LWR@htmltag{/#1}%
\ifbool{HTMLDebugComments}{%
\LWR@htmlcomment{End of #1 ``#2''}%
}{}%
\LWR@startpars%
}

\NewDocumentCommand{\LWR@htmldivclass}{o m}{%
\LWR@htmlelementclass{div}[#1]{#2}%
}

\newcommand*{\LWR@htmldivclassend}[1]{%
\LWR@htmlelementclassend{div}{#1}%
}



\NewDocumentCommand{\LWR@htmlelementclassline}{m o m +m}{%
\LWR@stoppars
\LWR@subhtmlelementclass{#1}[#2]{#3}%
#4%
\LWR@htmltag{/#1}
\LWR@startpars
}


\newcommand*{\LWR@htmlelement}[1]{%
\LWR@htmlblocktag{#1}
}

\newcommand*{\LWR@htmlelementend}[1]{%
\LWR@stoppars
\LWR@htmltag{/#1}
\LWR@startpars
}

\end{warpHTML}




\begin{warpHTML}
\NewDocumentEnvironment{BlockClass}{o m}%
{
\LWR@htmldivclass[#1]{#2}
}
{
\LWR@htmldivclassend{#2}
}
\end{warpHTML}
\begin{warpprint}
\NewDocumentEnvironment{BlockClass}{o m}{}{}%
\end{warpprint}
\begin{warpHTML}
\newcommand{\BlockClassSingle}[2]{%
\LWR@htmlelementclassline{div}{#1}{#2}%
}
\end{warpHTML}
\begin{warpprint}
\newcommand{\BlockClassSingle}[2]{#2}
\end{warpprint}

\begin{warpHTML}
\NewDocumentCommand{\InlineClass}{o m +m}{%
\LWR@htmlspanclass[#1]{#2}{#3}%
}
\end{warpHTML}
\begin{warpprint}
\NewDocumentCommand{\InlineClass}{o m +m}{#3}%
\end{warpprint}


\begin{warpHTML}

\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}}{}}

\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{warpHTML}


\begin{warpHTML}

\newcounter{LWR@spandepth}
\setcounter{LWR@spandepth}{0}

\newbool{LWR@doingstartpars}
\boolfalse{LWR@doingstartpars}

\newbool{LWR@doingapar}
\global\boolfalse{LWR@doingapar}

\newcommand*{\LWR@ensuredoingapar}{%
\ifbool{LWR@doingstartpars}%
{\global\booltrue{LWR@doingapar}}%
{}%
}

\newcommand*{\LWR@openparagraph}
{%
\ifbool{LWR@doingstartpars}%
{% handling pars
\ifthenelse{%
\cnttest{\value{LWR@lateximagedepth}}{>}{0} \OR%
\cnttest{\value{LWR@spandepth}}{>}{0}%
}% nested par tags?
{}% no nested par tags
{% yes nest par tags
\LWR@htmltagc{\LWR@tagregularparagraph}%
\ifnumcomp{\@listdepth}{>}{0}%
{%
\LWR@orighspace{1in}%
}{}%
\global\booltrue{LWR@doingapar}%
\let\par\LWR@closeparagraph%
}% end of yes nest par tags
}% end of handling pars
{}% not handling pars
}

\newcommand*{\LWR@closeparagraph}
{%
\ifbool{LWR@doingapar}%
{% handling pars
\ifthenelse{%
\cnttest{\value{LWR@lateximagedepth}}{>}{0} \OR%
\cnttest{\value{LWR@spandepth}}{>}{0}%
}%
{% 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
{% yes nest par tags
\unskip%
\LWR@htmltagc{/\LWR@tagregularparagraph}%
\global\boolfalse{LWR@doingapar}%
\global\boolfalse{LWR@minipagethispar}%
}% end of yes nest par tags
}% end of handling pars
{% not handling pars
\ifthenelse{\cnttest{\value{LWR@spandepth}}{>}{0}}%
{\ifbool{LWR@intabularmetadata}{}{\unskip\LWR@htmltagc{br /}}}%
{}%
}% not handling pars
\LWR@origpar%
}

\end{warpHTML}


\begin{warpHTML}

\newcommand*{\LWR@startpars}%
{%
\ifthenelse{\cnttest{\value{LWR@spandepth}}{>}{0}}%
{}%
{%
\ifbool{LWR@doingstartpars}%
{}%
{%
\PushPreHook{par}{\LWR@openparagraph}%
\let\par\LWR@closeparagraph

}% an intentionally blank line
\global\setbool{LWR@doingstartpars}{true}%
\global\boolfalse{LWR@doingapar}%
}% nestspan
}

\newcommand*{\LWR@stoppars}%
{%
\ifthenelse{\cnttest{\value{LWR@spandepth}}{>}{0}}%
{}%
{%
\ifbool{LWR@doingapar}%
{%
\unskip%
\LWR@htmltagc{/\LWR@tagregularparagraph}%
\global\boolfalse{LWR@doingapar}%
\global\boolfalse{LWR@minipagethispar}

}% an intentionally blank line
{}%
\ifbool{LWR@doingstartpars}%
{%
\ClearPreHook{par}%
}%
{}%
\global\setbool{LWR@doingstartpars}{false}%
\global\boolfalse{LWR@doingapar}%
}% nestspan
}

\end{warpHTML}


\begin{warpall}

\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
}
\newcommand{\HTMLFirstPageTop}{%
\catcode`\_=12
\LWR@setfirstpagetopb
}
\newcommand{\LWR@setpagetopb}[1]{%
\renewcommand{\LWR@pagetop}{#1}
\catcode`\_=8
}
\newcommand{\HTMLPageTop}{%
\catcode`\_=12
\LWR@setpagetopb
}
\newcommand{\LWR@setpagebottomb}[1]{%
\renewcommand{\LWR@pagebottom}{#1}
\catcode`\_=8
}
\newcommand{\HTMLPageBottom}{%
\catcode`\_=12
\LWR@setpagebottomb
}

\end{warpall}


\begin{warpHTML}


\newcommand*{\LWR@currentcss}{lwarp.css}

\newcommand*{\LWR@newcssb}[1]{%
\renewcommand*{\LWR@currentcss}{#1}
\catcode`\_=8
}

\newcommand*{\CSSFilename}{
\catcode`\_=12
\LWR@newcssb
}
\end{warpHTML}
\begin{warpprint}
\newcommand*{\CSSFilename}[1]{}
\end{warpprint}


\begin{warpall}

\providecommand{\theauthor}{}
\newcommand{\theHTMLAuthor}{\theauthor}

\newcommand{\HTMLAuthor}[1]{\renewcommand{\theHTMLAuthor}{#1}}

\end{warpall}

\begin{warpall}


\newcommand{\LWR@currentHTMLDescription}{}

\newcommand{\HTMLDescription}[1]{%
\renewcommand{\LWR@currentHTMLDescription}{#1}
}

\end{warpall}

\begin{warpHTML}

\newbox\LWR@footnotes
\long\def\@makefntext#1{\textsuperscript{\@thefnmark} #1}

\def\@makefnmark{\hbox{\textsuperscript{\@thefnmark}}}
\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%
}%
\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}%
{}%
{\LWR@htmltagc{/\LWR@tagregularparagraph}}%
\color@endgroup}%
}
\newcommand*{\LWR@printpendingfootnotes}{%
\ifvoid\LWR@footnotes\else
\LWR@forcenewpage
\begin{BlockClass}{footnotes}
\LWR@origmedskip
\unvbox\LWR@footnotes
\setbox\LWR@footnotes=\vbox{}
\end{BlockClass}
\fi
}
\newcommand*{\LWR@epubprintpendingfootnotes}{%
\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}%
{\LWR@printpendingfootnotes}%
{}%
}

\end{warpHTML}

\begin{warpHTML}

\renewcommand{\marginpar}[2][]{%
\LWR@htmlspanclass{marginpar}{#2}%
}

\end{warpHTML}


\begin{warpall}

\newcounter{FileDepth}
\setcounter{FileDepth}{-5}

\newbool{CombineHigherDepths}
\booltrue{CombineHigherDepths}

\end{warpall}

\begin{warpHTML}

\newcommand*{\LWR@thisfilename}{}

\newcommand*{\LWR@thisnewfilename}{}

\newcommand*{\LWR@filenamenoblanks}[1]{%
\begingroup

\LWR@nullfonts
\renewcommand*{\LWR@htmltagc}[1]{}%
\edef\LWR@thisnewfilename{#1}
\fullexpandarg
\StrSubstitute{\LWR@thisnewfilename}{ }{-}[\LWR@thisnewfilename]
\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]
\StrSubstitute{\LWR@thisnewfilename}{[}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{]}{-}[\LWR@thisnewfilename]
\StrSubstitute{\LWR@thisnewfilename}{`}{-}[\LWR@thisnewfilename]
\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]
\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]
\global\let\LWR@thisfilename\LWR@thisnewfilename% return a global result
\endgroup
}

\newcommand*{\LWR@newhtmlfile}[1]{


\LWR@htmlelementclassend{section}{textbody}

\LWR@printpendingfootnotes

\ifbool{FormatEPUB}
{}
{
\LWR@htmlelement{footer}

\LWR@pagebottom

\LWR@htmlelementend{footer}
}
\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
{}
{\ifnumcomp{\value{LWR@htmlfilenumber}}{>}{0}{\LWR@botnavigation}{}}

\LWR@stoppars
\LWR@htmltag{/body}\LWR@orignewline
\LWR@htmltag{/html}\LWR@orignewline
\LWR@orignewpage

\addtocounter{LWR@htmlfilenumber}{1}%

\ifbool{FileSectionNames}%
{\LWR@filenamenoblanks{#1}}
{\renewcommand*{\LWR@thisfilename}{\theLWR@htmlfilenumber}}

\LWR@htmlblockcomment{%
|Start file|%
\LWR@htmlsectionfilename{\LWR@thisfilename}|%
}

\LWR@stoppars

\LWR@filestart{ — #1}% there is an EMdash in front of the #1

\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
{}
{\LWR@topnavigation}

\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
{}
{
\LWR@htmlelement{header}

\LWR@pagetop

\LWR@htmlelementend{header}
}

\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
{}
{\ifcsvoid{thetitle}{}{\LWR@printthetitle}}

\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
{}
{\LWR@sidetoc}

\LWR@htmlelementclass{section}{textbody}

\LWR@stoppars

\setcounter{LWR@latestautopage}{\value{page}}
}

\end{warpHTML}


\begin{warpHTML}
\newbool{LWR@mainmatter}
\DeclareDocumentCommand{\mainmatter}{}{%
\booltrue{LWR@mainmatter}%
}

\DeclareDocumentCommand{\frontmatter}{}{%
\boolfalse{LWR@mainmatter}%
}

\DeclareDocumentCommand{\backmatter}{}{%
\boolfalse{LWR@mainmatter}
}
\newcommand*{\LWR@sectionnumber}[1]{%
\InlineClass{sectionnumber}{#1} %
}

\newcommand*{\LWR@createautosec}[1]{%
\LWR@htmltag{#1 id="autosec-\thepage"{}}%
}

\NewDocumentCommand{\LWR@pushoneclose}{m m}{\pushclose{#2}{#1}}

\NewDocumentCommand{\LWR@startnewdepth}{m m}{%
\LWR@closeprevious{#1}%
\LWR@pushoneclose{#1}{#2}%
}
\newcounter{LWR@prevFileDepth}
\setcounter{LWR@prevFileDepth}{\LWR@depthsubparagraph}
\DeclareDocumentCommand{\LWR@section}{m m m m}{%
\LWR@traceinfo{LWR@section}%
\LWR@stoppars%
\global\boolfalse{LWR@minipagethispar}%
\LWR@traceinfo{LWR@section: testing whether to start a new HTML file}%
\IfBooleanTF{#1}{% starred
\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}}%
\)%
}%
{% new file
\LWR@traceinfo{LWR@section: new HTML file}%
\IfNoValueTF{#2}%
{\LWR@newhtmlfile{#3}}%
{\LWR@newhtmlfile{#2}}%
}% new file
{% not new file
\LWR@orignewpage%

}% not new file
}% not starred
\LWR@traceinfo{LWR@section: about to LWR@setlatestname}%
\IfValueTF{#2}{\LWR@setlatestname{#2}}{\LWR@setlatestname{#3}}%

\ifbool{HTMLDebugComments}{%
\LWR@htmlcomment{Opening #4 ``#3''{}}
}{}

\ifthenelse{%
\cnttest{\csuse{LWR@depth#4}}{>=}{\LWR@depthparagraph}%
}%
{\LWR@startpars}
{}
\LWR@createautosec{\csuse{LWR@tag#4}}%
\IfBooleanTF{#1}%
{}% starred
{% not starred
\ifthenelse{%
\cnttest{\csuse{LWR@depth#4}}{<=}{\value{secnumdepth}}%
}%
{% if secnumdepth
\LWR@traceinfo{LWR@section: about to test main matter}%
\ifbool{LWR@mainmatter}%
{%
\LWR@traceinfo{LWR@section: yes mainmatter}%
\refstepcounter{#4}%
\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
{% 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
{%
\addcontentsline{toc}{#4}{\IfValueTF{#2}{#2}{#3}}%
}%
\ifbool{LWR@mainmatter}%
{%
\ifthenelse{%
\(\cnttest{\csuse{LWR@depth#4}}{<=}%
{\value{secnumdepth}}\) \AND
\(\cnttest{\csuse{LWR@depth#4}}{<=}{\LWR@depthpart}\)
}%
{\csuse{#4name}~{}}%
{}%
\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
#3
\LWR@htmltag{\csuse{LWR@tag#4end}}%
\label{autopage-\thepage}%
\ifthenelse{%
\cnttest{\csuse{LWR@depth#4}}{<}{\LWR@depthparagraph}}%
{\LWR@startpars}%
{}%
\IfBooleanTF{#1}{}{% not starred
\setcounter{LWR@prevFileDepth}{\csuse{LWR@depth#4}}%
}% not starred
\LWR@traceinfo{LWR@section: done}%
}


\@ifundefined{chapter}
{}
{%
\DeclareDocumentCommand{\part}{s o m}{%
\LWR@epubprintpendingfootnotes%
\LWR@stoppars%

\LWR@startnewdepth{\LWR@depthpart}{\LWR@printclosepart}%

\LWR@section{#1}{#2}{#3}{part}%
}
}

\@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}%
}
}

\DeclareDocumentCommand{\section}{s o m}{%
\LWR@epubprintpendingfootnotes%
\LWR@stoppars%

\LWR@startnewdepth{\LWR@depthsection}{\LWR@printclosesection}%

\LWR@section{#1}{#2}{#3}{section}%
}

\DeclareDocumentCommand{\subsection}{s o m}{%
\LWR@epubprintpendingfootnotes%
\LWR@stoppars%

\LWR@startnewdepth{\LWR@depthsubsection}{\LWR@printclosesubsection}%

\LWR@section{#1}{#2}{#3}{subsection}%
}

\DeclareDocumentCommand{\subsubsection}{s o m}{%
\LWR@epubprintpendingfootnotes%
\LWR@stoppars%

\LWR@startnewdepth{\LWR@depthsubsubsection}%
{\LWR@printclosesubsubsection}%

\LWR@section{#1}{#2}{#3}{subsubsection}%
}

\DeclareDocumentCommand{\paragraph}{s o m}{%
\LWR@epubprintpendingfootnotes%
\LWR@stoppars%

\LWR@startnewdepth{\LWR@depthparagraph}{\LWR@printcloseparagraph}%

\LWR@section{#1}{#2}{#3}{paragraph}%
}

\DeclareDocumentCommand{\subparagraph}{s o m}{%
\LWR@epubprintpendingfootnotes%
\LWR@stoppars%

\LWR@startnewdepth{\LWR@depthsubparagraph}{\LWR@printclosesubparagraph}%

\LWR@section{#1}{#2}{#3}{subparagraph}%
}

\end{warpHTML}


\begin{warpall}

\newcommand*{\LWR@currentHTMLLanguage}{en-US}

\newcommand*{\HTMLLanguage}[1]{%
\renewcommand*{\LWR@currentHTMLLanguage}{#1}%
}

\end{warpall}

\begin{warpHTML}


\newcommand*{\LWR@filestart}[1]{
\LWR@traceinfo{LWR@filestart}
\begingroup
\LWR@traceinfo{LWR@filestart: A}
\LWR@nullfonts
\LWR@traceinfo{LWR@filestart: B}
\LWR@htmltag{!DOCTYPE html}\LWR@orignewline
\LWR@traceinfo{LWR@filestart: C}
\LWR@htmltag{html lang="\LWR@currentHTMLLanguage"{}}\LWR@orignewline
\LWR@htmltag{head}\LWR@orignewline
\LWR@htmltag{meta charset="UTF-8" /}\LWR@orignewline
\ifcsempty{theHTMLAuthor}{}{
\LWR@htmltag{meta name="author" content="\theHTMLAuthor" /}\LWR@orignewline
}
\LWR@htmltag{meta name="generator" content="LaTeX lwarp package" /}%
    \LWR@orignewline
\ifdefempty{\LWR@currentHTMLDescription}{}{%
\LWR@htmltag{%
meta name="description" content="\LWR@currentHTMLDescription" /}%
    \LWR@orignewline
}%
\LWR@htmltag{meta name="viewport" %
content="width=device-width, initial-scale=1.0" /}%
    \LWR@orignewline
\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
\ifcsvoid{thetitle}{}{%
\LWR@htmltag{title}\thetitle#1\LWR@htmltag{/title}\LWR@orignewline%
}%
\LWR@htmltag{%
link rel="stylesheet" type="text/css" href="\LWR@currentcss" /}%
\LWR@orignewline
\ifbool{mathjax}%
{%
\boolfalse{LWR@verbtags}
\verbatiminput{lwarp_mathjax.txt}%
\booltrue{LWR@verbtags}
\LWR@stoppars
}% end of mathjax
{}%
\LWR@htmltag{/head}\LWR@orignewline
\LWR@htmltag{body}\LWR@orignewline
\endgroup
\LWR@traceinfo{LWR@filestart: done}
}

\end{warpHTML}


\begin{warpHTML}

\catcode`\$=\active
\newcommand*{\LWR@LwarpStart}
{%
\LWR@traceinfo{LWR@lwarpStart}
\ifbool{FormatWordProcessor}{%
\setcounter{FileDepth}{-5}%
\boolfalse{HTMLDebugComments}%
}{}
\edef\LWR@strresult{\HomeHTMLFilename}
\edef\HomeHTMLFilename{\detokenize\expandafter{\LWR@strresult}}
\edef\LWR@strresult{\HTMLFilename}
\edef\HTMLFilename{\detokenize\expandafter{\LWR@strresult}}
\LWR@origonecolumn%
\LWR@origpagestyle{empty}
\LWR@origscriptsize%
\LWR@origraggedright%
\LetLtxMacro{\\}{\LWR@endofline}%
\linespread{1.3}%
\setlength{\parindent}{0pt}
\setlength{\parskip}{2ex}
\immediate\openout\LWR@file=lateximages.txt
\setlength{\belowcaptionskip}{-3ex}
\renewcommand{\ps@plain}{}
\renewcommand*{\centering}{}
\renewcommand*{\raggedleft}{}
\renewcommand*{\raggedright}{}
\LetLtxMacro{\LWR@origtabular}{\tabular}
\LetLtxMacro{\LWR@origendtabular}{\endtabular}
\LetLtxMacro{\tabular}{\LWR@tabular}
\LetLtxMacro{\endtabular}{\endLWR@tabular}
\let\LWR@origcaption\caption
\let\LWR@origltx@label\ltx@label
\let\ltx@label\LWR@htmlmathlabel
\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
\LetLtxMacro{\rotatebox}{\LWR@rotatebox}
\LetLtxMacro{\scalebox}{\LWR@scalebox}
\let\reflectbox\LWR@reflectbox
\global\boolfalse{LWR@doingapar}
\global\boolfalse{LWR@doingstartpars}
\LWR@traceinfo{LWR@lwarpStart: Starting new file.}
\LWR@filestart{}
\LWR@traceinfo{LWR@lwarpStart: Generating first header.}
\LWR@htmltag{header}\LWR@orignewline
\LWR@startpars
\LWR@firstpagetop
\LWR@stoppars
\LWR@htmltag{/header}\LWR@orignewline
\LWR@traceinfo{LWR@lwarpStart: Generating textbody.}
\LWR@htmltag{section class="textbody"{}}
\mainmatter
\LWR@origpagenumbering{arabic}
\if@titlepage
   \thanksmarkseries{arabic}
\else
   \thanksmarkseries{fnsymbol}
\fi
\LWR@patchlists
\catcode`\$=\active
\LWR@startpars
\LWR@traceinfo{LWR@lwarpStart: done}
}
\catcode`\$=3% math shift until lwarp starts


\end{warpHTML}


\begin{warpHTML}


\newcommand*{\LWR@requesttoc}[2]{%
\ifbool{#1}
{
\expandafter\newwrite\csuse{tf@#2}
\immediate\openout \csuse{tf@#2} \jobname.#2\relax
}{}
}

\newcommand*{\LWR@LwarpEnd}
{
\LWR@stoppars
\LWR@closeprevious{\LWR@depthfinished}

\LWR@htmlelementclassend{section}{textbody}
\LWR@printpendingfootnotes
\LWR@htmlelement{footer}

\LWR@pagebottom

\LWR@htmlelementend{footer}

\ifthenelse{\boolean{FormatEPUB}\OR\boolean{FormatWordProcessor}}
{}
{
\ifnumcomp{\value{LWR@htmlfilenumber}}{>}{0}{\LWR@botnavigation}{}
}
\LWR@stoppars% final stop of all paragraphs
\LWR@htmltag{/body}\LWR@orignewline
\LWR@htmltag{/html}\LWR@orignewline
\LWR@orignewpage
\immediate\closeout\LWR@file
}

\end{warpHTML}


\begin{warpHTML}
\newrobustcmd{\affiliation}[1]{\\ \InlineClass{affiliation}{#1}}
\end{warpHTML}
\begin{warpprint}
\newrobustcmd{\affiliation}[1]{\\ \textsc{\small#1}}
\end{warpprint}
\begin{warpall}
\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}
\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}{}
\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{warpall}
\begin{warpHTML}
\renewenvironment*{titlepage}
{
\LWR@forcenewpage
\BlockClass{titlepage}\LWR@subminipage
}
{\LWR@endsubminipage\endBlockClass}
\renewenvironment*{titlingpage}
{%
\begin{titlepage}
\LWR@maketitlesetup
\let\maketitle\LWR@titlingmaketitle
}
{
\end{titlepage}
\@bscontmark
}
\end{warpHTML}

\begin{warpall}
\newcommand*{\printthanks}{\@thanks}
\AtEndEnvironment{titlingpage}{\@bscontmark}
\end{warpall}

\begin{warpHTML}
\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}}
\newcommand*{\printpublished}{
\ifthenelse{\equal{\thepublished}{}}
{}
{
\begin{BlockClass}{published}
\@published
\end{BlockClass}
}
}

\newcommand*{\printtitle}
{
\LWR@stoppars
\LWR@htmltag{h1}%
\@title%
\LWR@htmltag{/h1}
\LWR@startpars
}
\newcommand*{\LWR@printthetitle}
{
\LWR@stoppars
\LWR@htmltag{h1}%
\thetitle%
\LWR@htmltag{/h1}
\LWR@startpars
}

\newcommand*{\printsubtitle}{
\ifthenelse{\equal{\thesubtitle}{}}
{}
{
\begin{BlockClass}{subtitle}
\@subtitle
\end{BlockClass}
}
}

\newcommand*{\printauthor}{
\begin{BlockClass}{author}
\begin{tabular}{c}\@author\end{tabular}
\end{BlockClass}
}

\newcommand*{\printdate}{%
\begin{BlockClass}{titledate}
\@date
\end{BlockClass}
}

\end{warpHTML}

\begin{warpprint}

\newcommand*{\printpublished}{{\Large\scshape\@published}}

\newcommand*{\printtitle}{{\Huge\@title}}

\newcommand*{\printsubtitle}{{\Large\itshape\@subtitle\bigskip}}

\newcommand*{\printauthor}
    {{\large\begin{tabular}[t]{c}\@author\end{tabular}}}

\newcommand*{\printdate}{{\small\textit{\@date}}}
\providecommand{\maketitle}{}
\if@titlepage
  \renewcommand{\maketitle}{\begin{titlepage}%
    \let\footnotesize\small
    \let\footnoterule\relax
    \LetLtxMacro{\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}%
}
\newcommand{\postsubtitle}[1]{%
\def\@bspostsubtitle{#1}%
}
\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{warpprint}
\begin{warpHTML}
\newcommand*{\LWR@maketitlesetup}{%
\@bsmarkseries
\@mpbsmarkseries
\def\@makefnmark{\textsuperscript{\thefootnote}}
\long\def\@makefntext##1{%
\makethanksmark \LWR@orighspace{1in}
##1%
}%
}

\def\@fnsymbol#1{\ifcase#1\or *\or \HTMLentity{dagger}\or \HTMLentity{Dagger}\or
   \HTMLentity{sect}\or \HTMLentity{para}\or \text{\HTMLunicode{2016}}\or
   **\or \HTMLentity{dagger}\HTMLentity{dagger} \or
   \HTMLentity{Dagger}\HTMLentity{Dagger} \else\@ctrerr\fi}
\renewcommand*{\maketitle}{%
\begin{titlepage}
\LWR@maketitlesetup
\@maketitle
\@thanks
\end{titlepage}
\@bscontmark
}

\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
}

\providecommand{\maketitlehookaa}{}
\providecommand{\maketitlehookaaa}{}

\newcommand*{\LWR@titlingmaketitle}{%
\@maketitle
\@thanks
}

\renewcommand{\thanksmarkseries}[1]{%
\def\@mpbsmarkseries{%
\renewcommand*{\thempfootnote}{\@nameuse{#1}{mpfootnote}}}%
\def\@bsmarkseries{\renewcommand{\thefootnote}{\@nameuse{#1}{footnote}}}%
}
\end{warpHTML}

\begin{warpHTML}

\providecommand*{\abstractname}{Abstract}
\DeclareDocumentEnvironment{abstract}{}
{
\LWR@forcenewpage
\BlockClass{abstract}
\BlockClassSingle{abstracttitle}{\abstractname}
}
{
\endBlockClass
}

\end{warpHTML}





\begin{warpHTML}
\newcommand{\attribution}[1]{%
\InlineClass{attribution}{—\,#1}}% emdash
\end{warpHTML}
\begin{warpprint}
\newcommand{\attribution}[1]{\textsc{---\,#1}}
\end{warpprint}

\begin{warpHTML}
\newcommand{\citetitle}[1]{%
\InlineClass{citetitle}{—\,#1}}% emdash
\end{warpHTML}
\begin{warpprint}
\newcommand{\citetitle}[1]{\textsl{---\,#1}}
\end{warpprint}


\begin{warpHTML}
\renewenvironment*{quote}
{
\LWR@forcenewpage
\LWR@htmlblocktag{blockquote}
}
{\LWR@htmlblocktag{/blockquote}}

\renewenvironment*{quotation}
{
\LWR@forcenewpage
\LWR@htmlblocktag{blockquotation}
}
{\LWR@htmlblocktag{/blockquotation}}

\end{warpHTML}

\begin{warpall}

\newlength{\HTMLvleftskip}
\setlength{\HTMLvleftskip}{1em}

\newlength{\HTMLleftmargini}
\setlength{\HTMLleftmargini}{4.5em}

\end{warpall}



\begin{warpall}
\newlength{\VerbatimHTMLWidth}
\setlength{\VerbatimHTMLWidth}{4in}
\end{warpall}

\begin{warpHTML}

\newbool{LWR@verbtags}
\booltrue{LWR@verbtags}

\newcommand*{\LWR@atbeginverbatim}[2][]
{%
\setlength{\parskip}{0ex}%
\LWR@stoppars%
\ifbool{LWR@verbtags}{%
\LWR@htmltag{pre class="#2"
\ifthenelse{\equal{#1}{}}{}{style="#1"}%
}% pre
}{}%
\begingroup%
\LWR@origttfamily%
\LetLtxMacro{\hspace}{\LWR@orighspace}%
}

\newcommand*{\LWR@afterendverbatim}{%
\endgroup%
\unskip%
\ifbool{LWR@verbtags}{\noindent\LWR@htmltag{/pre}

}{}%
\LWR@startpars%
}

\let\LWRV@origverbatim@input\verbatim@input

\renewcommand{\verbatim@input}[2]{%
\ifbool{LWR@verbtags}{\LWR@forcenewpage}{}%
\LWR@atbeginverbatim{Verbatim}\unskip\LWR@origvspace*{-\baselineskip}%%
\LWRV@origverbatim@input{#1}{#2}%
\unskip\LWR@origvspace*{-\baselineskip}\LWR@afterendverbatim%
}

\AfterEndPreamble{
\LWR@traceinfo{Patching verbatim.}
\AtBeginEnvironment{verbatim}{%
\LWR@forcenewpage
\LWR@atbeginverbatim{verbatim}\unskip\LWR@origvspace*{-\baselineskip}%
}
\AfterEndEnvironment{verbatim}{\unskip\LWR@origvspace*{-\baselineskip}\LWR@afterendverbatim}
}

\end{warpHTML}


\begin{warpHTML}

\renewcommand{\@begintheorem}[2]{%
\LWR@forcenewpage
\BlockClass{theoremcontents}
\InlineClass{theoremlabel}{#1\ #2\ }
}
\renewcommand{\@opargbegintheorem}[3]{%
\LWR@forcenewpage
\BlockClass{theoremcontents}
\InlineClass{theoremlabel}{#1\ #2\ (#3)\ }
}
\renewcommand*{\@endtheorem}{%
\endBlockClass% theoremcontents
}

\end{warpHTML}


\begin{warpHTML}

\newcommand*{\LWR@itemizeitem}{%
\LWR@stoppars%
\LWR@startnewdepth{\LWR@depthlistitem}{\LWR@printcloselistitem{}}%
\LWR@htmltag{li}%
\LWR@startpars%
\LWR@origitem%
}

\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%
}

\newcommand*{\LWR@itemizeend}{%
\LWR@stoppars%
\LWR@closeprevious{\LWR@depthlistitem}%
\LWR@closeoneprevious{}%
\LWR@startpars%
}



\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%
}

\newcommand*{\LWR@enumerateend}{%
\LWR@stoppars%
\LWR@closeprevious{\LWR@depthlistitem}%
\LWR@closeoneprevious{}%
\LWR@startpars%
}


\newcommand*{\LWR@descitem}[1][]%
{%
\LWR@stoppars%
\LWR@setlatestname{#1}%
\LWR@startnewdepth{\LWR@depthlistitem}{\LWR@printclosedescitem{}}%
\LetLtxMacro{\hspace}{\LWR@nohspace}%
\LWR@origitem[]%
\LetLtxMacro{\hspace}{\LWR@hspace}%
\LWR@orighspace{1in}
\LWR@htmltag{dt}#1\LWR@htmltag{/dt}%
\LWR@orignewline%
\LWR@htmltag{dd}%
\LWR@startpars%
}

\newcommand*{\LWR@descriptionstart}{%
\LWR@stoppars%
\LWR@pushoneclose{\LWR@depthlist}{\LWR@printclosedescription{}}%
\LWR@htmltag{dl}%
\LWR@startpars%
\let\item\LWR@descitem%
}

\newcommand*{\LWR@descriptionend}{%
\LWR@stoppars%
\LWR@closeprevious{\LWR@depthlistitem}%
\LWR@closeoneprevious{}%
\LWR@startpars%
}

\newcommand*{\LWR@patchlists}{%
\LetLtxMacro{\LWR@origitem}{\item}
\AtBeginEnvironment{itemize}{\LWR@itemizestart}
\AtEndEnvironment{itemize}{\LWR@itemizeend}
\AtBeginEnvironment{enumerate}{\LWR@enumeratestart}
\AtEndEnvironment{enumerate}{\LWR@enumerateend}
\AtBeginEnvironment{description}{\LWR@descriptionstart}
\AtEndEnvironment{description}{\LWR@descriptionend}
}

\end{warpHTML}



\begin{warpHTML}

\newcommand\LWR@mynexttoken\relax




\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=\LWR@fnslthree%
\else\let\next=\nexttoken\fi\next}
\def\LWR@fnslthree{\afterassignment\LWR@fnslone\let\next= }

\newcommand*{\LWR@getmynexttoken}{%
\LWR@traceinfo{LWR@getmynexttoken}%
\LWR@futurenonspacelet\LWR@mynexttoken\LWR@tabledatacolumntag
}


\newbool{LWR@startedrow}
\boolfalse{LWR@startedrow}

\newbool{LWR@doinghline}
\boolfalse{LWR@doinghline}

\newbool{LWR@doingtbrule}
\boolfalse{LWR@doingtbrule}

\newbool{LWR@tableparcell}

\newbool{LWR@skippingmrowcell}

\newbool{LWR@skipatbang}

\newbool{LWR@intabularmetadata}
\boolfalse{LWR@intabularmetadata}


\newcommand*{\LWR@closetabledatacell}{%
\global\booltrue{LWR@intabularmetadata}%
\ifbool{LWR@exitingtabular}{}%
{% not exiting tabular
\ifbool{LWR@skippingmrowcell}{}%
{% not skippingmrowcell
\unskip%
\LWR@getexparray{LWR@colafterspec}{\theLWR@tablecolspos}%
\ifbool{LWR@tableparcell}{\LWR@stoppars}{}%
\global\boolfalse{LWR@tableparcell}%
\leavevmode\unskip\LWR@htmltag{/td}\LWR@orignewline%
\ifbool{LWR@skipatbang}%
{\boolfalse{LWR@skipatbang}}%
{%
\LWR@printatbang{at}{\theLWR@tablecolspos}%
\LWR@printatbang{bang}{\theLWR@tablecolspos}%
}% not skipping at or bang
}% not skipping mrowcell
}% not exiting tabular
\global\boolfalse{LWR@skippingmrowcell}%
}

\newcounter{LWR@tabulardepth}
\setcounter{LWR@tabulardepth}{0}

\let\LWR@origampmacro&

\end{warpHTML}
\begin{warpall}
\newcommand{\StartDefiningTabulars}{%
\warpHTMLonly{\catcode`\&=\active}%
}
\newcommand{\EndDefiningTabulars}{%
\warpHTMLonly{\catcode`\&=4}%
}

\end{warpall}
\begin{warpHTML}

\newcommand*{\LWR@tabularampersand}{%
\LWR@traceinfo{LWR@tabularampersand}%
\ifthenelse{\cnttest{\value{LWR@tabulardepth}}{>}{0}}%
{%
\unskip%
\LWR@closetabledatacell%
\addtocounter{LWR@tablecolspos}{1}%
\LWR@getmynexttoken%
}%
{\LWR@origampmacro}%
}


\NewDocumentCommand{\LWR@tabularendofline}{s o}
{%
\LWR@closetabledatacell%
\LWR@htmltag{/tr}\LWR@orignewline
\global\booltrue{LWR@intabularmetadata}
\global\boolfalse{LWR@startedrow}
\global\boolfalse{LWR@doinghline}%
\global\boolfalse{LWR@doingtbrule}%
\LWR@clearmidrules%
\setcounter{LWR@tablecolspos}{1}
\LWR@getmynexttoken%
}


\newcommand*{\LWR@colsresult}{}%temp storage for column format results
\newcommand*{\LWR@pposition}{}
\newcommand*{\LWR@pleft}{}
\newcommand*{\LWR@pright}{}

\newcommand*{\LWR@tablecolspec}{}

\newcommand*{\LWR@strresult}{}
\newcommand*{\LWR@strresulttwo}{}

\newcommand*{\LWR@origcolspec}{}

\newcounter{LWR@tablecolswidth}

\newcounter{LWR@tablecolspos}

\newcounter{LWR@tabletotalcols}

\newcounter{LWR@tabletotalcolsnext}


\newcommand*{\LWR@colparameter}{}
\newcommand*{\LWR@parseatcolumn}{%
\LWR@traceinfo{at column}%
\addtocounter{LWR@tablecolspos}{1}%
\LWR@traceinfo{about to read the next token:}%
\expandarg%
\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter]
\fullexpandarg%
\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@colparameter}%
\LWR@traceinfo{at the left edge: %
  \LWR@getexparray{LWR@colatspec}{leftedge}}%
}%
{% not at the left edge:
\LWR@traceinfo{not at the left edge}%
\LWR@setexparray{LWR@colatspec}{\theLWR@tabletotalcols}{\LWR@colparameter}%
\LWR@traceinfo{at \theLWR@tabletotalcols: %
  \LWR@getexparray{LWR@colatspec}{\theLWR@tabletotalcols}}%
}%
\let\LWR@colparameter\relax%
\booltrue{LWR@validtablecol}%
}
\newcommand*{\LWR@parsebangcolumn}{%
\LWR@traceinfo{bang column}%
\addtocounter{LWR@tablecolspos}{1}%
\LWR@traceinfo{about to read the next token:}%
\expandarg%
\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter]
\fullexpandarg%
\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@colparameter}%
}%
{% not at the left edge:
\LWR@traceinfo{not at the left edge}%
\LWR@setexparray{LWR@colbangspec}{\theLWR@tabletotalcols}{\LWR@colparameter}%
\LWR@traceinfo{bang \theLWR@tabletotalcols: \LWR@colparameter!}%
}%
\let\LWR@colparameter\relax%
\booltrue{LWR@validtablecol}%
}
\newcommand*{\LWR@parsebeforecolumn}{%
\addtocounter{LWR@tablecolspos}{1}%
\expandarg%
\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter]%
\fullexpandarg%
\LWR@setexparray{LWR@colbeforespec}{\theLWR@tabletotalcolsnext}{\LWR@colparameter}%
\let\LWR@colparameter\relax%
\booltrue{LWR@validtablecol}%
}
\newcommand*{\LWR@parseaftercolumn}{%
\addtocounter{LWR@tablecolspos}{1}%
\expandarg%
\StrChar{\LWR@origcolspec}{\theLWR@tablecolspos}[\LWR@colparameter]%
\fullexpandarg%
\LWR@setexparray{LWR@colafterspec}{\theLWR@tabletotalcols}{\LWR@colparameter}%
\let\LWR@colparameter\relax%
\booltrue{LWR@validtablecol}%
}
\newcommand*{\LWR@parseskipcolumn}{%
\booltrue{LWR@validtablecol}%
}
\newcommand*{\LWR@parsenormalcolumn}[1]{%
\appto\LWR@tablecolspec{#1}%
\addtocounter{LWR@tabletotalcols}{1}%
\addtocounter{LWR@tabletotalcolsnext}{1}%
\LWR@traceinfo{normal column \theLWR@tabletotalcols: #1}%
\LWR@setexparray{LWR@colatspec}{\theLWR@tabletotalcolsnext}{}%
\LWR@setexparray{LWR@colbangspec}{\theLWR@tabletotalcolsnext}{}%
\LWR@setexparray{LWR@colbeforespec}{\theLWR@tabletotalcolsnext}{}%
\LWR@setexparray{LWR@colafterspec}{\theLWR@tabletotalcolsnext}{}%
\booltrue{LWR@validtablecol}%
}

\newcommand*{\LWR@parsepcolumn}[1]{%
\LWR@parsenormalcolumn{#1}%
\addtocounter{LWR@tablecolspos}{1}%
}

\newcommand*{\LWR@parseDcolumn}[1]{%
\LWR@parsenormalcolumn{#1}%
\addtocounter{LWR@tablecolspos}{3}%
}


\newbool{LWR@validtablecol}
\newcommand*{\LWR@parsetablecols}[1]{%
\LWR@traceinfo{LWR@parsetablecols started}%
\renewcommand*{\LWR@origcolspec}{#1}%
\renewcommand*{\LWR@tablecolspec}{}%
\setcounter{LWR@tabletotalcols}{0}%
\setcounter{LWR@tabletotalcolsnext}{1}%
\LWR@setexparray{LWR@colatspec}{leftedge}{}%
\LWR@setexparray{LWR@colatspec}{1}{}%
\LWR@setexparray{LWR@colatspec}{2}{}%
\LWR@setexparray{LWR@colatspec}{3}{}%
\LWR@setexparray{LWR@colbangspec}{leftedge}{}%
\LWR@setexparray{LWR@colbangspec}{1}{}%
\LWR@setexparray{LWR@colbangspec}{2}{}%
\LWR@setexparray{LWR@colbangspec}{3}{}%
\LWR@setexparray{LWR@colbeforespec}{1}{}%
\LWR@setexparray{LWR@colbeforespec}{2}{}%
\LWR@setexparray{LWR@colbeforespec}{3}{}%
\LWR@setexparray{LWR@colafterspec}{1}{}%
\LWR@setexparray{LWR@colafterspec}{2}{}%
\LWR@setexparray{LWR@colafterspec}{3}{}%
\setcounter{LWR@tablecolspos}{1}%
\LWR@traceinfo{about to StrLen}%
\noexpandarg%
\StrLen{#1}[\LWR@strresult]%
\fullexpandarg%
\LWR@traceinfo{finished StrLen}%
\setcounter{LWR@tablecolswidth}{\LWR@strresult}%
\whiledo{\not\value{LWR@tablecolspos}>\value{LWR@tablecolswidth}}{%
\noexpandarg%
\StrChar{#1}{\theLWR@tablecolspos}[\LWR@strresult]%
\LWR@traceinfo{position \arabic{LWR@tablecolspos}: \LWR@strresult}%
\fullexpandarg%
\boolfalse{LWR@validtablecol}%
\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}}{}%
\IfStrEq{\LWR@strresult}{D}{\LWR@parseDcolumn{c}}{}%
\IfStrEq{\LWR@strresult}{X}{\LWR@parsenormalcolumn{X}}{}%
\IfStrEq{\LWR@strresult}{P}{\LWR@parsepcolumn{P}}{}%
\IfStrEq{\LWR@strresult}{M}{\LWR@parsepcolumn{M}}{}%
\IfStrEq{\LWR@strresult}{B}{\LWR@parsepcolumn{B}}{}%
\ifbool{LWR@validtablecol}{}{%
\LWR@traceinfo{invalid column type: \LWR@strresult}%
\LWR@parsenormalcolumn{l}%
}%
\addtocounter{LWR@tablecolspos}{1}%
}%
}%


\newcommand*{\LWR@maybenewtablerow}
{%
\ifbool{LWR@startedrow}%
{}% started the row
{% not started the row
\global\booltrue{LWR@startedrow}%
\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
}


\newcommand*{\LWR@printatbang}[2]{%
\edef\LWR@atbangspec{\LWR@getexparray{LWR@col#1spec}{#2}}
\LWR@traceinfo{atbang: !\LWR@atbangspec!}
\ifdefempty{\LWR@atbangspec}%
{}%
{%
\LWR@htmltag{td class="td#1%
\ifthenelse{\equal{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}{Y}}{rule}{}%
"}%
\LWR@atbangspec%
\LWR@htmltag{/td}\LWR@orignewline%
}%
}%


\newcommand*{\LWR@tabledatasinglecolumntag}%
{%
\LWR@maybenewtablerow%
\ifbool{LWR@intabularmetadata}{%
\ifbool{LWR@exitingtabular}{}%
{% not exiting tabular
\ifthenelse{\cnttest{\value{LWR@tablecolspos}}=1}%
{%
\LWR@printatbang{at}{leftedge}%
\LWR@printatbang{bang}{leftedge}%
}% left edge
{}% not left edge
\StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}[\LWR@strresult]%
\LWR@htmltag{td class="td%
\LWR@strresult%
\ifthenelse{\equal{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}{Y}}{rule}{}%
"{}}%
\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
\LWR@getexparray{LWR@colbeforespec}{\theLWR@tablecolspos}%
\global\boolfalse{LWR@intabularmetadata}%
}% not exiting tabular
}{}% in tabular metadata
}%


\newcounter{LWR@midrulecounter}

\newcommand*{\LWR@clearmidrules}
{%
\setcounter{LWR@midrulecounter}{1}%
\whiledo{%
\cnttest{\value{LWR@midrulecounter}}{<=}{\value{LWR@tablecolswidth}}%
}%
{%
\LWR@setexparray{LWR@midrules}{\theLWR@midrulecounter}{}%
\addtocounter{LWR@midrulecounter}{1}%
}%
}

\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
}

\NewDocumentCommand{\LWR@docmidrule}{o d() >{\SplitArgument{1}{-}}m}%
{\LWR@subcmidrule{#1}{#2}#3}



\newcounter{LWR@tablemulticolswidth}
\newcounter{LWR@tablemulticolspos}

\newcommand*{\LWR@printmccoltype}[1]{%
\LWR@traceinfo{lwr@printmccoltype -#1-}%
\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]%
\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}%
}

\newcommand*{\LWR@multicolpartext}{%
\LWR@startpars%
\LWR@multicoltext%
\LWR@stoppars%
}

\newcommand*{\LWR@multicolother}[1]{%
\addtocounter{LWR@tablemulticolspos}{1}%
\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]%
\LWR@strresult%
\booltrue{LWR@validtablecol}%
}

\newcommand*{\LWR@multicolskip}{%
\booltrue{LWR@validtablecol}%
}

\newcommand*{\LWR@printmccoldata}[1]{%
\LWR@traceinfo{lwr@printmccoldata -#1}%
\boolfalse{LWR@validtablecol}%
\StrChar{#1}{\theLWR@tablemulticolspos}[\LWR@strresult]%
\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}}{}%
\ifbool{LWR@validtablecol}{}{\LWR@multicoltext}%
\LWR@traceinfo{lwr@printmccoldata done}%
}

\newcommand*{\LWR@parsemulticolumnalignment}[2]{%
\setcounter{LWR@tablemulticolspos}{1}%
\StrLen{#1}[\LWR@strresult]%
\setcounter{LWR@tablemulticolswidth}{\LWR@strresult}%
\whiledo{%
\not\value{LWR@tablemulticolspos}>\value{LWR@tablemulticolswidth}%
}%
{%
#2{#1}%
\addtocounter{LWR@tablemulticolspos}{1}%
}%
}


\newcommand{\LWR@multicoltext}{}

\NewDocumentCommand{\LWR@domulticolumn}{m m +m}{%
\LWR@traceinfo{lwr@domulticolumn -#1- -#2-}%
\renewcommand{\LWR@multicoltext}{%
#3%
\booltrue{LWR@validtablecol}%
}%
\LWR@maybenewtablerow%
\LWR@htmltag{td colspan="#1"
 class="td%
\LWR@parsemulticolumnalignment{#2}{\LWR@printmccoltype}%
\ifthenelse{\equal{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}{Y}}{rule}{}%
"%
}% end of the opening table data tag
\global\boolfalse{LWR@intabularmetadata}%
\LWR@parsemulticolumnalignment{#2}{\LWR@printmccoldata}%
}


\newbool{LWR@starredlongtable}
\boolfalse{LWR@starredlongtable}
\providecommand*{\LTcaptype}{table}
\NewDocumentCommand{\LWR@longtabledatacaptiontag}{s o +m}
{%
\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
\LWR@tabularhtmlcolumns{1}{\theLWR@tabletotalcols}
\LWR@domulticolumn{\theLWR@tabhtmlcoltotal}{P}{% \LWR@domulticolumn
\IfBooleanTF{#1}% star?
{% yes star
\LWR@htmlblocktag{figcaption}%
#3%
\LWR@htmlblocktag{/figcaption}%
}%
{% No star:
\ifbool{LWR@starredlongtable}%
{%
\ifthenelse{\equal{#2}{}}% TOC entry
{}%
{%
\refstepcounter{\LTcaptype}%
\protected@edef\@currentlabel{%
\csuse{p@\LTcaptype}\csuse{the\LTcaptype}}%
}%
}{}%
\LWR@htmlblocktag{figcaption}%
\csuse{fnum@\LTcaptype}\CaptionSeparator#3%
\LWR@htmlblocktag{/figcaption}%
\ifthenelse{\equal{#2}{}}% TOC entry empty
{}%
{% TOC entry not empty
\IfNoValueTF{#2}% No TOC entry?
{% 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
{% 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
\booltrue{LWR@skipatbang}%
}% end of \LWR@domulticolumn

\addtocounter{LWR@tablecolspos}{\theLWR@tabletotalcols}
\addtocounter{LWR@tablecolspos}{-1}

}



\newcounter{LWR@tabhtmlcolindex}
\newcounter{LWR@tabhtmlcolend}
\newcounter{LWR@tabhtmlcoltotal}

\newcommand*{\LWR@tabularhtmlcolumns}[2]{%
\setcounter{LWR@tabhtmlcolindex}{#1}%
\setcounter{LWR@tabhtmlcoltotal}{#2}%
\setcounter{LWR@tabhtmlcolend}{#1}%
\addtocounter{LWR@tabhtmlcolend}{#2}%
\whiledo{\value{LWR@tabhtmlcolindex}<\value{LWR@tabhtmlcolend}}{%
\edef\LWR@atbangspec{\LWR@getexparray{LWR@colatspec}{\theLWR@tabhtmlcolindex}}%
\ifdefempty{\LWR@atbangspec}{}{\addtocounter{LWR@tabhtmlcoltotal}{1}}%
\edef\LWR@atbangspec{\LWR@getexparray{LWR@colbangspec}{\theLWR@tabhtmlcolindex}}%
\ifdefempty{\LWR@atbangspec}{}{\addtocounter{LWR@tabhtmlcoltotal}{1}}%
\addtocounter{LWR@tabhtmlcolindex}{1}%
}%
\ifthenelse{\value{LWR@tablecolspos}=1}{%
\edef\LWR@atbangspec{\LWR@getexparray{LWR@colatspec}{leftedge}}%
\ifdefempty{\LWR@atbangspec}{}{\addtocounter{LWR@tabhtmlcoltotal}{1}}%
\edef\LWR@atbangspec{\LWR@getexparray{LWR@colbangspec}{leftedge}}%
\ifdefempty{\LWR@atbangspec}{}{\addtocounter{LWR@tabhtmlcoltotal}{1}}%
}{}%
}


\NewDocumentCommand{\LWR@tabledatamulticolumntag}{m m +m}%
{%
\LWR@tabularhtmlcolumns{\theLWR@tablecolspos}{#1}
\LWR@domulticolumn{\theLWR@tabhtmlcoltotal}{#2}{#3}%
\addtocounter{LWR@tablecolspos}{#1}%
\addtocounter{LWR@tablecolspos}{-1}%
\booltrue{LWR@skipatbang}%
}



\NewDocumentCommand{\LWR@tabledatamultirowtag}{m o m o m}%
{%
\LWR@maybenewtablerow%
\LWR@htmltag{td rowspan="#1" class="td%
\StrChar{\LWR@tablecolspec}{\theLWR@tablecolspos}%
\ifthenelse{\equal{\LWR@getexparray{LWR@midrules}{\theLWR@tablecolspos}}{Y}}{rule}{}%
"{}}
\begingroup \LetLtxMacro{\\}{\LWR@endofline} #5 \endgroup
\LWR@stoppars%
\global\boolfalse{LWR@intabularmetadata}%
}%

\newcommand*{\LWR@donothing}{}
\newcommand*{\LWR@domidrule}{\booltrue{LWR@doinghline}}
\newcommand*{\LWR@dotbrule}{\booltrue{LWR@doingtbrule}}


\newbool{LWR@exitingtabular}

\newcommand*{\LWR@tabledatacolumntag}%
{%
\LWR@traceinfo{LWR@tabledatacolumntag}%
\let\mynext\LWR@tabledatasinglecolumntag%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\end}}%
{\booltrue{LWR@exitingtabular}}{}%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\caption}}%
{\let\mynext\LWR@donothing}{}%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\multicolumn}}%
{\let\mynext\LWR@donothing}{}%
\ifthenelse{\isequivalentto{\LWR@mynexttoken}{\multirow}}%
{\let\mynext\LWR@donothing}{}%
\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}{\specialrule}}%
{\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}{}%
\mynext%
}

\end{warpHTML}



\begin{warpall}
\newcommand*{\mrowcell}{}
\end{warpall}


\begin{warpHTML}
\newcommand*{\LWR@origtoprule}[1]{\hline}
\newcommand*{\LWR@origmidrule}[1]{\hline}
\LetLtxMacro\LWR@origcmidrule\cline
\newcommand*{\LWR@origbottomrule}[1]{\hline}
\newcommand*{\LWR@origaddlinespace}[1][]{}
\newcommand*{\LWR@origmorecmidrules}{}
\newcommand*{\LWR@origspecialrule}[3]{\hline}
\StartDefiningTabulars

\newenvironment*{LWR@tabular}[2][]
{%
\LWR@traceinfo{LWR@tabular started}%
\addtocounter{LWR@tabulardepth}{1}%
\global\boolfalse{LWR@startedrow}%
\global\boolfalse{LWR@doinghline}%
\global\boolfalse{LWR@doingtbrule}%
\boolfalse{LWR@exitingtabular}%
\global\booltrue{LWR@intabularmetadata}%
\LWR@forcenewpage
\LWR@htmlblocktag{table}%
\LWR@parsetablecols{#2}%
\LWR@stoppars%
\setcounter{LWR@tablecolspos}{1}%
\LWR@clearmidrules%
\LetLtxMacro{\\}{\LWR@tabularendofline}%
\LWR@traceinfo{LWR@tabular: redefining macros}%
\renewcommand*{\hline}{\LWR@domidrule\LWR@getmynexttoken}%

\RenewDocumentCommand{\cline}{m}%
{\LWR@docmidrule{##1}\LWR@getmynexttoken}%

\DeclareDocumentCommand{\toprule}{o}{\LWR@dotbrule\LWR@getmynexttoken}%

\DeclareDocumentCommand{\midrule}{o}{\LWR@domidrule\LWR@getmynexttoken}%

\DeclareDocumentCommand{\cmidrule}{o d() m}%
{\LWR@docmidrule[##1](##2){##3}\LWR@getmynexttoken}%

\DeclareDocumentCommand{\bottomrule}{o}{\LWR@dotbrule\LWR@getmynexttoken}%
\DeclareDocumentCommand{\addlinespace}{o}{}
\DeclareDocumentCommand{\morecmidrules}{}{}
\DeclareDocumentCommand{\specialrule}{m m m}{\LWR@domidrule\LWR@getmynexttoken}
\LetLtxMacro{\multicolumn}{\LWR@tabledatamulticolumntag}%
\LetLtxMacro{\multirow}{\LWR@tabledatamultirowtag}%
\renewcommand*{\mrowcell}{\global\booltrue{LWR@skippingmrowcell}}%
\LetLtxMacro{\caption}{\LWR@longtabledatacaptiontag}%
\global\boolfalse{LWR@tableparcell}%
\global\boolfalse{LWR@skippingmrowcell}%
\global\boolfalse{LWR@skipatbang}%
\StartDefiningTabulars%
\protected\gdef&{\LWR@tabularampersand}%
\LWR@traceinfo{LWR@tabular: about to LWR@getmynexttoken}%
\LWR@getmynexttoken%
}%
{%
\LWR@traceinfo{LWR@tabular ending}%
\LWR@closetabledatacell%
\LWR@htmlblocktag{/tr}%
\LWR@htmlblocktag{/table}%
\global\boolfalse{LWR@intabularmetadata}%
\addtocounter{LWR@tabulardepth}{-1}%
\protected\gdef&{\LWR@origampmacro}%
\EndDefiningTabulars%
\LWR@traceinfo{LWR@tabular finished ending}%
}

\EndDefiningTabulars

\end{warpHTML}




\begin{warpHTML}


\newcommand*{\@currentlabelname}{}
\def\LWR@stripperiod#1.\ltx@empty#2\@nil{#1}%
\newcommand*{\LWR@setlatestname}[1]{%
\GetTitleStringExpand{#1}%
\edef\@currentlabelname{\detokenize\expandafter{\GetTitleStringResult}}%
\edef\@currentlabelname{%
\expandafter\LWR@stripperiod\@currentlabelname%
\ltx@empty.\ltx@empty\@nil%
}%
}


\zref@newlist{special}
\zref@newprop{zLWR@name}{\@currentlabelname}
\zref@newprop{zLWR@htmlfilenumber}{%
\ifbool{FileSectionNames}{\LWR@thisfilename}{\theLWR@htmlfilenumber}%
}%
\zref@newprop{zLWR@lateximagedepth}{\arabic{LWR@lateximagedepth}}
\zref@newprop{zLWR@lateximagenumber}{\arabic{LWR@lateximagenumber}}
\zref@addprop{special}{zLWR@name}
\zref@addprop{special}{zLWR@htmlfilenumber}
\zref@addprop{special}{zLWR@lateximagedepth}
\zref@addprop{special}{zLWR@lateximagenumber}
\newcommand*{\LWR@spref}[2]{%
\zref@extractdefault{#1}{#2}{??}}
\newcommand*{\LWR@nameref}[1]{%
\LWR@spref{#1}{zLWR@name}%
}
\newcommand*{\LWR@htmlfileref}[1]{%
\LWR@spref{#1}{zLWR@htmlfilenumber}%
}
\newcommand*{\LWR@lateximagedepthref}[1]{%
\LWR@spref{#1}{zLWR@lateximagedepth}%
}
\newcommand*{\LWR@lateximagenumberref}[1]{%
\LWR@spref{#1}{zLWR@lateximagenumber}%
}
\newcommand*{\LWR@splabel}[1]{%
\LWR@setlatestname{\@currentlabelname}%
\zref@labelbylist{#1}{special}}


\newcommand*{\LWR@subsublabel}[1]{%
\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}%
{}%
{% not lateximage
\ifbool{LWR@doingstartpars}%
{% pars allowed
\ifbool{LWR@doingapar}
{% par started
\LWR@htmltag{a id="#1"{}}\LWR@htmltag{/a}%
}% par started
{% par not started
\LWR@stoppars%
\LWR@htmltag{a id="#1"{}}\LWR@htmltag{/a}%
\LWR@startpars%
}% par not started
}% pars allowed
{% pars not allowed
\LWR@htmltag{a id="#1"{}}\LWR@htmltag{/a}%
}% pars not allowed
}% not lateximage
}
\NewDocumentCommand{\LWR@newlabel}{m o}{%
\LWR@traceinfo{LWR@newlabel: starting}%
\LWR@traceinfo{LWR@newlabel: !#1!}%
\LWR@origlabel{#1}%
\LWR@traceinfo{LWR@newlabel: filesectionnames is \ifbool{FileSectionNames}{true}{false}}%
\LWR@traceinfo{LWR@newlabel: LWR@thisfilename is !\LWR@thisfilename!}%
\LWR@traceinfo{LWR@newlabel: LWR@htmlfilenumber is \theLWR@htmlfilenumber}%
\LWR@splabel{#1}%
\LWR@subsublabel{#1}%
\LWR@traceinfo{LWR@newlabel: done}%
}


\newcommand*{\LWR@startref}[1]
{%
\edef\LWR@lidref{\LWR@lateximagedepthref{#1}}%
\LWR@traceinfo{LWR@startref A: !#1!}%
\LWR@htmltag{a href="%
\LWR@traceinfo{LWR@startref B}%
\LWR@htmlrefsectionfilename{#1}%
\LWR@traceinfo{LWR@startref C}%
\#%
\LWR@traceinfo{LWR@startref D: !#1!}%
\ifthenelse{\equal{\LWR@lidref}{??}}%
{%
\LWR@traceinfo{LWR@startref D0: ??}%
??}%
{%
\LWR@traceinfo{LWR@startref D1: \LWR@lidref}%
\ifthenelse{\cnttest{\LWR@lidref}{>}{0}}%
{%
\LWR@traceinfo{LWR@startref D2: \LWR@lidref}%
lateximage\LWR@lateximagenumberref{#1}%
}%
{%
\LWR@traceinfo{LWR@startref D3}%
#1%
}%
}%
\LWR@traceinfo{LWR@startref E}%
"{}}%
\LWR@traceinfo{LWR@startref F}%
}

\NewDocumentCommand{\LWR@subnewref}{m m}{%
\LWR@traceinfo{LWR@subnewref #1 #2}%
\LWR@startref{#1}%
\LWR@origref{#2}%
\LWR@htmltag{/a}%
}

\NewDocumentCommand{\LWR@newref}{s m}{%
\LWR@traceinfo{LWR@newref #2}%
\IfBooleanTF{#1}%
{\LWR@origref{#2}}%
{\LWR@subnewref{#2}{#2}}%
}

\newcommand*{\pagerefPageFor}{see }
\NewDocumentCommand{\LWR@newpageref}{s m}{%
\IfBooleanTF{#1}%
{(\pagerefPageFor\LWR@origref{#2})}%
{(\cpageref{#2})}%
}

\newcommand*{\nameref}[1]{%
\LWR@traceinfo{nameref A}%
\LWR@startref{#1}%
\LWR@traceinfo{nameref B}%
\LWR@nameref{#1}%
\LWR@traceinfo{nameref C}%
\LWR@htmltag{/a}%
\LWR@traceinfo{nameref D}%
}

\let\Nameref\nameref





\NewDocumentCommand{\LWR@subhyperref}{m +m}{%
\LWR@htmltag{a href="{#1}" target="\_{}blank"\LWR@orignewline}#2\LWR@htmltag{/a}%
\LWR@ensuredoingapar%
}

\NewDocumentCommand{\LWR@subhyperrefclass}{m +m m}{%
\LWR@htmltag{a href="{#1}"
class="#3"\LWR@orignewline}#2\LWR@htmltag{/a}%
\LWR@ensuredoingapar%
}

\NewDocumentCommand{\LWR@hrefb}{O{} m +m}{%
\LWR@subhyperref{#2}{#3}%
\endgroup%
\LWR@ensuredoingapar%
}

\newcommand{\href}{%
\LWR@ensuredoingapar%
\begingroup%
\catcode`\_=12
\LWR@hrefb%
}

\newcommand*{\LWR@nolinkurlb}[1]{#1\endgroup\LWR@ensuredoingapar}

\newcommand{\nolinkurl}{%
\LWR@ensuredoingapar%
\begingroup\catcode`\_=12
\LWR@nolinkurlb%
}

\newcommand*{\LWR@urlb}[1]{%
\href{#1}{#1}%
\endgroup%
\LWR@ensuredoingapar%
}

\newcommand{\LWR@urla}{%
\LWR@ensuredoingapar%
\begingroup\catcode`\_=12
\LWR@urlb%
}

\let\url\LWR@urla

\newcommand*{\LWR@subinlineimage}[5][]{%
\ifthenelse{\equal{#1}{}}%
{\LWR@htmltag{img src="#3.#4" alt="#3" style="#5" class="#2"{}}}%
{\LWR@htmltag{img src="#3.#4" alt="#1" style="#5" class="#2"{}}}%
}

\end{warpHTML}






\begin{warpHTML}

\NewDocumentCommand{\LWR@floatbegin}{m o}{%
\ifthenelse{\boolean{FormatWordProcessor}\AND\boolean{HTMLMarkFloats}}{%

=== #1 begin

}{}%
\LWR@stoppars
\addtocounter{LWR@thisfloat}{1}%
\booltrue{LWR@freezethisfloat}%
\begingroup
\LWR@origraggedright
\LWR@htmltag{figure id="autofloat-\arabic{LWR@thisfloat}" class="#1"}
\renewcommand*{\@captype}{#1}
\caption@settype{#1}
\LWR@startpars
}
\let\@float\LWR@floatbegin
\let\@dblfloat\LWR@floatbegin
\newcommand*{\LWR@floatend}{%
\LWR@stoppars%
\LWR@htmlelementend{figure}%
\endgroup%
\boolfalse{LWR@freezethisfloat}%
\LWR@startpars%
\ifthenelse{\boolean{FormatWordProcessor}\AND\boolean{HTMLMarkFloats}}{%

=== end

}{}%
}
\let\end@float\LWR@floatend
\let\end@dblfloat\LWR@floatend

\newcounter{LWR@thisfloat}

\newbool{LWR@freezethisfloat}
\boolfalse{LWR@freezethisfloat}

\newcommand*{\LWR@maybeincthisfloat}{%
\ifbool{LWR@freezethisfloat}{}{\addtocounter{LWR@thisfloat}{1}}%
}

\newcommand*{\@captype}{}


\AtBeginDocument{\providecommand*{\CaptionSeparator}{:~}}

\AtBeginDocument{\renewcommand{\@makecaption}[2]{#1\CaptionSeparator#2}}


\newcounter{LWR@nextautofloat}
\newcounter{LWR@nextautopage}
\newcommand*{\LWRsetnextfloat}[2]{%
\setcounter{LWR@nextautopage}{#1}%
\setcounter{LWR@nextautofloat}{#2}%
}

\newcounter{LWR@latestautopage}
\setcounter{LWR@latestautopage}{1}

\let\LWR@origcaption@begin\caption@begin
\let\LWR@origcaption@end\caption@end
\let\LWR@orig@@par\@@par

\newcommand{\LWR@caption@begin}
{
\LWR@traceinfo{LWR@caption@begin}%
\begingroup%
\renewcommand{\@@par}{\LWR@closeparagraph\LWR@orig@@par}%
\RenewDocumentEnvironment{minipage}{O{t} o O{t} m}{}{}%
\RenewDocumentCommand{\parbox}{O{t} o O{t} m +m}{##5}%
\LWR@htmlblocktag{figcaption}%
\LWR@origcaption@begin%
}

\newcommand{\LWR@caption@end}
{%
\LWR@origcaption@end%
\LWR@origvspace*{\baselineskip}%
\LWR@htmlblocktag{/figcaption}%
\endgroup%
\LWR@traceinfo{LWR@caption@end: done}%
}

\AtBeginDocument{
\let\caption@begin\LWR@caption@begin
\let\caption@end\LWR@caption@end
}

\let\LWR@origcaptionlistentry\captionlistentry

\renewcommand*{\captionlistentry}{%
\LWR@maybeincthisfloat%
\LWR@ensuredoingapar%
\LWR@htmltag{a id="autofloat-\arabic{LWR@thisfloat}"{}}\LWR@htmltag{/a}%
\LWR@origcaptionlistentry%
}

\def\LWR@LTcaptionlistentry{%
\LWR@ensuredoingapar%
\LWR@htmltag{a id="autofloat-\arabic{LWR@thisfloat}"{}}\LWR@htmltag{/a}%
  \bgroup
  \@ifstar{\egroup\LWR@LT@captionlistentry}% gobble *
          {\egroup\LWR@LT@captionlistentry}}%
\def\LWR@LT@captionlistentry#1{%
  \caption@listentry\@firstoftwo[\LTcaptype]{#1}}%

\let\LWR@origaddcontentsline\addcontentsline

\renewcommand*{\addcontentsline}[3]{%
\ifthenelse{\equal{#1}{toc}}{}{%
\ifthenelse{\equal{#1}{thm}}{\csdef{ext@#2}{thm}}{}
\addtocontents{\@nameuse{ext@#2}}{%
\protect\LWRsetnextfloat%
{\arabic{LWR@latestautopage}}%
{\arabic{LWR@thisfloat}}%
}% addtocontents
}% not toc
\LWR@origaddcontentsline{#1}{#2}{#3}%
}

\AtBeginDocument{
\let\LWR@origcaptionof\captionof

\renewcommand*{\captionof}{%
\LWR@maybeincthisfloat%
\LWR@stoppars
\LWR@htmltag{a id="autofloat-\arabic{LWR@thisfloat}"{}}\LWR@htmltag{/a}%
\LWR@origcaptionof%
}
}

\end{warpHTML}


\begin{warpHTML}



\newcommand*{\LWR@myshorttoc}[1]{
\LWR@ensuredoingapar
\IfFileExists{\jobname.#1}{
\begingroup
\makeatletter
\@input{\jobname.#1}
\endgroup
}%
{}%
}

\NewDocumentCommand{\LWR@subtableofcontents}{m m}{%
\@ifundefined{chapter}
{\LWR@closeprevious{\LWR@depthsection}}
{\LWR@closeprevious{\LWR@depthchapter}}
\LWR@printpendingfootnotes
\@ifundefined{chapter}{\section*{#2}}{\chapter*{#2}}
\LWR@htmlelementclass{nav}{#1}
\LWR@myshorttoc{#1}
\LWR@htmlelementclassend{nav}{#1}
}

\let\LWR@orig@starttoc\@starttoc

\renewcommand{\@starttoc}[1]{
\LWR@htmlelementclass{nav}{#1}
\LWR@orig@starttoc{#1}
\LWR@htmlelementclassend{nav}{#1}
}
\let\LWR@origtableofcontents\tableofcontents
\let\LWR@origlistoffigures\listoffigures
\let\LWR@origlistoftables\listoftables

\renewcommand*{\tableofcontents}{%
\ifbool{FormatWordProcessor}{}{
\LWR@copyfile{\jobname.toc}{\jobname.sidetoc}%
\LWR@printpendingfootnotes
\LWR@origtableofcontents
}
}
\renewcommand*{\listoffigures}{
\ifbool{FormatWordProcessor}{}{
\LWR@printpendingfootnotes
\LWR@origlistoffigures
}
}

\renewcommand*{\listoftables}{
\ifbool{FormatWordProcessor}{}{
\LWR@printpendingfootnotes
\LWR@origlistoftables
}
}


\NewDocumentCommand{\listof}{m +m}{%
\LWR@subtableofcontents{\@nameuse{ext@#1}}{#2}
\expandafter\newwrite\csname tf@\csname ext@#1\endcsname\endcsname
\immediate\openout \csname tf@\csname ext@#1\endcsname\endcsname
    \jobname.\csuse{ext@#1}\relax
}



\end{warpHTML}

\begin{warpall}

\newcounter{SideTOCDepth}
\setcounter{SideTOCDepth}{1}

\newcommand{\sidetocname}{Contents}

\end{warpall}

\begin{warpHTML}

\newcommand*{\LWR@sidetoc}{
\LWR@forcenewpage
\LWR@stoppars

\LWR@htmlelementclass{nav}{sidetoc}

\setcounter{tocdepth}{\value{SideTOCDepth}}

\begin{BlockClass}{sidetoctitle}
\sidetocname
\end{BlockClass}
\begin{BlockClass}{sidetoccontents}
\LinkHome

\LWR@myshorttoc{sidetoc}
\end{BlockClass}
\LWR@htmlelementclassend{nav}{sidetoc}
}


\renewcommand*{\numberline}[1]{%
\LWR@sectionnumber{#1}%
}

\NewDocumentCommand{\hypertoc}{m m +m m}{%
\ifthenelse{\cnttest{#1}{<=}{\value{tocdepth}}}{%
\LWR@startpars%
\LWR@subhyperrefclass{%
\LWR@htmlrefsectionfilename{autopage-#4}\#autosec-#4}{#3}{toc#2}%
\LWR@stoppars%
}
{}
}

\newcounter{lofdepth}
\setcounter{lofdepth}{1}

\newcounter{lotdepth}
\setcounter{lotdepth}{1}

\newcommand{\hypertocfloat}[5]{%
\LWR@startpars
\@ifundefined{c@#3depth}{%
\newcounter{#3depth}%
\setcounter{#3depth}{1}%
}{}%
\LWR@traceinfo{hypertocfloat depth is #1 #3depth is \arabic{#3depth}}%
\ifthenelse{\cnttest{#1}{<=}{\arabic{#3depth}}}{%
\LWR@startpars%
\LWR@subhyperrefclass{%
\LWR@htmlrefsectionfilename{autopage-\arabic{LWR@nextautopage}}%
\#autofloat-\arabic{LWR@nextautofloat}}%
{#4}{toc#2}%
\LWR@stoppars%
}{}%
}

\renewcommand{\l@part}[2]{\hypertoc{-1}{part}{#1}{#2}}
\DeclareDocumentCommand{\l@chapter}{m m}
{\hypertoc{0}{chapter}{#1}{#2}}
\renewcommand{\l@section}[2]{\hypertoc{1}{section}{#1}{#2}}
\renewcommand{\l@subsection}[2]{\hypertoc{2}{subsection}{#1}{#2}}
\renewcommand{\l@subsubsection}[2]
{\hypertoc{3}{subsubsection}{#1}{#2}}
\renewcommand{\l@paragraph}[2]{\hypertoc{4}{paragraph}{#1}{#2}}
\renewcommand{\l@subparagraph}[2]{\hypertoc{5}{subparagraph}{#1}{#2}}
\renewcommand{\l@figure}[2]{\hypertocfloat{1}{figure}{lof}{#1}{#2}}
\renewcommand{\l@table}[2]{\hypertocfloat{1}{table}{lot}{#1}{#2}}

\end{warpHTML}




\begin{warpHTML}

\newcounter{LWR@autoindex}
\setcounter{LWR@autoindex}{0}

\newcounter{LWR@autoglossary}
\setcounter{LWR@autoglossary}{0}

\@ifundefined{chapter}
{\newcommand*{\LWR@indexsection}{\section{\indexname}}}
{\newcommand*{\LWR@indexsection}{\chapter{\indexname}}}

\let\LWR@origprintindex\printindex

\renewcommand*{\printindex}
{
\LWR@indexsection
\LWR@startpars
\LWR@origprintindex
}

\renewenvironment*{theindex}{%
\let\item\LWR@indexitem%
\let\subitem\LWR@indexsubitem%
\let\subsubitem\LWR@indexsubsubitem%
}{}

\newcommand{\LWR@indexitem}{

\InlineClass{indexitem}{}
}

\newcommand{\LWR@indexsubitem}{

\InlineClass{indexsubitem}{}
}

\newcommand{\LWR@indexsubsubitem}{

\InlineClass{indexsubsubitem}{}
}

\def\@wrindex#1{%
\addtocounter{LWR@autoindex}{1}%
\LWR@newlabel{LWRindex-\theLWR@autoindex}%
\protected@write\@indexfile{}%
{\string\indexentry{#1}{\theLWR@autoindex}}%
\endgroup
\@esphack}

\def\@wrglossary#1{%
\addtocounter{LWR@autoglossary}{1}%
\LWR@newlabel{LWRglossary-\theLWR@autoglossary}%
\protected@write\@glossaryfile{}%
{\string\glossaryentry{#1}{\theLWR@autoglossary}}%
\endgroup
\@esphack}

\newcommand*{\hyperindexref}[1]{\nameref{LWRindex-#1}}

\end{warpHTML}

\begin{warpprint}
\newcommand{\hyperindexref}[1]{#1}
\end{warpprint}

\begin{warpall}
\providecommand{\glo@name}{}
\end{warpall}


\begin{warpHTML}

\let\LWR@origtextdollar\$

\renewcommand*{\$}{%
\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}%
{\LWR@origtextdollar}%
{\LWR@htmltagc{span}\LWR@origtextdollar\LWR@htmltagc{/span}}%
}

\newcounter{LWR@externalfilecnt}


\LetLtxMacro\LWR@origdollar$
\LetLtxMacro\LWR@secondorigdollar$% balance for editor syntax highlighting

\LetLtxMacro\LWR@origopenparen\(
\LetLtxMacro\LWR@origcloseparen\)
\LetLtxMacro\LWR@origopenbracket\[
\LetLtxMacro\LWR@origclosebracket\]

\begingroup
\catcode`\$=\active%
\protected\gdef${\@ifnextchar$\LWR@doubledollar\LWR@singledollar}%

\gdef\LWR@doubledollar$#1$${
\ifbool{mathjax}%
{\textbackslash[\LWR@HTMLsanitize{#1}\textbackslash]}
{% not mathjax

\begin{lateximage}%
[\textbackslash{[} \LWR@HTMLsanitize{#1} \textbackslash{]}]%
\LWR@origdollar\LWR@origdollar#1\LWR@origdollar\LWR@origdollar%
\end{lateximage}

}
}%

\gdef\LWR@subsingledollar#1{%
\ifbool{mathjax}%
{\textbackslash(\LWR@HTMLsanitize{#1}\textbackslash)}
{% not mathjax
\begin{lateximage}%
[\textbackslash( \LWR@HTMLsanitize{#1} \textbackslash)]%
\LWR@origdollar#1\LWR@origdollar%
\end{lateximage}%
}%
}

\gdef\LWR@singledollar#1${%
\LWR@subsingledollar{#1}%
}

\gdef\(#1\){$#1$}
\gdef\[#1\]{$$#1$$}

\endgroup


\let\LWR@orig@ensuredmath\@ensuredmath

\newcommand*{\LWR@ensuredmath}[1]{%
\LWR@traceinfo{@ensuredmath: page \thepage: \detokenize{#1}}%
\LWR@subsingledollar{#1}%
}

\let\math\relax
\let\endmath\relax
\let\displaymath\relax
\let\enddisplaymath\relax

\NewEnviron{math}{\expandafter\(\BODY\)}
\NewEnviron{displaymath}{\expandafter\[\BODY\]\@ignoretrue}

\newcounter{LWR@nextequation}
\newcommand*{\LWR@syncmathjax}{%
\ifcsdef{thechapter}{
\InlineClass{hidden}{
\textbackslash(
\textbackslash{}seteqsection \{\thechapter\}
\textbackslash)
}
}
{}% not using chapters
\ifthenelse{\cnttest{\value{equation}}>0}
{
\setcounter{LWR@nextequation}{\value{equation}}
\addtocounter{LWR@nextequation}{1}
\InlineClass{hidden}{
\textbackslash(
\textbackslash{}seteqnumber \{\arabic{LWR@nextequation}\}
\textbackslash)
}
}{}% not eq > 1
}

\newcommand*{\LWR@restoreorigformatting}{%
\LetLtxMacro{\hspace}{\LWR@orighspace}%
\LetLtxMacro\rule\LWR@origrule%
\let\,\LWR@origcomma% disable HTML short unbreakable space
\LetLtxMacro{\textrm}{\LWR@origtextrm}%
\LetLtxMacro{\textsf}{\LWR@origtextsf}%
\LetLtxMacro{\texttt}{\LWR@origtexttt}%
\LetLtxMacro{\textbf}{\LWR@origtextbf}%
\LetLtxMacro{\textmd}{\LWR@origtextmd}%
\LetLtxMacro{\textit}{\LWR@origtextit}%
\LetLtxMacro{\textsl}{\LWR@origtextsl}%
\LetLtxMacro{\textsc}{\LWR@origtextsc}%
\LetLtxMacro{\textup}{\LWR@origtextup}%
\LetLtxMacro{\textnormal}{\LWR@origtextnormal}%
\LetLtxMacro{\emph}{\LWR@origemph}%
\LetLtxMacro{\rmfamily}{\LWR@origrmfamily}%
\LetLtxMacro{\sffamily}{\LWR@origsffamily}%
\LetLtxMacro{\ttfamily}{\LWR@origttfamily}%
\LetLtxMacro{\bfseries}{\LWR@origbfseries}%
\LetLtxMacro{\mdseries}{\LWR@origmdseries}%
\LetLtxMacro{\upshape}{\LWR@origupshape}%
\LetLtxMacro{\slshape}{\LWR@origslshape}%
\LetLtxMacro{\scshape}{\LWR@origscshape}%
\LetLtxMacro{\itshape}{\LWR@origitshape}%
\LetLtxMacro{\em}{\LWR@origem}%
\LetLtxMacro{\normalfont}{\LWR@orignormalfont}%
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}%
\let\textsuperscript\LWR@origtextsuperscript%
\let\textsubscript\LWR@origtextsubscript%
\let~\LWR@origtilde%
\let\enskip\LWR@origenskip%
\let\quad\LWR@origquad%
\let\qquad\LWR@origqquad%
\LetLtxMacro{\tabular}{\LWR@origtabular}%
\LetLtxMacro{\endtabular}{\LWR@origendtabular}%
\LetLtxMacro\toprule\LWR@origtoprule%
\LetLtxMacro\midrule\LWR@origmidrule%
\LetLtxMacro\cmidrule\LWR@origcmidrule%
\LetLtxMacro\bottomrule\LWR@origbottomrule%
\LetLtxMacro\addlinespace\LWR@origaddlinespace%
\LetLtxMacro\morecmidrules\LWR@origmorecmidrules%
\LetLtxMacro\specialrule\LWR@origspecialrule%
\let\newline\LWR@orignewline%
\LetLtxMacro{\raisebox}{\LWR@origraisebox}%
\LetLtxMacro{\scalebox}{\LWR@origscalebox}%
\LetLtxMacro{\rotatebox}{\LWR@origrotatebox}%
\let\reflectbox\LWR@origreflectbox%
\let\framebox\LWR@origframebox%
\let\makebox\LWR@origmakebox%
\let\fbox\LWR@origfbox%
\let\fboxBlock\LWR@origfbox%
\LetLtxMacro{\fminipage}{\LWR@fminipageprint}%
\LetLtxMacro{\endfminipage}{\endLWR@fminipageprint}%
\LetLtxMacro{\minipage}{\LWR@origminipage}%
\let\endminipage\LWR@endminipage%
\LetLtxMacro{\parbox}{\LWR@origparbox}%
}

\NewDocumentCommand{\LWR@hidelatexequation}{m +m}{%
\LWR@stoppars
\LWR@htmlopencomment

\begingroup
\csuse{LWR@orig#1}
\LWR@restoreorigformatting
#2
\csuse{LWR@origend#1}
\endgroup

\LWR@htmlclosecomment
\LWR@startpars
}

\NewDocumentCommand{\LWR@addmathjax}{m +m}{%
\LWR@origtilde\LWR@orignewline
\textbackslash{}begin\{#1\}
\LWR@HTMLsanitizeexpand{\detokenize\expandafter{#2}}
\textbackslash{}end\{#1\}
\LWR@orignewline
}

\let\LWR@origequation\equation
\let\LWR@origendequation\endequation
\let\equation\relax
\let\endequation\relax

\NewEnviron{equation}{%

\ifbool{mathjax}
{
\LWR@syncmathjax
\LWR@hidelatexequation{equation}{\BODY}
}
{% not mathjax
\begin{lateximage}[(\theequation) \textbackslash{begin\{equation\}}%
 \LWR@HTMLsanitizeexpand{\detokenize\expandafter{\BODY}}%
 \textbackslash{end\{equation\}}]% alt tag
\LWR@origequation
\BODY% contents collected by NewEnviron
\LWR@origendequation
\end{lateximage}%
}

}[\ifbool{mathjax}{\LWR@addmathjax{equation}{\BODY}}{}]

\newbool{LWR@amsmultline}
\boolfalse{LWR@amsmultline}

\newcommand*{\LWR@htmlmathlabel}[1]{%
\LWR@traceinfo{LWR@htmlmathlabel #1}%
\ifbool{mathjax}{%
\text{
\ifbool{LWR@amsmultline}{}{\hspace*{\totwidth@}}
\LWR@htmlclosecomment%
\LWR@origltx@label{#1}%
\LWR@htmlopencomment%
}% text
}% mathjax
{%
\LWR@origltx@label{#1}%
}%
}

\newcommand*{\LWR@beginhideamsmath}{
\LWR@stoppars
\LWR@origtilde\LWR@orignewline
\LWR@htmlopencomment

\begingroup
\LWR@restoreorigformatting
}

\newcommand*{\LWR@endhideamsmath}{
\endgroup

\LWR@htmlclosecomment
\LWR@orignewline
\LWR@startpars
}


\let\LWR@origeqnarray\eqnarray
\let\LWR@origendeqnarray\endeqnarray
\newbool{LWR@numbereqnarray}
\booltrue{LWR@numbereqnarray}
\newcommand{\LWR@eqnarrayfactor}{%
\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\ifbool{LWR@numbereqnarray}
{
\LWR@beginhideamsmath
\LWR@origeqnarray
\BODY
\LWR@origendeqnarray
\LWR@endhideamsmath
\LWR@addmathjax{eqnarray}{\BODY}
}{% not LWR@numbereqnarray
\LWR@addmathjax{eqnarray*}{\BODY}
}% LWR@numbereqnarray
}% mathjax
{% not mathjax
\ifbool{LWR@numbereqnarray}
{
\begin{lateximage}[\LWR@addmathjax{eqnarray}{\BODY}]
\LWR@origeqnarray
\BODY
\LWR@origendeqnarray
\end{lateximage}
}{% not LWR@numbereqnarray
\begin{lateximage}[\LWR@addmathjax{eqnarray*}{\BODY}]
\LWR@origeqnarray
\BODY
\nonumber
\LWR@origendeqnarray
\end{lateximage}
}% LWR@numbereqnarray
}% not mathjax
\booltrue{LWR@numbereqnarray}
}
\RenewEnviron{eqnarray}
{%

\LWR@eqnarrayfactor

}
\csgpreto{eqnarray*}{\boolfalse{LWR@numbereqnarray}}
\BeforeBeginEnvironment{multline}{

\ifbool{mathjax}
{
\LWR@syncmathjax
\booltrue{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}

\AfterEndEnvironment{multline}{

\ifbool{mathjax}
{
\LWR@endhideamsmath
\boolfalse{LWR@amsmultline}
\LWR@addmathjax{multline}{\the\@envbody}
}
{\endlateximage}

}

\BeforeBeginEnvironment{multline*}{

\ifbool{mathjax}
{
\LWR@syncmathjax
\booltrue{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}

\AfterEndEnvironment{multline*}{

\ifbool{mathjax}
{
\LWR@endhideamsmath
\boolfalse{LWR@amsmultline}
\LWR@addmathjax{multline*}{\the\@envbody}
}
{\endlateximage}

}


\BeforeBeginEnvironment{gather}{

\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}

\AfterEndEnvironment{gather}{

\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{gather}{\the\@envbody}
}
{\endlateximage}

}

\BeforeBeginEnvironment{gather*}{

\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}

\AfterEndEnvironment{gather*}{

\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{gather*}{\the\@envbody}
}
{\endlateximage}

}

\BeforeBeginEnvironment{align}{

\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}

\AfterEndEnvironment{align}{

\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{align}{\the\@envbody}
}
{\endlateximage}

}

\BeforeBeginEnvironment{align*}{

\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}

\AfterEndEnvironment{align*}{

\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{align*}{\the\@envbody}
}
{\endlateximage}

}

\BeforeBeginEnvironment{flalign}{

\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}

\AfterEndEnvironment{flalign}{

\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{flalign}{\the\@envbody}
}
{\endlateximage}

}

\BeforeBeginEnvironment{flalign*}{

\ifbool{mathjax}
{
\LWR@syncmathjax
\boolfalse{LWR@amsmultline}
\LWR@beginhideamsmath
}
{
\lateximage[LWRAMSMATHBODY]
}
}

\AfterEndEnvironment{flalign*}{

\ifbool{mathjax}
{
\LWR@endhideamsmath
\LWR@addmathjax{flalign*}{\the\@envbody}
}
{\endlateximage}

}

\end{warpHTML}


\begin{warpHTML}
\newcounter{LWR@lateximagenumber}
\setcounter{LWR@lateximagenumber}{0}
\newcounter{LWR@lateximagedepth}
\setcounter{LWR@lateximagedepth}{0}

\ifcsdef{LWR@file}{}{\newwrite{\LWR@file}}
\edef\LWR@hashmark{\string#} % for use in \write
\edef\LWR@percent{\@percentchar} % for use in \write
\newcounter{LWR@LIpage}
\end{warpHTML}

\begin{warpall}

\newcommand*{\LateximageFontSizeName}{large}

\end{warpall}

\begin{warpHTML}

\newcommand{\LWR@HTMLsanitize}[1]{%
\protect\StrSubstitute{\detokenize{#1}}%
{\detokenize{&}}%
{\detokenize{&amp;}}[\LWR@strresult]%
\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}%
{\detokenize{<}}%
{\detokenize{&lt;}}%
[\LWR@strresult]%
\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}%
{\detokenize{>}}%
{\detokenize{&gt;}}%
[\LWR@strresult]%
\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}%
{\detokenize{##}}%
{\#}%
[\LWR@strresult]%
\LWR@strresult%
}

\newcommand{\LWR@HTMLsanitizeexpand}[1]{%
\protect\StrSubstitute{\detokenize\expandafter{#1}}%
{\detokenize{&}}%
{\detokenize{&amp;}}%
[\LWR@strresult]%
\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}%
{\detokenize{<}}%
{\detokenize{&lt;}}%
[\LWR@strresult]%
\protect\StrSubstitute{\detokenize\expandafter{\LWR@strresult}}%
{\detokenize{>}}%
{\detokenize{&gt;}}%
[\LWR@strresult]%
\LWR@strresult%
}

\catcode`\$=\active%

\NewDocumentEnvironment{lateximage}{O{image}}{%
\LWR@traceinfo{lateximage: starting on page \arabic{page}}%
\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{0}}%
{%
\addtocounter{LWR@lateximagedepth}{1}%
}%
{% start of outer-most lateximage
\addtocounter{LWR@lateximagenumber}{1}%
\LWR@traceinfo{lateximage: LWR@lateximagenumber is \arabic{LWR@lateximagenumber}}%
\boolfalse{mathjax}
\LWR@ensuredoingapar%
\addtocounter{LWR@externalfilecnt}{1}%
\LWR@traceinfo{lateximage: LWR@externalfilecnt is \arabic{LWR@externalfilecnt}}%
\setcounterpageref{LWR@LIpage}{LWRlateximage\theLWR@lateximagenumber}%
\LWR@traceinfo{lateximage: LWR@LIpage is \arabic{LWR@LIpage}}%
\LWR@htmltag{span id="lateximage\arabic{LWR@lateximagenumber}" %
class="lateximagesource"{}} \LWR@orignewline
\LWR@traceinfo{lateximage: about to write to lateximages.txt}%
\immediate\write\LWR@file{|\theLWR@LIpage|\theLWR@externalfilecnt|}%
\LWR@traceinfo{lateximage: about to create open comment}%
\LWR@htmlopencomment%
\addtocounter{LWR@lateximagedepth}{1}%
\LWR@traceinfo{lateximage: about to create new page}%
\LWR@orignewpage%
\LWR@traceinfo{lateximage: about to create minipage}%
\LWR@origminipage{6in}%
\csuse{LWR@orig\LateximageFontSizeName}%
\LWR@traceinfo{lateximage: about to temporarily restore formatting}%
\LWR@restoreorigformatting%
\LWR@traceinfo{lateximage: about to create label}%
\LWR@origlabel{LWRlateximage\arabic{LWR@lateximagenumber}}%
\LWR@traceinfo{lateximage: finished creating the label}%
\LetLtxMacro$\LWR@origdollar%
\catcode`\$=3% math shift
\LetLtxMacro\(\LWR@origopenparen%
\LetLtxMacro\)\LWR@origcloseparen%
\LetLtxMacro\[\LWR@origopenbracket%
\LetLtxMacro\]\LWR@origclosebracket%
\let\@ensuredmath\LWR@orig@ensuredmath%
}% end of outer-most lateximage
\LWR@traceinfo{lateximage: finished start of environment}%
}% end of \begin{lateximage}
{% start of \end{lateximage}
\LWR@traceinfo{lateximage: starting end of environment}%
\ifthenelse{\cnttest{\value{LWR@lateximagedepth}}{>}{1}}%
{%
\addtocounter{LWR@lateximagedepth}{-1}%
}%
{% end of outer-most lateximage
\LWR@origendminipage%
\LWR@orignewpage%
\LWR@origscriptsize%
\LWR@htmlclosecomment{}\LWR@orignewline%
\LWR@traceinfo{lateximage: The page after the image is \arabic{page}}%
\ifthenelse{\equal{#1}{LWRAMSMATHBODY}}%
{%
\LWR@subinlineimage[%
\LWR@HTMLsanitizeexpand{\detokenize\expandafter{\the\@envbody}}%
]%
{lateximage}%
{lateximages\OSPathSymbol{}lateximage-\theLWR@externalfilecnt}%
{svg}%
{}%
}%
{%
\LWR@subinlineimage[#1]{lateximage}%
{lateximages\OSPathSymbol{}lateximage-\theLWR@externalfilecnt}{svg}{}%
}%
\LWR@ensuredoingapar%
\LWR@htmltag{/span}%
\ifbool{HTMLDebugComments}{%
\LWR@htmlcomment{End of lateximage}%
}{}%
\addtocounter{LWR@lateximagedepth}{-1}%
}% end of outer-most lateximage
\LWR@traceinfo{lateximage: done}%
}%
\catcode`\$=3% math shift
\end{warpHTML}

\begin{warpprint}
\newenvironment{lateximage}[1][]{}{}
\end{warpprint}


\begin{warpHTML}

\renewenvironment*{center}
{
\LWR@forcenewpage
\BlockClass{center}
}
{\endBlockClass}

\renewenvironment*{flushright}
{
\LWR@forcenewpage
\BlockClass{flushright}
}
{\endBlockClass}

\renewenvironment*{flushleft}
{
\LWR@forcenewpage
\BlockClass{flushleft}
}
{\endBlockClass}

\end{warpHTML}



\begin{warpHTML}

\PassOptionsToPackage{
detect-mode=true,
per-mode=symbol, % fraction is not seen by pdftotext
text-celsius = {\HTMLentity{deg}C},
text-degree = {\HTMLentity{deg}},
}{siunitx}

\end{warpHTML}


\begin{warpHTML}


\newcommand*{\thisgraphicspath}{{}}
\renewcommand*{\graphicspath}[1]{\renewcommand*{\thisgraphicspath}{#1}}


\renewcommand*{\DeclareGraphicsExtensions}[1]{}
\renewcommand*{\DeclareGraphicsRule}[4]{}


\renewcommand*{\unitspace}{}

\newlength{\LWR@igwidth}
\newlength{\LWR@igheight}
\newcommand*{\LWR@igwidthstyle}{}
\newcommand*{\LWR@igheightstyle}{}
\newcommand*{\LWR@igorigin}{}
\newcommand*{\LWR@igangle}{}
\newcommand*{\LWR@igxscale}{1}
\newcommand*{\LWR@igyscale}{1}
\newcommand*{\LWR@igclass}{inlineimage}

\define@key{igraph}{width}{%
\setlength{\LWR@igwidth}{#1}%
\ifthenelse{\lengthtest{\LWR@igwidth > 0pt}}%
{%
\uselengthunit{PT}%
\renewcommand*{\LWR@igwidthstyle}{width:\rndprintlength{\LWR@igwidth}}%
\IfEndWith{#1}{ex}%
{\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes ex
{}% not ex
\IfEndWith{#1}{em}%
{\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes em
{}% not em
\IfEndWith{#1}{\%}%
{\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes percent
{}% not percent
\IfEndWith{#1}{px}%
{\renewcommand*{\LWR@igwidthstyle}{width:#1}}% yes px
{}% not px
}{}% end of length > 0pt
}
\define@key{igraph}{height}{%
\setlength{\LWR@igheight}{#1}%
\ifthenelse{\lengthtest{\LWR@igheight > 0pt}}%
{%
\uselengthunit{PT}%
\renewcommand*{\LWR@igheightstyle}{%
height:\rndprintlength{\LWR@igheight} %
}%
\IfEndWith{#1}{ex}%
{\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes ex
{}% not ex
\IfEndWith{#1}{em}%
{\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes em
{}% not em
\IfEndWith{#1}{\%}%
{\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes percent
{}% not percent
\IfEndWith{#1}{px}%
{\renewcommand*{\LWR@igheightstyle}{height:#1}}% yes px
{}% not px
}{}% end of length > 0pt
}
\define@key{igraph}{origin}{%
\renewcommand*{\LWR@igorigin}{#1}%
}
\define@key{igraph}{angle}{\renewcommand*{\LWR@igangle}{#1}}
\define@key{igraph}{class}{\renewcommand*{\LWR@igclass}{#1}}

\define@key{igraph}{scale}{%
\renewcommand*{\LWR@igxscale}{#1}%
\renewcommand*{\LWR@igyscale}{#1}}
\define@key{igraph}{bb}{}
\define@key{igraph}{bbllx}{}
\define@key{igraph}{bblly}{}
\define@key{igraph}{bburx}{}
\define@key{igraph}{bbury}{}
\define@key{igraph}{natwidth}{}
\define@key{igraph}{natheight}{}
\define@key{igraph}{hiresbb}{}
\define@key{igraph}{viewport}{}
\define@key{igraph}{trim}{}
\define@key{igraph}{totalheight}{}
\define@key{igraph}{keepaspectratio}{}
\define@key{igraph}{clip}{}
\define@key{igraph}{draft}{}
\define@key{igraph}{type}{}
\define@key{igraph}{ext}{}
\define@key{igraph}{read}{}
\define@key{igraph}{command}{}

\newcommand*{\LWR@rotstyle}[2]{%
 #1transform:rotate(-#2deg);
}

\newcommand*{\LWR@scalestyle}[3]{%
 #1transform:scale(#2,#3);
}


\newbool{LWR@infloatrow}
\boolfalse{LWR@infloatrow}

\newcommand*{\LWR@imageextension}{}
\newcommand*{\LWR@expgraphicsfilename}{}

\NewDocumentCommand{\LWR@includegraphicsb}{s o o m}
{%
\LWR@origtilde \LWR@orignewline%
\ifthenelse{\cnttest{\value{LWR@minipagedepth}}{=}{0}}{%
\ifbool{LWR@infloatrow}%
{}
{% not in a minipage or a floatrow:
\setlength{\linewidth}{6in}%
\setlength{\textwidth}{6in}%
\setlength{\textheight}{9in}%
}%
}{}%
\edef\LWR@expgraphicsfilename{#4}
\renewcommand*{\LWR@imageextension}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.jpg}%
{\renewcommand*{\LWR@imageextension}{.jpg}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.JPG}%
{\renewcommand*{\LWR@imageextension}{.JPG}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.png}%
{\renewcommand*{\LWR@imageextension}{.png}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.PNG}%
{\renewcommand*{\LWR@imageextension}{.PNG}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.gif}%
{\renewcommand*{\LWR@imageextension}{.gif}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.GIF}%
{\renewcommand*{\LWR@imageextension}{.GIF}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.svg}%
{\renewcommand*{\LWR@imageextension}{.svg}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.SVG}%
{\renewcommand*{\LWR@imageextension}{.SVG}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.svgz}%
{\renewcommand*{\LWR@imageextension}{.svgz}}{}%
\IfFileExists{\detokenize\expandafter\thisgraphicspath\LWR@expgraphicsfilename.SVGZ}%
{\renewcommand*{\LWR@imageextension}{.SVGZ}}{}%
\StrSubstitute{\detokenize\expandafter{\LWR@expgraphicsfilename}}%
{\detokenize{.pdf}}{\detokenize{.svg}}[\LWR@strresult]%
\StrSubstitute{\LWR@strresult}%
{\detokenize{.PDF}}{\detokenize{.SVG}}[\LWR@strresult]%
\large%
\setlength{\LWR@igwidth}{0pt}%
\setlength{\LWR@igheight}{0pt}%
\renewcommand*{\LWR@igwidthstyle}{}%
\renewcommand*{\LWR@igheightstyle}{}%
\renewcommand*{\LWR@igorigin}{}%
\renewcommand*{\LWR@igangle}{}%
\renewcommand*{\LWR@igxscale}{1}%
\renewcommand*{\LWR@igyscale}{1}%
\renewcommand*{\LWR@igclass}{inlineimage}%
\IfValueTF{#3}{}{%
\IfValueTF{#2}%
{\setkeys{igraph}{#2}}%
{\setkeys{igraph}{}}%
}%
\href{\thisgraphicspath\LWR@strresult\LWR@imageextension}%
{% start of href
\LWR@htmltag{% start of image tags
img src="\thisgraphicspath\LWR@strresult\LWR@imageextension" \LWR@orignewline
\LWR@origtilde{} alt="\LWR@strresult" \LWR@orignewline
\ifthenelse{
\NOT\equal{\LWR@igwidthstyle}{} \OR
\NOT\equal{\LWR@igheightstyle}{} \OR
\NOT\equal{\LWR@igorigin}{} \OR
\NOT\equal{\LWR@igangle}{} \OR
\NOT\equal{\LWR@igxscale}{1} \OR
\NOT\equal{\LWR@igyscale}{1}
}%
{\LWR@origtilde{} style="%
\ifthenelse{\NOT\equal{\LWR@igwidthstyle}{}}%
{\LWR@igwidthstyle;}{}%
\ifthenelse{\NOT\equal{\LWR@igheightstyle}{}}%
{\LWR@igheightstyle;}{}%
\ifthenelse{\NOT\equal{\LWR@igorigin}{}}%
{\LWR@origtilde{} transform-origin: \LWR@originnames{\LWR@igorigin}; \LWR@orignewline}{}%
\ifthenelse{\NOT\equal{\LWR@igangle}{}}%
{%
\LWR@rotstyle{-ms-}{\LWR@igangle}%
\LWR@rotstyle{-webkit-}{\LWR@igangle}%
\LWR@rotstyle{}{\LWR@igangle%
}}{}%
\ifthenelse{\NOT\equal{\LWR@igxscale}{1}\OR%
\NOT\equal{\LWR@igyscale}{1}}%
{\LWR@scalestyle{-ms-}{\LWR@igxscale}{\LWR@igyscale}%
\LWR@scalestyle{-webkit-}{\LWR@igxscale}{\LWR@igyscale}%
\LWR@scalestyle{}{\LWR@igxscale}{\LWR@igyscale}}{}%
" \LWR@orignewline}{}%
\LWR@origtilde{} class="\LWR@igclass" \LWR@orignewline%
}% end of image tags
}% end of href
\endgroup
\LWR@origscriptsize
}





\renewcommand*{\includegraphics}
{%
\LWR@ensuredoingapar%
\begingroup%
\LWR@includegraphicsb%
}

\end{warpHTML}

\begin{warpprint}
\define@key{Gin}{class}{}
\end{warpprint}


\begin{warpHTML}

\newcommand*{\LWR@rotboxorigin}{}
\newcommand*{\LWR@originname}[1]{%
\ifthenelse{\equal{#1}{t}}{top}{}%
\ifthenelse{\equal{#1}{b}}{bottom}{}%
\ifthenelse{\equal{#1}{c}}{center}{}%
\ifthenelse{\equal{#1}{l}}{left}{}%
\ifthenelse{\equal{#1}{r}}{right}{}%
}
\newcommand*{\LWR@originnames}[1]{%
\StrChar{#1}{1}[\LWR@strresult]%
\LWR@originname{\LWR@strresult}
\StrChar{#1}{2}[\LWR@strresult]%
\LWR@originname{\LWR@strresult}
}
\define@key{krotbox}{origin}{%
\renewcommand*{\LWR@rotboxorigin}{#1}%
}
\define@key{krotbox}{x}{}
\define@key{krotbox}{y}{}
\define@key{krotbox}{units}{}
\LetLtxMacro\LWR@origrotatebox\rotatebox

\NewDocumentCommand{\LWR@rotatebox}{O{} m +m}{%
\renewcommand*{\LWR@rotboxorigin}{}
\setkeys{krotbox}{#1}%
\LWR@htmltagc{span style="display: inline-block; %
\ifthenelse{\NOT\equal{\LWR@rotboxorigin}{}}%
{transform-origin: \LWR@originnames{\LWR@rotboxorigin};\LWR@origtilde}{}%
\LWR@rotstyle{-ms-}{#2} %
\LWR@rotstyle{-webkit-}{#2} %
\LWR@rotstyle{}{#2} %
"{}}\LWR@orignewline%
\begin{LWR@nestspan}%
#3%
\LWR@htmltagc{/span}%
\end{LWR@nestspan}%
}

\LetLtxMacro\LWR@origscalebox\scalebox

\NewDocumentCommand{\LWR@scalebox}{m o m}{%
\LWR@htmltagc{span style="display: inline-block; %
\LWR@scalestyle{-ms-}{#1}{\IfNoValueTF{#2}{#1}{#2}} %
\LWR@scalestyle{-webkit-}{#1}{\IfNoValueTF{#2}{#1}{#2}} %
\LWR@scalestyle{}{#1}{\IfNoValueTF{#2}{#1}{#2}} %
"{}}%
\begin{LWR@nestspan}%
#3%
\LWR@htmltagc{/span}%
\end{LWR@nestspan}%
}

\let\LWR@origreflectbox\reflectbox

\newcommand{\LWR@reflectbox}[1]{\LWR@scalebox{-1}[1]{#1}}

\end{warpHTML}


\begin{warpHTML}

\renewcommand{\resizebox}[3]{#3}

\end{warpHTML}




\begin{warpHTML}
\AtEndPreamble{
\RequirePackage{cleveref}
}
\AfterEndPreamble{
\LWR@traceinfo{Patching cleveref.}




\renewcommand*{\@@setcref}[2]{#1{\ref{#2}}{}{}}


\renewcommand{\@@setcrefrange}[3]{%
#1{\ref{#2}}{\ref{#3}}{}{}{}{}}


\newcommand*{\cpagerefFor}{for}

\renewcommand*{\@@setcpageref}[2]{%
#1{\cpagerefFor\ \cref{#2}}{}{}%
}


\renewcommand{\@@setcpagerefrange}[3]{%
#1{\cpagerefFor\ \cref{#2}}{\cref{#3}}{}{}{}{}}
}% AfterEndPreamble

\let\LWR@origlabel\label
\let\label\LWR@newlabel
\let\LWR@origref\ref
\let\ref\LWR@newref% \end{ syntax highlighting
\let\LWR@origpageref\pageref
\let\pageref\LWR@newpageref

\end{warpHTML}


\begin{warpHTML}

\BeforeBeginEnvironment{picture}{\lateximage}

\AfterEndEnvironment{picture}{\endlateximage}

\end{warpHTML}


\begin{warpHTML}


\newcounter{LWR@minipagedepth}
\setcounter{LWR@minipagedepth}{0}

\newlength{\LWR@minipagewidth}
\newlength{\LWR@minipageheight}
\def\LWR@endminipage{%
    \par
    \unskip
    \ifvoid\@mpfootins\else
      \vskip\skip\@mpfootins
      \normalcolor
\LWR@htmldivclass{mpfootnotes}
\LWR@origmedskip
      \unvbox\@mpfootins
\LWR@htmldivclassend{mpfootnotes}
    \fi
    \@minipagefalse
  \color@endgroup
  \egroup
  \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}}

\newcommand*{\LWR@subminipage}{%
\LWR@stoppars
\LWR@origminipage{6in}
\LWR@origraggedright%
\LWR@startpars%
}

\newcommand*{\LWR@endsubminipage}{%
\LWR@stoppars%
\LWR@endminipage% The following empty line is required:

}

\newbool{LWR@minipagefullwidth}
\boolfalse{LWR@minipagefullwidth}
\newcommand*{\minipagefullwidth}{\booltrue{LWR@minipagefullwidth}}
\end{warpHTML}
\begin{warpprint}
\newcommand*{\minipagefullwidth}{}
\end{warpprint}
\begin{warpHTML}
\newbool{LWR@minipagethispar}
\boolfalse{LWR@minipagethispar}
\RenewDocumentEnvironment{minipage}{O{t} o O{t} m}
{%
\uselengthunit{in}%
\setlength{\LWR@minipagewidth}{#4}%
\ifthenelse{\cnttest{\value{LWR@minipagedepth}}{=}{0}}{%
\addtolength{\LWR@minipagewidth}{3em}% room for frames
\setlength{\linewidth}{6in}%
\setlength{\textwidth}{6in}%
\setlength{\textheight}{9in}%
}{}%
\LWR@traceinfo{computed width is \rndprintlength{\LWR@minipagewidth}}
\addtocounter{LWR@minipagedepth}{1}%
\setlength{\LWR@minipageheight}{\textheight}% default unless specified
\IfValueTF{#2}{\setlength{\LWR@minipageheight}{#2}}{}%
\LWR@stoppars%
\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 ; }{}%
\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} ; }{}%
"{}}%

\LWR@origminipage{6in}% The preceding empty line is required.
\setlength{\linewidth}{#4}% the original width
\setlength{\textwidth}{6in}%
\setlength{\textheight}{9in}%
\LWR@origraggedright%
\LWR@startpars%
\LWR@traceinfo{minipage: finished starting the minipage}%
}
{%
\LWR@stoppars%
\LWR@endminipage% The following empty line is required:

\LWR@htmldivclassend{minipage}%
\LWR@origvspace{1\baselineskip}% required for subcaption
\addtocounter{LWR@minipagedepth}{-1}%
\LWR@startpars%
\global\booltrue{LWR@minipagethispar}%
}
\RenewDocumentCommand{\parbox}{O{t} o O{t} m +m}
{
\LWR@traceinfo{parbox of width #4}%
\begin{minipage}[#1][#2][#3]{#4}
#5
\end{minipage}
}
\LetLtxMacro\LWR@origmakebox\makebox

\RenewDocumentCommand{\makebox}{d() o o m}{%
\mbox{#4}
}
\LetLtxMacro\LWR@origframebox\framebox

\RenewDocumentCommand{\framebox}{o o m}{%
\fbox{#3}
}
\let\LWR@origfbox\fbox

\renewcommand{\fbox}[1]{%
\LWR@htmltagc{span class="framebox"}%
\begin{LWR@nestspan}%
#1
\LWR@htmltagc{/span}%
\end{LWR@nestspan}%
}

\newcommand{\fboxBlock}[1]{%
\begin{BlockClass}{framed}
#1
\end{BlockClass}
}

\NewDocumentEnvironment{fminipage}{O{t} o O{t} m}
{%
\setlength{\LWR@tempwidth}{#4}
\begin{BlockClass}[width:\rndprintlength{\LWR@tempwidth};]{framed}%
}
{\end{BlockClass}}
\LetLtxMacro{\LWR@origraisebox}{\raisebox}

\RenewDocumentCommand{\raisebox}{m o o m}{%
#4%
}

\end{warpHTML}

\begin{warpall}

\newsavebox{\LWR@fminipagebox}

\NewDocumentEnvironment{LWR@fminipageprint}{O{t} o O{t} m}
{%
\IfValueTF{#2}%
{\minipage[#1][#2][#3]{#4}}%
{\minipage[#3]{#4}}%
\begin{lrbox}{\LWR@fminipagebox}%
\IfValueTF{#2}%
{\minipage[#1][#2][#3]{\linewidth-2\fboxsep-2\fboxrule}}%
{\minipage[#3]{\linewidth-2\fboxsep-2\fboxrule}}%
}
{%
\endminipage%
\end{lrbox}%
\fbox{\usebox{\LWR@fminipagebox}}%
\endminipage%
}

\end{warpall}

\begin{warpprint}

\let\fboxBlock\fbox

\LetLtxMacro{\fminipage}{\LWR@fminipageprint}
\LetLtxMacro{\endfminipage}{\endLWR@fminipageprint}

\end{warpprint}


\begin{warpHTML}


\DeclareRobustCommand{\LWR@HTMLemph}[1]{\LWR@htmlspan{em}{#1}}
\DeclareRobustCommand{\LWR@nullemph}[1]{#1}
\LetLtxMacro{\emph}{\LWR@HTMLemph}

\DeclareRobustCommand{\LWR@HTMLtextmd}[1]{\LWR@htmlspanclass{textmd}{#1}}
\DeclareRobustCommand{\LWR@nulltextmd}[1]{#1}
\LetLtxMacro{\textmd}{\LWR@HTMLtextmd}

\DeclareRobustCommand{\LWR@HTMLtextbf}[1]{\LWR@htmlspan{b}{#1}}
\DeclareRobustCommand{\LWR@nulltextbf}[1]{#1}
\LetLtxMacro{\textbf}{\LWR@HTMLtextbf}

\DeclareRobustCommand{\LWR@HTMLtextrm}[1]{\LWR@htmlspanclass{textrm}{#1}}
\DeclareRobustCommand{\LWR@nulltextrm}[1]{#1}
\LetLtxMacro{\textrm}{\LWR@HTMLtextrm}

\DeclareRobustCommand{\LWR@HTMLtextsf}[1]{\LWR@htmlspanclass{textsf}{#1}}
\DeclareRobustCommand{\LWR@nulltextsf}[1]{#1}
\LetLtxMacro{\textsf}{\LWR@HTMLtextsf}

\DeclareRobustCommand{\LWR@HTMLtexttt}[1]{\LWR@htmlspan{kbd}{#1}}
\DeclareRobustCommand{\LWR@nulltexttt}[1]{#1}
\LetLtxMacro{\texttt}{\LWR@HTMLtexttt}

\DeclareRobustCommand{\LWR@HTMLtextup}[1]{\LWR@htmlspanclass{textup}{#1}}
\DeclareRobustCommand{\LWR@nulltextup}[1]{#1}
\LetLtxMacro{\textup}{\LWR@HTMLtextup}

\DeclareRobustCommand{\LWR@HTMLtextit}[1]{\LWR@htmlspan{i}{#1}}
\DeclareRobustCommand{\LWR@nulltextit}[1]{#1}
\LetLtxMacro{\textit}{\LWR@HTMLtextit}

\DeclareRobustCommand{\LWR@HTMLtextsc}[1]{\LWR@htmlspanclass{textsc}{#1}}
\DeclareRobustCommand{\LWR@nulltextsc}[1]{#1}
\LetLtxMacro{\textsc}{\LWR@HTMLtextsc}

\DeclareRobustCommand{\LWR@HTMLtextsl}[1]{\LWR@htmlspanclass{testsl}{#1}}
\DeclareRobustCommand{\LWR@nulltextsl}[1]{#1}
\LetLtxMacro{\textsl}{\LWR@HTMLtextsl}

\DeclareRobustCommand{\LWR@HTMLtextnormal}[1]{\textmd{\textrm{\textup{#1}}}}
\DeclareRobustCommand{\LWR@nulltextnormal}[1]{#1}
\LetLtxMacro{\textnormal}{\LWR@HTMLtextnormal}

\DeclareRobustCommand{\LWR@HTMLrmfamily}[1]{}
\DeclareRobustCommand{\LWR@HTMLsffamily}[1]{}
\DeclareRobustCommand{\LWR@HTMLttfamily}[1]{}
\DeclareRobustCommand{\LWR@HTMLbfseries}[1]{}
\DeclareRobustCommand{\LWR@HTMLmdseries}[1]{}
\DeclareRobustCommand{\LWR@HTMLupshape}[1]{}
\DeclareRobustCommand{\LWR@HTMLslshape}[1]{}
\DeclareRobustCommand{\LWR@HTMLscshape}[1]{}
\DeclareRobustCommand{\LWR@HTMLitshape}[1]{}
\DeclareRobustCommand{\LWR@HTMLem}[1]{}
\DeclareRobustCommand{\LWR@nullrmfamily}[1]{}
\DeclareRobustCommand{\LWR@nullsffamily}[1]{}
\DeclareRobustCommand{\LWR@nullttfamily}[1]{}
\DeclareRobustCommand{\LWR@nullbfseries}[1]{}
\DeclareRobustCommand{\LWR@nullmdseries}[1]{}
\DeclareRobustCommand{\LWR@nullupshape}[1]{}
\DeclareRobustCommand{\LWR@nullslshape}[1]{}
\DeclareRobustCommand{\LWR@nullscshape}[1]{}
\DeclareRobustCommand{\LWR@nullitshape}[1]{}
\DeclareRobustCommand{\LWR@nullem}[1]{}

\newcommand*{\LWR@nullfonts}{%
\LetLtxMacro{\emph}{\LWR@nullemph}%
\LetLtxMacro{\textmd}{\LWR@nulltextmd}%
\LetLtxMacro{\textbf}{\LWR@nulltextbf}%
\LetLtxMacro{\textrm}{\LWR@nulltextrm}%
\LetLtxMacro{\textsf}{\LWR@nulltextsf}%
\LetLtxMacro{\texttt}{\LWR@nulltexttt}%
\LetLtxMacro{\textup}{\LWR@nulltextup}%
\LetLtxMacro{\textit}{\LWR@nulltextit}%
\LetLtxMacro{\textsc}{\LWR@nulltextsc}%
\LetLtxMacro{\textsl}{\LWR@nulltextsl}%
\LetLtxMacro{\textnormal}{\LWR@nulltextnormal}%
\LetLtxMacro{\rmfamily}{\LWR@nullrmfamily}%
\LetLtxMacro{\sffamily}{\LWR@nullsffamily}%
\LetLtxMacro{\ttfamily}{\LWR@nullttfamily}%
\LetLtxMacro{\bfseries}{\LWR@nullbfseries}%
\LetLtxMacro{\mdseries}{\LWR@nullmdseries}%
\LetLtxMacro{\upshape}{\LWR@nullupshape}%
\LetLtxMacro{\slshape}{\LWR@nullslshape}%
\LetLtxMacro{\scshape}{\LWR@nullscshape}%
\LetLtxMacro{\itshape}{\LWR@nullitshape}%
\LetLtxMacro{\em}{\LWR@nullem}%
\LetLtxMacro{\normalfont}{\LWR@nullnormalfont}%
\renewcommand*{\HTMLunicode}[1]{}%
\renewcommand*{\HTMLentity}[1]{}%
\renewcommand*{\&}{and}%
\renewcommand{\textsuperscript}[1]{##1}%
\renewcommand{\textsubscript}[1]{##1}%
\RenewDocumentCommand{\LWR@htmlspanclass}{o m +m}{##3}%
\DeclareExpandableDocumentCommand{\InlineClass}{o m +m}{##3}%
}

\renewcommand*{\mdseries}{}

\renewcommand*{\bfseries}{}

\renewcommand*{\rmfamily}{}

\renewcommand*{\sffamily}{}

\renewcommand*{\ttfamily}{}

\renewcommand*{\upshape}{}

\renewcommand*{\itshape}{}

\renewcommand*{\scshape}{}

\renewcommand*{\normalfont}{}


\renewcommand{\sp}[1]{\text{<sup>#1</sup>}{}}


\renewcommand{\sb}[1]{\text{<sub>#1</sub>}{}}

\renewcommand{\textsuperscript}[1]{\LWR@htmlspan{sup}{#1}}

\renewcommand{\textsubscript}[1]{\LWR@htmlspan{sub}{#1}}

\AtBeginDocument{\let\up\textsuperscript}

\AtBeginDocument{\let\fup\textsuperscript}

\renewcommand*{\hfill}{\qquad}

\renewcommand*{\hrulefill}{\rule{1in}{1pt}}

\renewcommand*{\dotfill}{\dots}

\end{warpHTML}


\begin{warpHTML}

\let\LWR@origcomma\,
\let\LWR@origtilde~
\let\LWR@origenskip\enskip
\let\LWR@origquad\quad
\let\LWR@origqquad\qquad
\let\LWR@orighspace\hspace
\let\LWR@origvspace\vspace
\let\LWR@origrule\rule
\let\LWR@origmedskip\medskip

\renewcommand*{\,}{\HTMLunicode{202f}} % HTML thin non-breakable space
\renewcommand*{~}{\HTMLentity{nbsp}}
\renewcommand*{\textellipsis}{\HTMLunicode{2026}}
\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

}

\newcommand*{\LWR@newlinebr}{\unskip\LWR@htmltag{br /}\LWR@orignewline}%
\let\newline\LWR@newlinebr

\LetLtxMacro\LWR@origendofline\\
\NewDocumentCommand{\LWR@endofline}{s o}
{%
\newline%
}

\newcommand*{\LWR@minipagestartpars}{%
\ifbool{LWR@minipagethispar}%
{%
\LWR@startpars%
}{}%
}

\newcommand*{\LWR@minipagestoppars}{%
\ifbool{LWR@minipagethispar}%
{%
\LWR@stoppars%
}{}%
}

\renewcommand*{\quad}{%
\LWR@minipagestoppars%
\HTMLunicode{2001}%
\LWR@minipagestartpars%
}

\renewcommand*{\qquad}{\quad\quad}

\renewcommand*{\enskip}{%
\LWR@minipagestoppars%
\HTMLunicode{2000}%
\LWR@minipagestartpars%
}

\newlength{\LWR@tempwidth}
\newlength{\LWR@tempheight}
\newlength{\LWR@tempraise}

\NewDocumentCommand{\LWR@hspace}{s m}{%
\setlength{\LWR@tempwidth}{#2}%
\ifnum\gluestretchorder\LWR@tempwidth>0%
\setlength{\LWR@tempwidth}{2em}%
\fi%
\ifthenelse{\dimtest{\LWR@tempwidth}{=}{0pt}}{}{%
\LWR@minipagestoppars%
\ifthenelse{\dimtest{\LWR@tempwidth}{=}{.16667em}}
{%
\HTMLunicode{2009}% thin breakable space
}%
{%
\uselengthunit{PT}%
\LWR@htmltagc{%
span style="width:\printlength{\LWR@tempwidth}; display:inline-block;"%
}%
\LWR@htmltagc{/span}%
}%
\LWR@minipagestartpars%
}%
}
\NewDocumentCommand{\LWR@nohspace}{s m}{}

\LetLtxMacro{\hspace}{\LWR@hspace}

\NewDocumentCommand{\LWR@vspace}{s m}{}
\let\vspace\LWR@vspace

\renewcommand*{\linebreak}[1][]{\newline}

\renewcommand*{\nolinebreak}[1][]{}

\renewcommand*{\pagebreak}[1][]{

}

\renewcommand*{\nopagebreak}[1][]{}

\RenewDocumentCommand{\enlargethispage}{s m}{}

\NewDocumentCommand{\LWR@rule}{o m m}{%
\setlength{\LWR@tempwidth}{#2}%
\ifthenelse{\lengthtest{\LWR@tempwidth=0pt}}
{}% zero- width
{% non-zero width
\ifthenelse{\lengthtest{\LWR@tempwidth>0pt}\AND%
\lengthtest{\LWR@tempwidth<1pt}}%
{\setlength{\LWR@tempwidth}{1pt}}{}%
\setlength{\LWR@tempheight}{#3}%
\ifthenelse{\lengthtest{\LWR@tempheight>0pt}\AND%
\lengthtest{\LWR@tempheight<1pt}}%
{\setlength{\LWR@tempheight}{1pt}}{}%
\LWR@minipagestoppars%
\uselengthunit{PT}%
\LWR@htmltagc{%
span
style=" %
background:\LWR@currenttextcolor; %
width:\printlength{\LWR@tempwidth}; %
height:\printlength{\LWR@tempheight}; %
\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%
}{}%
display:inline-block;"%
}%
\LWR@htmltagc{/span}%
\LWR@minipagestartpars%
}% non-zero width
}
\renewcommand{\rule}{\LWR@rule}

\end{warpHTML}


\begin{warpHTML}

\newcommand*{\phantomsection}{\section*{}}

\end{warpHTML}


\begin{warpHTML}

\newcommand*{\LWR@TeX}
{\InlineClass{latexlogofont}%
{\InlineClass{latexlogo}{T\textsubscript{e}X}}}
\newcommand*{\LWR@LaTeX}
{\InlineClass{latexlogofont}%
{\InlineClass{latexlogo}%
{L\textsuperscript{a}T\textsubscript{e}X}}}

\renewcommand*{\LaTeXe}
{\LaTeX\InlineClass{latexlogofont}%
{\,2\textsubscript{\textit{\HTMLunicode{3B5}}}}}
\newcommand*{\LWR@LuaTeX}{\InlineClass{latexlogofont}{Lua}\TeX}
\newcommand*{\LWR@LuaLaTeX}{\InlineClass{latexlogofont}{Lua}\LaTeX}
\newcommand*{\Xe}
  {X\textsubscript{\HTMLunicode{18e}}}
\newcommand*{\LWR@XeTeX}{\InlineClass{xetexlogo}{\Xe}\TeX}
\newcommand*{\LWR@XeLaTeX}{\InlineClass{xelatexlogo}{\Xe}\LaTeX}
\newcommand*{\LWR@ConTeXt}
{\InlineClass{latexlogofont}{Con}\TeX{}%
\InlineClass{latexlogofont}{t}}
\providecommand*{\BibTeX}
{\InlineClass{latexlogofont}{B\textsc{ib}}\TeX}

\newcommand*{\MakeIndex}
{\InlineClass{latexlogofont}{\textit{MakeIndex}}}
\AtBeginDocument{\DeclareDocumentCommand{\AmS}{}
{\InlineClass{amslogo}{\textit{A\textsubscript{M}S}}}}
\newcommand*{\MiKTeX}{\InlineClass{latexlogofont}{MiK}\TeX}
\newcommand*{\LyX}{\InlineClass{lyxlogo}{LyX}}
\end{warpHTML}
\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}


\begin{warpHTML}

\AfterEndPreamble{\LWR@LwarpStart}
\AtEndDocument{\LWR@LwarpEnd}

\end{warpHTML}


\endinput
%%
%% End of file `lwarp.sty'.
