% $Id: tex4ht-4ht.tex 1581 2024-10-13 11:33:56Z michal_h21 $
% tex tex4ht-4ht   or   ht tex tex4ht-4ht
%
% Copyright 2009-2024 TeX Users Group    
% Copyright 1996-2009 Eitan M. Gurari    
% Released under LPPL 1.3c+.
% See tex4ht-cpright.tex for license text.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
\input DraTex.sty
\input AlDraTex.sty

\DrawOff

\def\writesixteen#1{\immediate\write1616{#1}}
\writesixteen{----------Verify length of lines (4ht)------------}

\newif\ifalprotex \alprotexfalse

\hbadness=10000     \vbadness=10000  \hfuzz=99in \vfuzz=99in
\def\BREAK{^^J}

\def\Link#1\EndLink{}

\openin15=th4.4ht
          \ifeof15

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% replacement for TeX4ht %%%%%%%%%%%%%%%%%%
\csname newif\endcsname\ifHtml \Htmlfalse
\def\-#1{\ifx#1-\expandafter\TEMP\else\expandafter#1\fi}
\expandafter\let\csname bye\endcsname=\end
\def\TEMP#1/#2/#3/{}
\def\HTable#1{}
\def\'#1'{}
\def\`#1'{}
\let\TableOfContents=\relax
\def\Part#1{}
\def\Chapter#1{}
\def\Appendix#1{}
\def\Section#1{}
\def\SubSection#1{}
\def\Margin#1{}
\def\HCode#1{}
\def\LinkPort\<#1\>{}
\def\TagSec#1{}
\def\RefSec#1{}
\def\List#1{}   \let\ShortList=\List
\def\EndList{}
\def\item{}
\def\IgnorePar{} 
\def\EndP{}
\catcode`\:=11
\csname newcount\endcsname\tmp:cnt
          \def\no:catcodes#1#2#3{%
   \tmp:cnt=#1
   \def\no::catcodes{%
      \catcode\tmp:cnt=#3
      \ifnum\tmp:cnt<#2
          \advance\tmp:cnt by 1  \expandafter\no::catcodes
      \fi }%
   \no::catcodes }
           \let\:oldlq=\`
\let\:oldrq=\'
\def\'{\leavevmode \:cats  \::cats}
\def\::cats#1{\if  #1"\expandafter\:oldrq
              \else  \def\:eat##1#1{\tt ##1\egroup}\expandafter\:eat\fi}
\def\`{\leavevmode \:cats  \:::cats}
\def\:::cats#1{\if #1"\expandafter\:oldlq
               \else \def\:eat##1#1{`{\tt ##1}'\egroup}\expandafter\:eat\fi}
\def\:cats{\bgroup  \no:catcodes0{255}{12}\catcode`\ = 10
           \catcode`\^^M = 10 \catcode`\^^I = 10
}

\def\HPage{}  \def\EndHPage{}
\def\Verbatim{\bgroup\catcode`\\=12 \catcode`\#=12
   \catcode`\^=12 \catcode`\_=12
   \catcode`\{=12 \catcode`\}=12 \catcode`\%=12 \:vrb}
\long\def\:vrb#1EndVerbatim{\egroup}

   \closein15 
       \def\next{%\input DraTex.sty
                 \input ProTex.sty
             \AlProTex{sty,<<<>>>,|,title,list,[],ClearCode}}
   \catcode`\:=12
\else 
   \closein15 
      \def\next{%\input DraTex.sty
                \input tex4ht.sty
                \Preamble{html,th4,family,sections+,xhtml,next}
                \Configure{@HEAD}{\HCode{<link rev="made" 
                      href="mailto:tex4ht@tug.org" />}}
%                \input MyTeX4ht.sty {}%
                \input ProTex.sty
             \AlProTex{sty,<<<>>>,|,title,list,[],ClearCode}
                \EndPreamble
       }
\fi

\next

%\CodeLineNo % Set line numbers in the output, using %.
% to change the comment char used: \srclineBOT{some symbol}
% Sadly, this causes compilation to fail in unknown circumstances.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\expandafter \ifx \csname append:def\endcsname \relax
   \expandafter\def\csname append:def\endcsname#1#2{%
      \def\Xtemp{\def#1}%
      \expandafter\expandafter\expandafter\Xtemp\expandafter{#1#2}}
\fi

\expandafter \ifx \csname Verbatim\endcsname \relax
   \def\Verbatim{\bgroup 
      \catcode`\^=10 \catcode`\\=10  \catcode`\%=10
       \catcode`\{=10    \catcode`\}=10    \catcode`\#=10     \catcode`\#=10
       \XVerbatim}
   \long\def\XVerbatim#1EndVerbatim{\egroup}
\fi

\expandafter \ifx \csname Verb\endcsname \relax
    \def\Verb{\bgroup \catcode`\^=10 \catcode`\\=10  \catcode`\%=10
       \catcode`\{=10    \catcode`\}=10    \catcode`\#=10     \catcode`\#=10
       \leavevmode \Xctgs}
    \def\Xctgs#1{\def\Xeat##1#1{\egroup}\Xeat }
\fi

\ifx \HAssign\UnDef

\csname newcount\endcsname \tmpXxXcnt

\def\advXxX#1{\def\XxXvar{#1}\futurelet\XxXtemp\AdvancXxX}
\def\AdvancXxX{\ifx [\XxXtemp \expandafter\AdvancXxXe
              \else \expandXxXafter{\expandafter\advXxXc\XxXvar}\fi}
\def\AdvancXxXe[#1]{\expandafter\advXxXc\csname
                  \expandafter\string\XxXvar[#1]\endcsname}

\def\gXxXAdvance#1{\bgroup \def\XxXtemp{#1}%
                 \tmpXxXcnt#1\afterassignment\XxXgplus \mthXxXop\tmpXxXcnt}
\def\XxXgplus{\expandafter\xdef\XxXtemp{\the\tmpXxXcnt}\egroup}
\def\XxXAdvance#1{\bgroup \def\XxXtemp{#1}%
                \tmpXxXcnt#1\afterassignment\XxXaplus \mthXxXop\tmpXxXcnt}
\def\XxXaplus{\xdef\XxXtemp{\def\expandafter\noexpand\XxXtemp{\the\tmpXxXcnt}}%
            \egroup \XxXtemp}
\def\HAssign{\XxXssg\edef}
\def\gHAssign{\XxXssg\xdef}

\def\XxXssg#1#2{\let\dXxXfn#1\def\XxXvar{#2}\futurelet\XxXtemp\XxXAssgn}
\def\XxXAssgn{%
   \ifx [\XxXtemp
         \expandafter\dXxXfn\XxXvar[##1]{%
              \noexpand\csname  \expandafter
                                  \string\XxXvar[##1]\noexpand\endcsname}%
         \expandafter\assgXxXm
   \else \afterassignment\assgXxXv \expandafter \tmpXxXcnt \fi }

\def\assgXxXv{\expandafter\dXxXfn\XxXvar{\the\tmpXxXcnt}}
\def\assgXxXm[#1]{%
   \def\XxXtemp{\expandafter\dXxXfn
      \csname \expandafter\string\XxXvar[#1]\endcsname{\the\tmpXxXcnt}}%
   \afterassignment\XxXtemp  \tmpXxXcnt}

\fi
\catcode`\:=11
\csname newcount\endcsname\tmp:cnt
\expandafter\ifx \csname no:catcodes\endcsname\relax
   \def\no:catcodes#1#2#3{%
      \tmp:cnt=#1
      \def\no::catcodes{%
         \catcode\tmp:cnt=#3
         \ifnum\tmp:cnt<#2
             \advance\tmp:cnt by 1  \expandafter\no::catcodes
         \fi }%
      \no::catcodes }
\fi
\let\:oldlq=\`
\let\:oldrq=\'
\def\'{\leavevmode \:cats  \::cats}
\def\::cats#1{\if  #1"\expandafter\:oldrq
              \else  \def\:eat##1#1{\tt ##1\egroup}\expandafter\:eat\fi}
\def\`{\leavevmode \:cats  \:::cats}
\def\:::cats#1{\if #1"\expandafter\:oldlq
               \else \def\:eat##1#1{`{\tt ##1}'\egroup}\expandafter\:eat\fi}
\bgroup
  \catcode`\^=7
  \gdef\:cats{\bgroup  \no:catcodes0{255}{12}\catcode`\ = 10
           \catcode`\^^M = 10 \catcode`\^^I = 10
  }
\egroup
\catcode`\:=12
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\HOME{/opt/cvr/gurari/tex4ht.dir/texmf/tex/generic/tex4ht/}
\def\SOURCE{/opt/cvr/gurari/main.dir/html.dir}

\newcount\tmpcnt  \tmpcnt\time  \divide\tmpcnt  60
\edef\temp{\the\tmpcnt}
\multiply\tmpcnt  -60 \advance\tmpcnt  \time

\edef\version{\the\year-\ifnum \month<10 0\fi
  \the\month-\ifnum \day<10 0\fi\the\day
   -\ifnum \temp<10 0\fi \temp
   :\ifnum \tmpcnt<10 0\fi\the\tmpcnt}

\def\CopyYear.#1.{%
   \ifnum #1=\year #1\space\space\space\space\space\space
    \else          #1-2009\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\let\ConfigFiles=\empty
\def\AddFile#1#2{\csname append:def\endcsname\ConfigFiles{\AddFile{#1}{#2}}}

\AddFile{0}{Preamble}
\AddFile{0}{tex4ht}
\AddFile{0}{tex4ht2}
\AddFile{0}{etex4ht}

\let\OutFiles=\empty
\def\AddFile{\futurelet\next\contAddFile}
\def\contAddFile{%
   \ifx [\next \def\next{\finishAddFile}%
   \else       \def\next{\finishAddFile[]}\fi
   \bgroup \catcode`\_=12 \next
}
\def\finishAddFile[#1]#2#3{\egroup
   \writesixteen{ ==> <#1, #2, #3>}%
   \csname append:def\endcsname\OutFiles{\OutputCodE\<\if !#1!#3\else #1\fi.4ht\>}%
   \csname append:def\endcsname\ConfigFiles{\AddFile{#2}{#3}}%
}

\ifHtml

\def\tocSubSection#1#2#3{\par| #2}  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                    % must appear before all TocAt
                                    % that refer to SubSection
                                    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\TocAt{Part,Chapter,Section,LikeSection}
\TocAt{Chapter,Section,LikeSection,/Appendix,/Part}
\TocAt{LikeChapter,Section,LikeSection,/Appendix,/Part}
\TocAt{Appendix,Section,LikeSection,/Appendix,/Part}
\TocAt{Section,SubSection,/LikeSection}
\TocAt{LikeSection,SubSection,/Section}

\CutAt{Part}
\CutAt{Chapter,LikeChapter,Appendix,Part}
\CutAt{LikeChapter,Chapter,Appendix,Part}
\CutAt{Appendix,Chapter,LikeChapter,Part}
\CutAt{Section,LikeSection,Appendix,Chapter,LikeChapter,Part}
\CutAt{LikeSection,Section,Appendix,Chapter,LikeChapter,Part}
\CutAt{SubSection,Section,LikeSection,Appendix,Chapter,LikeChapter,Part}

\else
\def\ParentOf#1{}
\csname TableOfContents\endcsname
\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\by{by}\def\={=}
\let\pReModifyOutputCode=\ModifyOutputCode
\def\ModifyOutputCode{%
   \def\by{}\def\={}%
   \pReModifyOutputCode}

\csname NoOutputCode\endcsname

\let\coDE=\<
\def\<{\vfil\par\coDE}

\tracingstats=1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\IgnorePar\EndP \HCode{<h1>A `Literate' View of tex4ht.sty</h1>}

\csname TableOfContents\endcsname[ParentOf,Part,Chapter,%
                         Appendix,LikeChapter%,Section,LikeSection%
     ]

%%%%%%%%%%%%%%%%%%%%%
\Part{Deeper Toc}
%%%%%%%%%%%%%%%%%%

\csname TableOfContents\endcsname[ParentOf,Part,Chapter,%
                         Appendix,LikeChapter,Section,LikeSection%
     ]

%----------------- shared with TeX4ht ------------------------------------

%%%%%%%%%%%%%%%%%%%%%
\Part{Shared}
%%%%%%%%%%%%%%%%%%

\<par del\><<<
!*?: >>>

\<section html addr\><<<
|<toc tag|>1-\file:id-\TitleCount >>>

\<toc tag\><<<
Q>>>

%------------------------------ start here ------------------------

\Chapter{Outline of the Code}

Keeping all the existing copyright messages in this file unchanged,
hence splitting the text from copyright line.

\<TeX4ht license text\><<<
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c 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.3c or later is part of all distributions
% of LaTeX version 2005/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% The Current Maintainer of this work
% is the TeX4ht Project <http://tug.org/tex4ht>.
%
% If you modify this program, changing the
% version identification would be appreciated.
\immediate\write-1{version |version}
>>>

This is prepended to the definition in tex4ht-cpright.tex, hence no need
to include the above (new) ``TeX4ht license text''.  I don't understand.
 
\<TeX4ht copyright\><<<
% Copyright 2009-|the|year|empty TeX Users Group
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\<book.4ht\><<<
% book.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
|<book / report / article cut points|>
|<book et al tocs|>
|<chapters for book / report|>
|<config book.sty utilities|>
|<book / report / article|>

|<config book-report-article utilities|>
|<redefine maketitle|>
|<config book-report-article shared|>
|<report,book tocs|>
\Hinput{book}
\endinput
>>>                        \AddFile{2}{book}

\<report.4ht\><<<
% report.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>

|<book / report / article cut points|>
|<book et al tocs|>
|<chapters for book / report|>

|<config book-report-article utilities|>
|<redefine maketitle|>
|<config book-report-article shared|>
|<config report / article shared|>
|<config report.sty utilities|>
|<book / report / article|>

|<report,book tocs|>
\Hinput{report}
\endinput
>>>                        \AddFile{2}{report}

\<article.4ht\><<<
% article.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>

|<book / report / article cut points|>
|<config article.sty utilities|>

|<config book-report-article utilities|>
|<redefine maketitle|>
|<config book-report-article shared|>
|<config report / article shared|>
|<config article.sty shared|>
|<book / report / article|>
|<article et al tocs|>
|<article tocs|>
\Hinput{article}
\endinput
>>>                        \AddFile{2}{article}

\<book / report / article\><<<
|<html latex tocs|>
|<book, report, article|>
|<latex options 1, 2, 3|>     |%after tocs, divs, and cuts|%
>>>

\<book, report, article\><<<
|<halign-based tables|>
>>>

\<config book-report-article shared\><<<
\long\def\:tempc{\@roman \c@enumiii}
\ifx \theenumiii\:tempc
   \def\:tempc{\a:enumiii\@roman\c@enumiii\b:enumiii}
   \HLet\theenumiii\:tempc
\fi
\NewConfigure{enumiii}{2}
>>>

\<report,book tocs\><<<
|<article tocs|>
\ConfigureToc{appendix} {\empty}{\ }{}{\newline}
\ConfigureToc{chapter} {\empty}{\ }{}{\newline}
\ConfigureToc{likechapter} {}{\empty}{}{\newline}
>>>

\<article tocs\><<<
\ConfigureToc{likeparagraph} {}{\empty}{}{\newline}
\ConfigureToc{likepart} {}{\empty}{}{\newline}
\ConfigureToc{likesection} {}{\empty}{}{\newline}
\ConfigureToc{likesubparagraph} {}{\empty}{}{\newline}
\ConfigureToc{likesubsection} {}{\empty}{}{\newline}
\ConfigureToc{likesubsubsection} {}{\empty}{}{\newline}
\ConfigureToc{paragraph} {\empty}{\ }{}{\newline}
\ConfigureToc{part} {\empty}{\ }{}{\newline}
\ConfigureToc{section} {\empty}{\ }{}{\newline}
\ConfigureToc{subparagraph} {\empty}{\ }{}{\newline}
\ConfigureToc{subsection} {\empty}{\ }{}{\newline}
\ConfigureToc{subsubsection} {\empty}{\ }{}{\newline}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Package patching handling}
%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%
% tutorial begin
%%%%%%%%%%%%%%%%%%%%%%%%

By default, .4ht files are loaded at begin document. When we need to patch 
a package at the moment when it is loaded, we can use the mechanism provided
by usepackage.4ht.

The obsolete way is to use the following construct:

\Verbatim
\<use package\><<<
packagename,>>>

\<add to usepackage\><<<
\def\:temp{packagename}\ifx\@currname\:temp
% package redefinitions
\fi
>>>
\EndVerbatim

The downside of this that it loads usepackage.4ht again for each package
it detects. This can slow down the compilation.

The recommended way is the following: 

\Verbatim
\<add to usepackage\><<<
% use package name as the second argument and name of the file
% that contains redefinitions as the third 
\Configure{PackageHooks}{packagename.sty}{packagename-hooks.4ht}
>>>

\<packagename-hooks.4ht\><<<
% packagename-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht copywrite|>
% package redefinitions
>>>\AddFile{9}{packagename-hooks}
\EndVerbatim

The contents of the hooks file can be following:

\Verbatim
% code before package is loaded
% ...
\:AtEndOfPackage{
  % redefine package commands that are used in the preamble
  % ...
}
\EndVerbatim

You can use the following special commands in the hooks file:

\Verbatim
\:dontusepackage{packagename} % prevent the package from loading
\:AtEndOfPackage{code} % redefine macros that can be used in the document preamble
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%
% tutorial end
%%%%%%%%%%%%%%%%%%%%%%%%


\<usepackage.4ht\><<<
% usepackage.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2003. Eitan M. Gurari
|<TeX4ht copywrite|>
   |<insert into latex|>
\endinput
>>>

\<insert into latex\><<<
\def\:temp{tex4ht}\ifx \:temp\@currname
   \:warning{\string\usepackage{tex4ht} again?}
   |<problem due to hyperref?|>
\fi
\gdef\a:usepackage{\use:package |<use package|>,|<par del|>}
\gdef\use:package#1,{%
   \if :#1:\def\:temp##1|<par del|>{}\else
      \def\:temp{#1}\ifx \@currname\:temp
             \def\:temp##1|<par del|>{\input usepackage.4ht  }%
      \else \let\:temp=\use:package \fi
   \fi \:temp}
|<add to usepackage|>
>>>

\<problem due to hyperref?\><<<
\def\:temp#1htex4ht.def,tex4ht.sty#2|<par del|>{\def\:temp{#2}}
\expandafter\:temp \@filelist htex4ht.def,tex4ht.sty|<par del|>%
\ifx \:temp\empty  \else
   \:warning{if 
    \string\RequirePackage[tex4ht]{hyperref} or
    \string\usepackage[tex4ht]{hyperref} was 
    used try instead, repectively,
    \string\RequirePackage{hyperref} or
    \string\usepackage{hyperref}}
\fi
>>>

%%%%%%%%%%%%%%%%%
\Part{latex.ltx}
%%%%%%%%%%%%%%%%

\Link[/usr/local/teTeX/share/texmf/tex/latex/base/latex.ltx]{}{}latex.ltx\EndLink,

\Link[http://ctan.org/tex-archive/macros/latex/base/]{}{}latex
source components\EndLink

\def\1.#1.{\Link[http://ctan.org/tex-archive/macros/latex/base/#1.dtx]{}{}#1\EndLink}

\<latex.4ht\><<<
% latex.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
|<exit if already loaded|>
|<early latex definitions|>
|<latex changes for tex4ht.sty|>
|<plain,latex utilities|>
|<latex ltclass|>     |%|1.ltclass.|%
                      |%|1.ltdirchk.|%  
|<latex ltplain|>     |%|1.ltplain.|%
                      |%|1.ltvers.|% 
                      |%|1.ltdefns.|%
                      |%|1.ltalloc.|%
                      |%|1.ltcntrl.|%
                      |%|1.lterror.|%
                      |%|1.ltpar.|%
|<latex ltspace|>     |%|1.ltspace.|% 
                      |%|1.ltlogos.|%
                      |%|1.ltfiles.|%
|<latex ltoutenc|>    |%|1.ltoutenc.|%
|<latex ltcounts|>    |%|1.ltcounts.|%
|<latex ltlength|>    |%|1.ltlength.|%
                      |%|1.ltfssbas.|%
|<latex ltfsstrc|>    |%|1.ltfsstrc.|%
                      |%|1.ltfsscmp.|%
|<latex ltfssdcl|>    |%|1.ltfssdcl.|%
                      |%|1.ltfssini.|%
                      |%|1.ltfntcmd.|%
                      |%|1.ltpageno.|%
|<latex ltxref|>      |%|1.ltxref.|%
|<latex ltmiscen|>    |%|1.ltmiscen.|%  
|<latex ltmath|>      |%|1.ltmath.|%
|<latex ltlists|>     |%|1.ltlists.|% 
|<latex ltboxes|>     |%|1.ltboxes.|% 
|<latex lttab|>       |%|1.lttab.|% 
|<latex ltpictur|>    |%|1.oltpictur.|% 
|<latex ltthm|>       |%|1.ltthm.|%
|<latex ltsect|>      |%|1.ltsect.|%
|<latex ltfloat|>     |%|1.ltfloat.|%
|<latex ltidxglo|>    |%|1.ltidxglo.|%
|<latex ltbibl|>      |%|1.ltbibl.|%
|<latex ltpage|>      |%|1.ltpage.|%
|<latex ltoutput|>    |%|1.ltoutput.|%
|<latex ltfinal|>     |%|1.ltfinal.|%
|<non classified latex|>
|<html /addcontentsline|>

\let\:MClass:|=\c:MathClass:
\NewConfigure{MathClass}[5]{\bgroup 
   \let\@nodocument|=\empty
   \let\normalcolor|=\relax
   \:MClass:{#1}{#2}{#3}{#4}{#5}\egroup}

\let\:MDelims:|=\c:MathDelimiters:
\NewConfigure{MathDelimiters}[2]{\bgroup 
   \let\@nodocument|=\empty
   \let\normalcolor|=\relax
   \:MDelims:{#1}{#2}\egroup}

\Hinput{latex}
\endinput
>>>        \AddFile{1}{latex}

\<latex ltfsstrc\><<<
\edef\:temp{%
  \every@math@size={\noexpand\ifx \noexpand\EndPicture\noexpand\:UnDef
      \noexpand\else \the\every@math@size \noexpand\fi}%
}
\:temp
>>>

\<exit if already loaded\><<<
\ifx\SaveMkHalignConf:g\:UnDef \else \expandafter\endinput\fi
>>>

 Latex prohibits content before the \`'\begin{document}' by putting
\`'\ht:everypar{\@nodocument}' before
\`'\begin{document}' to  get an error if text appears before the
beginning.  A possible solution is to put sensitive stuff
in, for instance,  \`'{ \let\@nodocument=\empty ...}'.

It is unsafe to define \''\romannumeral' because it is used
within immediate definition \''\edef', as well as definitions of macro
names \''\csname ...\romannumeral ...\endcsname'. Consider also
\''\Configure{enumerate}' (e.g.,
\HPage{paralist}
\Verbatim
\documentclass[a4paper]{article}
\usepackage{amssymb}
\usepackage{amsmath}

\setcounter{MaxMatrixCols}{10}

% \RequirePackage[nocfg]{paralist}% avoid locals
% \setdefaultenum{a.}{(i)}{A.}{I.}

\begin{document}

\title{Test}
\date
\author{C. Fierro}

Default list:
\begin{enumerate}
\item \label{7-a}$x \underset{\text{(\ref{7-i})}}{\leq }y$
\item \label{7-b} $a\underset{\text{(\ref{7-ii})}}{\geq }b$
\end{enumerate}

Custom list:
\begin{enumerate}%[\itshape (i)]{}
\item \label{7-i}$y\underset{\text{(\ref{7-a})}}{\geq }x$,
\item \label{7-ii}$b \underset{\text{(\ref{7-b})}}{\leq }a$
\end{enumerate}

\end{document}
\EndVerbatim
\EndHPage{})

\<latex ltcounts\><<<
\:CheckOption{enum}\if:Option 
   \def\:temp#1{\a:romannumeral {\expandafter
      \:slowroman\romannumeral #1@}\b:romannumeral}
   \HLet\@roman=\:temp
   \def\:temp#1{\a:romannumeral {\expandafter
      \:Slowroman\romannumeral #1@}\b:romannumeral}
   \HLet\@Roman=\:temp
\item
   :warning{To configure roman numbers use
                       the option 'enum' (unsafe)}
\fi
\NewConfigure{romannumeral}{2}
>>>

\<latex ltcounts\><<<
\def\:Slowroman#1{\ifx @#1\else |%\@slowromancap|%
  \if i#1\I:rnum\else
  \if v#1\V:rnum\else
  \if x#1\X:rnum\else
  \if l#1\L:rnum\else
  \if c#1\C:rnum\else
  \if d#1\D:rnum\else
  \if m#1\M:rnum\else
  #1\fi\fi\fi\fi\fi\fi\fi\expandafter\:Slowroman\fi
}
\NewConfigure{Roman}[7]{%
   \def\I:rnum{#1}\def\V:rnum{#2}\def\X:rnum{#3}\def\L:rnum{#4}%
   \def\C:rnum{#5}\def\D:rnum{#6}\def\M:rnum{#7}}
\Configure{Roman}{I}{V}{X}{L}{C}{D}{M}
>>>

\<latex ltcounts\><<<
\def\:slowroman#1{\ifx @#1\else
  \if i#1\i:rnum\else
  \if v#1\v:rnum\else
  \if x#1\x:rnum\else
  \if l#1\l:rnum\else
  \if c#1\c:rnum\else
  \if d#1\d:rnum\else
  \if m#1\m:rnum\else
  #1\fi\fi\fi\fi\fi\fi\fi\expandafter\:slowroman\fi
}
\NewConfigure{roman}[7]{%
   \def\i:rnum{#1}\def\v:rnum{#2}\def\x:rnum{#3}\def\l:rnum{#4}%
   \def\c:rnum{#5}\def\d:rnum{#6}\def\m:rnum{#7}}
\Configure{roman}{i}{v}{x}{l}{c}{d}{m}
>>>

\Chapter{Classes and Packages}

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltdirchk.dtx]{}{}ltdirchk.dtx\EndLink

An option \`'no_#1' asks not to load the style file \`'#1.4ht'.

\<latex ltclass\><<<
\ifx \@ifpackageloaded\:UnDef  
   \long\def\@ifpackageloaded#1#2#3{}
\fi
\def\:ifpackageloaded#1#2#3{%
   \:CheckOption{no_#1}\if:Option \:Optionfalse
   \else \@ifpackageloaded{#1}{#2}{#3}\fi}
>>>

\<NO\><<<
\def\:ifclassloaded#1#2#3{%
   \:CheckOption{no_#1}\if:Option \:Optionfalse
   \else \@ifclassloaded{#1}{#2}{#3}\fi}
\def\:iffileloaded#1#2#3{%
   \:CheckOption{no_#1}\if:Option \:Optionfalse 
   \else |<search in filelist|> \expandafter \:tempa\fi }
>>>

\<search in filelistNO\><<< 
\def\:temp{#1}\expandafter
   \:iffil\@filelist,,|<par del|>%
   \ifx \:tempa\:temp \def\:tempa{#2}\else \def\:tempa{#3}\fi 
>>>

\<latex ltclass\><<<
\def\:iffil#1,#2|<par del|>{\def\:tempa{#1}\ifx \:temp\:tempa
      \let\:tempb=\empty 
   \else
      \ifx \:tempa\empty       \let\:tempb=\empty 
      \else \def\:tempb{\:iffil#2|<par del|>}\fi
   \fi \:tempb}
>>>

We need the follwoing for definition of fonts that are introduced late, e.e., 

\Verbatim
\documentclass{amsart}
  \usepackage{textcomp}
  \usepackage{amssymb}
\begin{document}

\csname Configure\endcsname{mathfrak}{[[[[}{]]]}
\csname Configure\endcsname{mathbb}{[[[[}{]]]}

$\mathfrak{A}a^{\mathfrak{A}}$
\end{document}
\EndVerbatim

\<latex ltfssdcl\><<<
\let\document:select:group\document@select@group
\def\document@select@group#1#2#3#4{%
  \ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi 
  {%
      \document:select:group{#1}{#2}{#3}{}%
      \expandafter\ifx \csname n:\expandafter
                      \:gobble\string#1:\endcsname\relax\else
      \expandafter\let\csname o:\expandafter\:gobble
                                  \string#1:\endcsname\:UnDef
      \expandafter\HLet\expandafter#1\csname
              n:\expandafter\:gobble\string#1:\endcsname
      \expand:after{\global\expandafter\let
         \csname o:\expandafter\:gobble\string#1:\endcsname}%
         \csname o:\expandafter\:gobble\string#1:\endcsname
      \global\let#1=#1%
   \fi
   #1{#4}%
}}
>>>

%%%%%%%%%%%%%%%%%%
\Section{titlesec}

\<titlesec.4ht\><<<
% titlesec.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2000. Eitan M. Gurari
|<TeX4ht copywrite|>
\ifx \ttl@assign@ii\:Undef 
   \ifx \ttl@sect\:UnDef\else
     |<titlesec pre 2.3.5|>
   \fi
   \ifx \ttl@useclass\:UnDef\else
     |<titlesec since 2.3.5|>
   \fi
   |<shared titlesec|>
\else
   |<titlesec 2005|>
\fi
\Hinput{titlesec}
\endinput
>>>                        \AddFile{9}{titlesec}

\<titlesec since 2.3.5\><<<
\pend:defII\ttl@useclass{%
  \@ifstar {}{\SkipRefstepAnchor}}
\let\ttl:select|=\ttl@select
\def\ttl@select#1{%
  \edef\sc:tp{\ifttl@label\else like\fi 
             #1}\def\c:secnumdepth{\@nameuse{ttll@#1}}%
  \ttl:select{#1}}
\let\ttl@write|=\:gobbleII
\let\ttl@glcmds\relax
\let\ttl@beginlongest\@empty
\let\ttl@midlongest\@empty
\let\ttl@endlongest\@empty
>>>

\<titlesec pre 2.3.5\><<<
\pend:defII\ttl@sect{%
  \@ifstar {}{\SkipRefstepAnchor}}
\let\ttl:select=\ttl@select
\def\ttl@select#1#2#3#4#5{%
  \edef\sc:tp{\ifttl@label\else like\fi #1}\def\c:secnumdepth{#5}%
  \ttl:select{#1}{#2}{#3}{#4}{#5}}
\let\ttl@write|=\:gobbleIII
>>>

\<shared titlesec\><<<
\let\ttlh:hang|=\ttlh@hang
\def\ttlh@hang#1#2#3#4#5#6#7#8{%
   \HtmlEnv  
   \expandafter\def\csname thetitle\sc:tp\endcsname{#2}%
   \csname no:\sc:tp\endcsname{#8}%
   \par \ttlh:hang{}{}{#3}{}{}{#6}{#7}{}}
>>>

\<shared titlesec\><<<
\let\:seccntformat=\@seccntformat
\def\@seccntformat#1{\ifnum 0=0\the\csname c@#1\endcsname\else
   \:seccntformat{#1}\fi}
>>>


\<titlesec 2005\><<<
\let\ttl:straight@i\ttl@straight@i
\def\ttl@straight@i#1[#2]#3{%
  |<titlesec for nameref|>%
  \ifttl@label \else 
     |<skip extra sec and subsec toc|>%
  \fi
  \edef\sc:tp{\ifttl@label\else like\fi #1}%
  \ttl:straight@i{#1}[{#2}]{#3}%
}
\def\ttlh@hang#1#2#3#4#5#6#7#8{%
   \def\c:secnumdepth{\@nameuse{ttll@\sc:tp}}%
   \:StartSec {\sc:tp}{%
         \ifttl@label \ifnum \c:secnumdepth >\c@secnumdepth 
         \else \csname the\sc:tp\endcsname \fi \fi
       }{#8}%
}
\def\:tempc#1#2#3#4{%
  \begingroup
  \let\everypar\@gobble% don't let titlesec to break our paragraph handling
  \edef\sc:tp{\ifttl@label\else like\fi #1}%
   \let\ttl@savewrite\empty
   \o:ttl@select:{#1}{#2}{#3}{#4}
   \endgroup
}

\HLet\ttl@select\:tempc
>>>

% runin and display formats ruin tex4ht section patching
% letting them to the \ttl@hang format seems to fix that
% https://tex.stackexchange.com/q/451077/2891
\<titlesec 2005\><<<
\let\ttlh@runin\ttlh@hang
\let\ttlh@display\ttlh@hang
>>>

\<skip extra sec and subsec toc\><<<
\def\:temp{#1}\edef\:tempa{\expandafter
    \expandafter\expandafter\:gobble
    \expandafter\string\csname section\endcsname}\ifx \:temp\:tempa \else
       |<skip extra subsec toc|>%
\fi
>>>

\<skip extra subsec toc\><<<
\edef\:tempa{\expandafter\expandafter\expandafter\:gobble 
  \expandafter\string\csname subsection\endcsname}\ifx \:temp\:tempa \else
     {\ttl@labeltrue \ttl@addcontentsline{like#1}{#3}}% 
\fi
>>>

\<titlesec for nameref\><<<
\gdef\NR:Title{\a:newlabel{#3}}%
>>>

% \def\ttlh@display#1#2#3#4#5#6#7#8{{[111]#1\ifttl@label #2\fi #4{#8}[/111]}}
% \def\ttlh@runin#1#2#3#4#5#6#7#8{{[333]#1\ifttl@label #2\fi #4{#8}[/333]}}  

TeX4ht handles stuff written to TOC itself, Titlesec caused duplicated entries in TOC,
so we just disable it's TOC handling.

\<titlesec 2005\><<<
\def\ttl@addcontentsline#1#2{\nobreak}
>>>

I've found that it is probably best to save definitions of sectioning commands before Titlesec
is loaded, and then load the saved versions back to the original commands. 

\<add to usepackage\><<<
\Configure{PackageHooks}{titlesec.sty}{titlesec-hooks.4ht}
>>>

\<titlesec-hooks.4ht\><<<
% titlesec-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022-2023 TeX Users Group
|<TeX4ht license text|>
|<titlesec-packagehooks|>
\endinput
>>> \AddFile{9}{titlesec-hooks}

\<titlesec-packagehooks\><<<
\let\ttl:@makechapterhead\@makechapterhead
\let\ttl:@makeschapterhead\@makeschapterhead
\let\ttl:chapter\chapter
\let\ttl:section\section
\let\ttl:subsection\subsection
\let\ttl:subsubsection\subsubsection
\let\ttl:paragraph\paragraph
\let\ttl:subparagraph\subparagraph
\:AtEndOfPackage{
  \let\chapter\ttl:chapter
  \let\section\ttl:section
  \let\subsection\ttl:subsection
  \let\subsubsection\ttl:subsubsection
  \let\paragraph\ttl:paragraph
  \let\subparagraph\ttl:subparagraph
  \let\@makechapterhead\ttl:@makechapterhead
  \let\@makeschapterhead\ttl:@makeschapterhead
  |<disable titlesec format|>
}
>>>

Titlesec formatting can cause various issues, 
so it is best to disable it completely.

\<disable titlesec format\><<<
\def\ttl@format@si#1#2#3#4#5#6#7{}
\def\ttl@format@ii#1[#2]#3#4#5#6{
  \@ifnextchar[{%
    \ttl@format@iii{#2}%
  }{%
  \ttl@format@iii{#2}[]}
}
\def\ttl@format@iii#1[#2]{}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Scientific Word}

\Link[ftp://ftp.mackichan.com/]{}{}mackichan\EndLink,
\Link[http://cutter.ship.edu/\string
       ~ensley/tci/]{}{}tci\EndLink

\<tcilatex.4ht\><<<
% tcilatex.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2000. Eitan M. Gurari
|<TeX4ht copywrite|>
|<shared tcilatex|>
\expandafter\ifx \csname @TCItagstar\endcsname\relax 
   |<tcilatex 2.5|>
\else 
   |<tcilatex 3.5|>
   \ifx \@msidraft\:Undef 
      |<tcilatex 3.5 not 4.0|>
\fi \fi
|<undo swpframe|>
\Hinput{tcilatex}
\endinput
>>>                        \AddFile{2}{tcilatex}

\<undo swpframe\><<<
\let\tci:ProvidesPackage=\ProvidesPackage
\def\ProvidesPackage#1{%
   \tci:ProvidesPackage{#1}%
   \def\:temp{swpframe}\def\:tempa{#1}\ifx \:temp\:tempa
      \ifx \GRAPHICSHP\:UnDef\else
         \let\swp:GRAPHICSHP=\GRAPHICSHP
         \:AtEndOfPackage{\let\GRAPHICSHP\swp:GRAPHICSHP}%
      \fi
      \ifx \graffile\:UnDef\else
         \let\swp:graffile=\graffile
         \:AtEndOfPackage{\let\graffile\swp:graffile}%
      \fi
      \ifx \GRAPHIC\:UnDef\else
         \let\swp:GRAPHIC=\GRAPHIC
         \:AtEndOfPackage{\let\GRAPHIC\swp:GRAPHIC}%
      \fi
  \fi
}
>>>

%       \ifx \BOXEDSPECIAL\:UnDef\else
%          \let\swp:BOXEDSPECIAL=\BOXEDSPECIAL
%          \AtEndOfPackage{\let\BOXEDSPECIAL\swp:BOXEDSPECIAL}%
%       \fi
% 
% 

The \`'\protect' in \`'\section{The second Section
  \protect\label{two}}' is problematic because of double labels when
the toc is on.  The problem can be solved with the code.

\<tcilatex post 3.5--Not Needed anymore\><<<
\def\label:gobble{\futurelet\:temp\lbl:gobble}
\def\lbl:gobble#1{\ifx\:temp\relax \expandafter\label:gobble\fi}
\AtBeginDocument{\immediate\write\:tocout{%
   \let\string\label \string\label:gobble }}
>>>

\<shared tcilatex\><<<
\def\:temp#1#2#3#4{#2\ref{#4}#3}
\ifx \:temp\hyperref
   \def\hyperref{\bgroup
        \catcode`\#=12 \catcode`\~=12 \catcode`\_=12 \h:pref}%
   \def\h:pref#1#2#3#4{\egroup\Link[#4]{}{}#1\EndLink}%
\fi
>>>

In version 4 \''\hyperref' is aliased to \''\x@hyperref'.

\<tcilatex 3.5\><<<
\def\y@hyperref#1#2#3#4{%
   \Link[#4]{}{}#1\EndLink
   \catcode`\~ = 13 
   \catcode`\$ = 3 
   \catcode`\_ = 8 
   \catcode`\# = 6 
   \catcode`\& = 4
}
>>>

\<shared tcilatex\><<<
\let\:tempc=\GRAPHICSPS
\pend:defI\:tempc{\a:GRAPHICSPS}
\append:defI\:tempc{\b:GRAPHICSPS}
\HLet\GRAPHICSPS=\:tempc
\NewConfigure{GRAPHICSPS}{2}
>>>

\<shared tcilatex\><<<
\let\:tempc=\GRAPHICSHP
\pend:defI\:tempc{\a:GRAPHICSHP}
\append:defI\:tempc{\b:GRAPHICSHP}
\HLet\GRAPHICSHP=\:tempc
\NewConfigure{GRAPHICSHP}{2}
>>>

\<shared tcilatex\><<<
\let\:tempc=\BOXTHEFRAME
\pend:defI\:tempc{\hbox\bgroup\a:BOXTHEFRAME}
\append:defI\:tempc{\b:BOXTHEFRAME\egroup}
\HLet\BOXTHEFRAME=\:tempc
\NewConfigure{BOXTHEFRAME}{2}
\let\:IFRAME=\IFRAME
\let\:DFRAME=\DFRAME
\let\:FFRAME=\FFRAME
\def\IFRAME#1#2#3#4#5#6{\a:IFRAME\leavevmode
   \IgnorePar\:IFRAME{#1}{#2}{#3}{#4}{#5}{#6}\b:IFRAME}
\def\DFRAME#1#2#3#4#5{\a:DFRAME\leavevmode
   \IgnorePar\:DFRAME{#1}{#2}{#3}{#4}{#5}\b:DFRAME}
\def\FFRAME#1#2#3#4#5#6#7#8{\a:FFRAME\leavevmode
   \IgnorePar\:FFRAME{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}\b:FFRAME}
\NewConfigure{IFRAME}{2}
\NewConfigure{DFRAME}{2}
\NewConfigure{FFRAME}{2}
>>>

%  \def\mailto{\bgroup \catcode`\#=12 \catcode`\~=12 \catcode`\_=12 \mlto}%
%  \def\mlto#1{\egroup \Link[mailto:#1]{}{}\texttt{#1}\EndLink}%

\<tcilatex 3.5\><<<
\def\:tempc#1#2{\o:QATOP:{\a:QATOP #1\b:QATOP}{\c:QATOP #2\d:QATOP}}
\HLet\QATOP=\:tempc
\NewConfigure{QATOP}{4}
\def\:tempc#1#2{\o:QDATOP:{\a:QDATOP #1\b:QDATOP}{\c:QDATOP #2\d:QDATOP}}
\HLet\QDATOP=\:tempc
\NewConfigure{QDATOP}{4}
\def\:tempc#1#2{\o:QTATOP:{\a:QTATOP #1\b:QTATOP}{\c:QTATOP #2\d:QTATOP}}
\HLet\QTATOP=\:tempc
\NewConfigure{QTATOP}{4}
>>>

\<tcilatex 3.5 not 4.0\><<<
\expandafter\ifx \csname o:dfrac:\endcsname \relax
  |<tcilatex fractions|>
\fi
>>>

The following protection, e.g., for titles of sections.

\<shared tcilatex\><<<
\let\o:Greekmath:|=\Greekmath
\def\Greekmath{\protect\o:Greekmath:}
>>>

\<seslideb.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% seslideb.4ht                         |version %
% Copyright (C) |CopyYear.2001.      Eitan M. Gurari         %
|<TeX4ht copyright|>
|<seslideb code|>
\Hinput{seslideb}
\endinput
>>>                        \AddFile{7}{seslideb}

\<seslideb code\><<<
\NewSection\swSlide{}{}
\def\PageBreak{\swSlide{\swTitle}}
\let\swTitle|=\relax
>>>

\<jeep.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% jeep.4ht                             |version %
% Copyright (C) |CopyYear.2002.      Eitan M. Gurari         %
|<TeX4ht copyright|>
|<jeep code|>
\Hinput{jeep}
\endinput
>>>                        \AddFile{9}{jeep}

\<jeep code\><<<
\let\jeep:@sect|=\no@sect
\def\no@sect#1#2#3#4#5{%
   \jeep:@sect{#1}{#2}{#3}{#4}{#5\let\@svsec=\empty}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Common to Plain and LaTeX-Plain}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltplain.dtx]{}{}ltplain.dtx\EndLink

\<latex ltplain\><<<
|<plain,ltplain obeylines,oalign|>
|<ltplain percent|>
>>>

plain.tex and latex.

The following is assumed to be within a group.

\<plain,ltplain obeylines,oalign\><<<
\def\:temp{\o:obeylines:  
   \let\obeylines|=\o:obeylines:
   \a:obyln \global\let\x:obln|=\end:obeylines \aftergroup\x:obln 
   \def\:temp{%
      \ifx\:tempa\par \ht:everypar{\ht:everypar{\b:obyln}}%
      \else \ht:everypar{\b:obyln}\fi}%
   \futurelet\:tempa\:temp }
\HLet\obeylines|=\:temp
\NewConfigure{obeylines}[3]{\c:def\a:obyln{#1}\c:def\b:obyln{#3}%
   \c:def\end:obeylines{#2}}
>>>

\ifHtml[\HPage{more}\Verbatim
xxxxxxxxxxxxxxxxxxxxx

{\obeylines neither do
things too high for me.}

xxxxxxxxxxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxx
{\obeylines neither do
things too high for me.}
xxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxxxx
{\obeylines neither do
things too high for me.}

xxxxxxxxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxx
    <P >neither do
    <P >things too high for me.
    <P >xxxxxxxxxxxxxxxxxxxxxxxxxxxx
    <P >xxxxxxxxxxxxxxxxxxxxx neither do
    <P >things too high for me. xxxxxxxxxxxx
    <P >xxxxxxxxxxxxxxxxxxxxxxx neither do
    <P >things too high for me.
    <P >xxxxxxxxxxxxxxxxxxxxxxxxxx

\EndVerbatim\EndHPage{}]\fi



The \''\%' command needs to be redefined for TeX4ht source files,
but this redefinition causes compilation errors when it is used in
titles or captions. So we redefine it to the original LaTeX
definition. We can detect if we are in the literate sources by checking 
if the \''\MAKETITLE' command is defined.

See \Link[https://tex.stackexchange.com/q/652848/2891]{}{}
this question on TeX.sx for more details\EndLink.

\<ltplain percent\><<<
\ifdefined\MAKETITLE\else
\chardef\%=`\%
\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{ltspace (Horizontal Spaces)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltspace.dtx]{}{}ltspace.dtx\EndLink

\<latex ltspace\><<<
\NewConfigure{hspace}{3}
\Configure{hspace}{}{}{ }
\def\:temp#1{\tmp:dim|=#1\relax
   \a:hspace \hsp:c\hskip #1\relax\b:hspace}
\HLet\@hspace|=\:temp
\def\:temp#1{\tmp:dim|=#1\relax 
   \a:hspace \hsp:c\vrule \@width\z@\nobreak
   \hskip #1\hskip \z@skip\b:hspace}
\HLet\@hspacer|=\:temp
\def\hsp:c{\ifdim \tmp:dim<1em\else\c:hspace\fi
   \ifdim \tmp:dim<2em\else\c:hspace\fi
   \ifdim \tmp:dim<3em\else\c:hspace\fi
   \ifdim \tmp:dim<4em\else\c:hspace\fi
   \ifdim \tmp:dim<5em\else\c:hspace\fi}
>>>

We need  the assignment to \''\tmp:dim'  because of commands like
\''\hspace{0.25em plus 0.125em minus 0.08em}'.

\<latex ltspace\><<<
\let\:tempc\@vspace
\append:defI\:tempc{\a:vspace{#1}}
\HLet\@vspace\:tempc
\let\:tempc\@vspacer
\append:defI\:tempc{\a:vspace{#1}}
\HLet\@vspacer\:tempc
\NewConfigure{vspace}[1]{\def\a:vspace##1{#1}}
\Configure{vspace}{}
>>>

%%%%%%%%%%%%%%%%%%
\Chapter{ltlength}
%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltlength.dtx]{}{}ltlength.dtx\EndLink

%
%>>>

The commands \''\settoheight', \''\settodepth', and \''\settowidth'
invoke \''\setbox' without producing output. To avoid fake pictures,
we do the following.

\<latex ltlength\><<<
\let\:settodim|=\@settodim
\def\@settodim#1#2#3{\PictureOff \:settodim#1{#2}{#3}\PictureOn}
>>>

%%%%%%%%%%%%%
\Chapter{Cross References}
%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltxref.dtx]{}{}ltxref.dtx\EndLink

%%%%%%%%%%%%%
\Section{LaTeX}
%%%%%%%%%%%%%

\<latex ltxref\><<<
|<no lbl index|>
|<cross ref|>
>>>

%%%%%%%%%%%%%
\SubSection{Index Labels}
%%%%%%%%%%%%%

Try to delete, or at least contain, \''\no:lbl:idx'.

\<no lbl index\><<<
\def\no:lnk#1#2#3\EndLink{#3}
\let\:ref|=\ref
\let\:index|=\index
\def\no:lbl:idx{\let\label|=\@gobble }
\def\toc:lbl:idx{\a:NoSection}
>>>

%%%%%%%%%%%%%
\SubSection{ref, label, newlabel: Usage}
%%%%%%%%%%%%%

\<cross ref\><<<
\def\:tempc#1{\a:pageref\o:pageref:{#1}\b:pageref}
\HLet\pageref\:tempc
\NewConfigure{pageref}[3]{%
   \def\a:pageref{#1\bgroup \Configure{ref}{\Link}{\EndLink}{#3}}%
   \def\b:pageref{\egroup #2}%
}
\Configure{pageref}{}{}{}
>>>

\<cross ref\><<<
\NewConfigure{@newlabel}[1]{\concat:config\a:@newlabel{#1}}
\let\a:@newlabel|=\relax
|<configure @newlabel|>
\NewConfigure{newlabel}[2]{%
   \def\a:newlabel{#1}\ifx  \a:newlabel\empty
      \def\label:addr{\cur:th \:currentlabel}%
   \else
      \def\label:addr{#1}%
   \fi
   \def\a:newlabel##1{\expandafter\string\c:rEfLiNK{\label:addr}{#2}}}
\NewConfigure{ref}[3]{%
   \def\a:rEfLiNK{#1}\def\b:rEfLiNK{#3}%
   \ifx \a:rEfLiNK\empty 
      \ifx \b:rEfLiNK\empty
         \expandafter\def\c:rEfLiNK##1##2{##2}%
      \else
         \expandafter\def\c:rEfLiNK##1##2{#3}%
      \fi
   \else 
      \ifx \b:rEfLiNK\empty
         \expandafter\def\c:rEfLiNK##1##2{#1{##1}{}##2#2}%
      \else
         \expandafter\def\c:rEfLiNK##1##2{#1{##1}{}#3#2}%
      \fi
   \fi
   \def\b:rEfLiNK{#2}%
}
\Configure{newlabel}{\cur:th \:currentlabel}{#1}
\NewConfigure{newlabel-ref}[1]{\def\c:rEfLiNK{#1}%
   \ifx \at:startdoc\:UnDef \dflt:ref{#1}\else
      \pend:def\at:startdoc{\dflt:ref{#1}}\fi
}
\def\dflt:ref#1{\if@filesw\immediate\write\@auxout{\string\ifx
    \string#1\string\UnDef\gdef\string#1\#1\#2{\#2}\string\fi}\fi}
\Configure{newlabel-ref}{\rEfLiNK}
\let\:writefile|=\@writefile
\def\@writefile#1{\bgroup \catcode`\:|=11 \:wrtfile{#1}}
\def\:wrtfile#1#2{\egroup\:writefile{#1}{#2}}
>>>

\List{*}
\item
\`'\Configure{ref}{\Link}{\EndLink}{anchor}' tells what \''\Link'-type command
should be on insertions of \''\ref'.  If the third parameter is empty,
the anchor is the one provided by the system. If the first parameter
is empty, no Link is assumed.

\item
\''\Configure{newlabel}{\cur:th \:currentlabel}{#1}' supplies the
target address and the anchor.  
\item
\''\Configure{newlabel}{}{#1}' 
is equivalent to
\''\Configure{newlabel}{\cur:th \:currentlabel}{#1}' 
\item
The
\''\Configure{newlabel-ref}{\rEfLiNK}' command provides an
intermediate link command for the aux command, which
\`'\Configure{ref}{\Link}{\EndLink}{anchor}' configures.   If the first
field of the  last configuration command is empty, than the anchor is
provided without its surrounding. 
\EndList

\Verbatim

 > One more thing.  You will notice from `minitoc.tex' that the HTML
 > anchors given to the sections depend on the value of \@currentlabel,
 > be it set explicitely or implicitly (e.g., by the previous section).
 > Is it what you want ?

Yes.  I believe the reason was to avoid ambiguities--unfortunately,
I can't locate now where they could occur.

{\makeatletter \gdef\@currentlabel{XxX}}
\section*{first section/First chapter}
\section{second section/First chapter}
\section*{third section/First chapter}

\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{ref, label, newlabel: Hooking into Label}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<cross ref\><<<
\let\:label|=\label
\def\label{\relax
   \expandafter\ifx \csname cur:th\endcsname\relax \expandafter\:label
   \else \expandafter\l:bel \fi}
\let\lb:l|=\label
\def\l:bel#1{\@bsphack\if@filesw {\let\thepage|=\relax
   |<control @|>%
   \let\protect|=\@unexpandable@protect \cur:lbl{}%
   \ifx \EndPicture\:UnDef
      \ifx \cur:th\skip:anchor
         |<if-label anchors|>%
      \else \ifx \:currentlabel\empty
         |<pre section anchor|>%
      \fi \fi
   \else
      |<anchors for pictures|>%
   \fi
   \a:@newlabel
   \edef\@tempa{\write\@auxout{\string
      \newlabel{#1}{{|<logical label|>}%
                    {|<page label|>}|<hyperref label|>}}}%
   \expandafter}\@tempa
   \if@nobreak \ifvmode\nobreak\fi\fi\fi
   |<cancel if-label anchors|>%
   \@esphack}
|<sub/sup in labels/refs|>
>>>

\<configure @newlabel\><<<
\Configure{@newlabel}{\def\%{\string\%}}
>>>

We had before \`'\ifx \EndPicture\:UnDef...\else...\fi' embeded within
\`'\ifx \cur:th\skip:anchor' but that eliminated the anchors for
eqnarray of pictures.

To save memory, we try to get anchors only when refered by labels.
For instance, this is the case for \''\@thm'.

\<if-label anchors\><<<
\bgroup   \a:@newlabel
   \Make:Label{\label:addr}{}\egroup
>>>

\<cancel if-label anchors\><<<
\let\skip:anchor|=\:UnDef
>>>

The following deals with labels \''\label' provided before sectioning commands.

\<pre section anchor\><<<
\def\:currentlabel{doc}%
|<if-label anchors|>%
>>>
         

\<replace AutoRefstepAnchor\><<<
\def\AutoRefstepAnchor{\SkipRefstepAnchor}
>>>

The following is to ensure anchors for labels in pictures.

\<anchors for pictures\><<<
\begingroup
   \a:@newlabel
   \edef\:temp{\noexpand\AfterPicture{%
       \noexpand\Make:Label{\label:addr}{}%
       \noexpand\uno:lbl{\label:addr}}%
   }\:temp
\endgroup
>>>

The following is to avoid eliminated anchors as is the case in, for instance, \`'\[xx\label{a}\label{b}\] '.

\<cross ref\><<<
\def\uno:lbl#1{\def\:temp{#1}\futurelet\:tempa\I:lbl}
\def\I:lbl{\ifx \:tempa\Make:Label \expandafter\no:mklbl \fi}
\def\no:mklbl#1#2#3{\def\:tempa{#2}\ifx \:temp\:tempa \else
   \Make:Label{#2}{#3}\fi}
>>>

\<logical label\><<<
\a:newlabel\@currentlabel
>>>

The anchor for the page is approximated to the anchor of the logical unit.
This is so to solve the possible problem of having a \`'label' in a position
where \`'<A>' links are not allowed. 

\<page label\><<<
\a:newlabel\thepage
>>>

\<cross ref\><<<
\let\:currentlabel|=\empty
>>>

In pure latex, \''\Configure{newlabel}{##1}'.

The following is treated in a similar manner to cite.
It provides the means to disable nested links in
entries of tocs. The \''\Link' doesn't seem to need
the \''[]' option there, so a \''\:gobbleII' can do the job.

A better def is given to \''\l:bel' in AmsLaTeX .

\<sub/sup in labels/refs\><<<
\let\l:bel:|=\l:bel
\def\l::bel#1{{\:SUBOff\:SUPOff\xdef\:temp{\noexpand\l:bel:{#1}}}\:temp}
\def\l:bel{\Protect\l::bel}
\let\o:ref|=\:ref
\def\::ref#1{{\:SUBOff\:SUPOff\xdef\RefArg{#1}}\expandafter\o:ref
                                               \expandafter{\RefArg}}
\ExplSyntaxOn
\def\::ref#1{{\:SUBOff\:SUPOff\xdef\RefArg{#1}%
  \SUBOn\SUPOn%
  \def\rEfLiNK##1##2{\Link{##1}{}\tl_rescan:nn{}{##2}\EndLink}%
  \expandafter\o:ref\expandafter{\RefArg}%
}}
\ExplSyntaxOff
\DeclareDocumentCommand\:ref{s}{\IfBooleanTF{#1}{\Protect\::ref}{\Protect\::ref}}
\let\ref|=\:ref
>>>


Support for the \''\Ref' command. It is variant of \''\ref' that uppercases
first letter of the referenced label.

\<sub/sup in labels/refs\><<<
\ExplSyntaxOn
\def\::Ref#1{{%
  \:SUBOff\:SUPOff\xdef\RefArg{#1}%
  \SUBOn\SUPOn%
  \def\rEfLiNK##1##2{\tl_set_rescan:Nnn\l_tmpa_tl{}{##2}\Link{##1}{}\expandafter\MakeUppercase\l_tmpa_tl\EndLink}%
  \expandafter\o:ref\expandafter{\RefArg}%
}}
\ExplSyntaxOff
\DeclareDocumentCommand\:Ref{s}{\IfBooleanTF{#1}{\Protect\::Ref}{\Protect\::Ref}}
\let\Ref\:Ref
>>>


Without the \'''\expandafter' we may get \''\RefArg' passed
 as the first argument to \''\T@arg',
resulting in \''\def\RefArg{\RefArg}'.

\<sub/sup in labels/refs\><<<
\let\:newl@bel|=\@newl@bel
\let\n:wlbl|=\@newl@bel
\def\@newl@bel#1#2{{\:SUBOff\:SUPOff
   \xdef\:temp{\noexpand\n:wlbl{#1}{#2}}}\:temp}
>>>

\<sub/sup in labels/refs\><<<
\let\:testdef|=\@testdef
\def\@testdef #1#2{{\:SUBOff\:SUPOff
   \xdef\:temp{\noexpand\:testdef{#1}{#2}}}\:temp}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{@currentlabel}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The second parameter of \''\anc:lbl' is a counter name, when such is know.

The \`'\@currentlabel' comes sometimes with font info.  Normally, it
comes from \''\refstepcounter' in the form of
\''\the..counter-name..'. In such cases, we can take the counter
name which is provided in the parameter of \''\cur:lbl'.

\<cross ref\><<<
\NewConfigure{@:currentlabel}[1]{\concat:config\a:@:currentlabel{#1}}
\let\a:@:currentlabel|=\relax
\def\cur:lbl#1{{\let\saved:currentlabel\:currentlabel\a:@:currentlabel 
  |<body of cur:lbl|>\expandafter}\:currentlabel}
>>>

\<body of cur:lbl\><<<
\def\:currentlabel{\par}%
\ifx\@currentlabel\:currentlabel 
   \def\:currentlabel{\let\:currentlabel|=\empty}%
\else \def\:currentlabel{#1}%
   \edef\:currentlabel{\def\noexpand
                 \:currentlabel{\ifx\:currentlabel\empty
         \ifx \:@currentlabel\:UnDef 
         \ifx\saved:currentlabel \@currentlabel\@currentlabel\else\saved:currentlabel\fi
         \else \:@currentlabel \fi
      \else 
          \expandafter\ifx\csname #1:Count\endcsname\relax
             \expandafter\the\csname c@#1\endcsname
          \else \csname #1:Count\endcsname\fi
      \fi}}%
\fi
>>>

The \''\label' command of latex invokes \''\cur:lbl{}'. If
\''\:@currentlabel' is deined, it is the to be used for the current label.
The   \''\ltx@label' command of amsmath.sty ignores it.

Whenever \''\@currentlabel' is redefined, we also want to redefine
\''\:@currentlabel'. It is redefined in 
\List{*}
\item  latex.ltx within
    \''\refstepcounter', \''\eqnarray', \''\@mpfootnotetext',
     and \''\@footnotetext';
\item amsart.cls, amsbook.cls, and amsproc.cls
    within \''eqnarray' and \''\@footnotetext'; 
\item amsmath.sty within
    \''\df@tag' and \''\make@df@tag@@';  
\item amstex.sty  within
    \''\@currentlabel', \''\@seteqlabel', and \''multline*'. 
\EndList

\<def :currentlabel for make@df@tag\><<<
\let\cnt:currentlabel|=\@currentlabel
\def\:@currentlabel{\ifx \cnt:currentlabel\@currentlabel
   \expandafter\the\csname c@equation\endcsname\else \@currentlabel\fi}%
>>>

\<def :currentlabel for refstepcounter\><<<
\let\cnt:currentlabel|=\@currentlabel
\def\:@currentlabel{\ifx \cnt:currentlabel\@currentlabel
   \expandafter\the\csname c@#1\endcsname\else \@currentlabel\fi}%
>>>

\<def :currentlabel for eqnarray\><<<
\html:addr \edef\cur:th{|<haddr prefix|>\last:haddr r}% 
>>>

\<def :currentlabel for eqncr\><<<
\anc:lbl r{}%
>>>

\<def :currentlabel for pic-eqnarray\><<<
|<def :currentlabel for eqnarray|>
\def\cnt:currentlabel{\p@equation\theequation}%   
\def\:@currentlabel{\ifx \cnt:currentlabel\@currentlabel
   \expandafter\the\csname c@equation\endcsname\else \@currentlabel\fi}%
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{/link for /label from /refstepcounter}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The following is late arrival into TeX4ht, inserted for handling
\''\newtheorem', and possibly other structures.  It might cause
duplicated anchors.  At least in the  case of figures and lists they
are overided by other anchors, and hence not needed. In case of 
lists and new theorems we ended to delete the overriden case. Still
need to do it
for pictures, and amybe also other cases.

The \''\refstepcounter' may appear in places (e.g., before first item
of a list) where no text is allowed, hence we have to ensure that
\''\anc:lbl' will not break this restriction.
How about within pictures?

\<cross ref\><<<
\append:defI\refstepcounter{%
  |<def :currentlabel for refstepcounter|>%
  \anc:lbl r{#1}}
\def\anc:lbl#1#2{%
   \html:addr   \xdef\cur:th{|<haddr prefix|>\last:haddr #1}%
   \ifx \EndPicture\:UnDef
      {\let\leavevmode|=\empty \cur:lbl{#2}%
      \Make:Label{\cur:th\:currentlabel}{}}%
   \else \ifx \label\@gobble \else  \cur:lbl{#2}%
       \edef\:temp{\noexpand\AfterPicture{%
          \noexpand\Make:Label{\cur:th\:currentlabel}{}}}\:temp
   \fi \fi}
\let\onc:lbl|=\anc:lbl
\def\SkipRefstepAnchor{\def\anc:lbl##1##2{\html:addr
   \edef\cur:th{|<haddr prefix|>\last:haddr}\ShowRefstepAnchor
   \let\skip:anchor|=\cur:th}}
\def\ShowRefstepAnchor{\let\anc:lbl|=\onc:lbl}
|<replace AutoRefstepAnchor|>
\html:addr   \edef\cur:th{|<haddr prefix|>\last:haddr}
>>>

% \def\AutoRefstepAnchor{\def\anc:lbl##1##2{\onc:lbl{##2}{}%
%   \ShowRefstepAnchor}}

We can't use ref- below, because 

The MakeLabel removes duplicates such as in

\Verbatim
         \documentclass{article}
         \begin{document}
            \begin{equation}\label{jh}
              c
            \end{equation}
         \end{document}
\EndVerbatim

For memory conservation, a maximum is placed on the number of labels
recorded.

\<cross ref\><<<
\def\Make:Label#1#2{%
   \def\:tempb##1|<par del|>{%
      \xdef\Made:Labels{{#1}\Made:Labels}%
      \set:label{\hbox{\Link{}{#1}#2\EndLink}}%
      \trim:Labels
   }%
   \def\:tempc##1|<par del|>{\hbox{#2}}%
   \let\:next=\check:labels \edef\:tempa{#1}%
   \expandafter\:next\Made:Labels{}|<par del|>%      
}
\let\set:label=\empty
>>>

\<cross ref\><<<
\let\Made:Labels=\empty
\def\check:labels#1{%
   \def\:temp{#1}\ifx\:temp\empty \let\:next=\:tempb 
   \else\ifx \:temp\:tempa        \let\:next=\:tempc
   \fi \fi
   \:next }
>>>

\<cross ref\><<<
\HAssign\Labels:Cnt |= 0
\def\trim:Labels{%
   \ifnum \Labels:Cnt>100 
      \def\:tempa##1|<par del|>{}%
      \gHAssign\Labels:Cnt = 0
      \let\:tempb\Made:Labels  
      \let\Made:Labels\empty
      \expandafter\keep:Labels\:tempb|<par del|>%
   \else \gHAdvance\Labels:Cnt by 1 \fi
}
\def\keep:Labels#1{\relax
   \ifnum \Labels:Cnt<50
     \xdef\Made:Labels{\Made:Labels{#1}}\gHAdvance\Labels:Cnt |by 1
         \expandafter\keep:Labels
   \else \expandafter\:tempa \fi }
>>>

We need the \''\hbox' above because \''\label' complains if vertical
mode is replaced with horizontal mode.

\`'   \let\Link:Labe|=\Make:Label
   \def\Tag:Label#1#2{\Tag{fR\label:Count}{#1}#2\GetLabel}
   \def\LinkLabels{\let\Make:Label|=\Link:Label} 
   \def\SendLabels{\let\Make:Label|=\Tag:Label}'

\ifHtml[\HPage{test data}\Verbatim
\newtheorem{example}{Example}[section]

\begin{example} 

\label{E}

\end{example} 

Example \ref{E}

\EndVerbatim\EndHPage{}]\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{divisions in tex4ht.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<elements for latex divs\><<<
\def\Get:SecAnchor#1#2#3{%
   |</edef /@currentlabel|>%
   \xdef\cur:th{|<haddr prefix|>\last:haddr}%
   |<get :currentlabel|>%
   \xdef\:currentlabel{#2}%
   \edef\:SecAnchor{\cur:th\:currentlabel}%
 }
>>>

We redefine \''\@Roman' for \''\thepart' to have the same number
of entries as \''\Alph'.

\</edef /@currentlabel\><<<
\bgroup  \def\@Roman##1{%
  \ifcase##1\or I\or II\or III\or IV\or V\or VI\or 
     VII\or VIII\or IX\or X\or XI\or XII\or XIII\or 
     XIV\or XV\or XVI\or XVII\or XVIII\or XIX\or XX\or 
     XXI\or XXII\or XXIII\or XXIV\or XV\or XVI\else
     \expandafter\uppercase\expandafter{\romannumeral ##1}\fi}%
   \a:currentlabel
   \expandafter\ifcsname p@#1\endcsname%
   \edef\:temp{\csname p@#1\expandafter\endcsname\csname the#1\endcsname}\ifx \:temp\empty
   \else \global\let\@currentlabel|=\:temp\fi\fi
\egroup
>>>

\<cross ref\><<<
\NewConfigure{currentlabel}{1}
>>>

The \''\@currentlabel' may hold a \''\uppercase' due to \''\thepart'
that has a \''\@Roman' in it.
Tried to go for \`'\cur:lbl{#1}%', but that was a problem for cross
references with labels of sections, because \''\label' uses \`'\cur:lbl{}'.

\<get :currentlabel\><<<
\let\:tempa|=\uppercase \def\uppercase##1{##1}\cur:lbl{}%
\let\uppercase|=\:tempa
>>>

How the above  \`'\global\let\cur:th|=\last:haddr'
work with the change in \''\refstepcounter'?

%%%%%%%%%%%%%%%%%%
\SubSection{ref-}
%%%%%%%%%%%%%%%%%%

To reduce conflicts, we deal with labels indirectly
through a counter. The counter is increased before
\''\getlabel' and after \''ref'. That is, this pair is assured
consistency of a label.  The separation between \''\GetLabel' and
\''\PutLabel' is
to allow the latter one into immediate arguments such as \''\HCode'
and \''\Tg'.

\''\label' sends its info to \''\getlabel'. It insert a 
\`'<pageref name="#1">' iff it is a target of a \''\pageref'.

\Verbatim
\:info{\string\Configure{label}{\string#1}{\string#1}}
\:info{\string\Configure{pageref}{\string#1}}
\:info{\string\Configure{ref}{\string#1}}

\Configure{label}{#1}{\HCode{[pagelabel label="#1"/]}}
\Configure{pageref}{\HCode{[pageref label="#1"/]}}
\Configure{ref}{\HCode{[ref label="#1"/]}}
\GetLabel \PutLabel  \ref{a}  \pageref{a}  \label{a}
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\Section{apacite.sty bibtex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  

\<apacite.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% apacite.4ht                           |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
   |<apacite.sty|> 
   \ifx \@@citeNP\:UnDef
     |<apacite 2003|>
   \else
     |<pre 2003 apacite|>
   \fi
\Hinput{apacite}
\endinput
>>>        \AddFile{9}{apacite}

\<apacite.sty\><<<
\def\B:my@dummy{\B@my@dummy}
\def\:citeP{\@citeP}

\def\:tempc<#1>[#2]#3{%
   \start:cite\a:cite \o:@@cite:<#1>[#2]{#3}\b:cite \end:cite
}
\HLet\@@cite=\:tempc
>>>

\<apacite 2003\><<<
\def\@lbibitem[#1]#2{% 
    \def\BBA{\BBAA}% 
    \item[\@biblabel{#1}]% 
    \if@filesw{% 
        \a:bibcite
        \def\BBA{\string\BBA}% 
        \def\protect##1{\string ##1}% 
        \immediate\write\@auxout{\string\bibcite{#2}{#1}}% 
        \def\BBA{\BBAA}% 
    }% 
    \fi% 
    \ignorespaces% 
} 
>>>

\<apacite 2003\><<<
\def\start:cite{%
   \let\sv:edef\edef
   \let\gobble:cite=\:gobble
   \def\edef##1{\def\:temp{##1}%
      \ifx \:temp\B:my@dummy
         \ifx \o:BCA\:UnDef
             \ifx \BCA\:UnDef\else
                \let\o:BCA=\BCA
                \def\BCA####1####2{\Protect\cIteLink{X\@citeb}{}%
                       \o:BCA{####1}{####2}\Protect\EndcIteLink}%
             \fi
         \fi
      \fi
      \sv:edef##1}%
}
\def\end:cite{%
   \let\edef=\sv:edef
   \let\BCA=\o:BCA  \let\o:BCA=\:UnDef
}
>>>

\<pre 2003 apacite\><<<
\def\start:cite{%
   \let\sv:edef\edef
   \let\gobble:cite=\:gobble
   \def\edef##1{\def\:temp{##1}%
      \ifx \:temp\B:my@dummy
         \cIteLink{X\@citeb}{}\let\gobble:cite=\empty
         \ifx \o:@BBOP\:UnDef 
             \let\o:@BBOP=\@BBOP
             \let\o:@BBAY=\@BBAY
             \pend:def\@BBOP{\gobble:cite\EndcIteLink
                        \let\gobble:cite=\:gobble}%
             \pend:def\@BBAY{\gobble:cite\EndcIteLink
                        \let\gobble:cite=\:gobble}%
         \fi
      \fi
      \ifx \:temp\:citeP
         \gobble:cite\EndcIteLink \let\gobble:cite=\:gobble
      \fi
      \sv:edef##1}%
}
\def\end:cite{%
   \let\edef=\sv:edef
   \let\@BBOP=\o:@BBOP  \let\o:@BBOP=\:UnDef
   \let\@BBAY=\o:@BBAY  \let\o:@BBAY=\:UnDef
}
\def\:tempc[#1]#2{%
   \start:cite\a:cite \o:@citeA:[#1]{#2}\b:cite \end:cite
}
\HLet\@citeA=\:tempc
\def\:tempc[#1]#2{%
   \start:cite\a:cite \o:@citeyear:[#1]{#2}\b:cite \end:cite
}
\HLet\@citeyear=\:tempc
\def\:tempc<#1>[#2]#3{%
   \start:cite\a:cite \o:@@citeNP:<#1>[#2]{#3}\b:cite \end:cite
}
\HLet\@@citeNP=\:tempc
\def\:tempc#1{%
   \start:cite\a:cite \o:@citeauthor:{#1}\b:cite \end:cite
}
\HLet\@citeauthor=\:tempc
\def\:tempc[#1]#2{%
   \start:cite\a:cite \o:@citeyearNP:[#1]{#2}\b:cite \end:cite
}
\HLet\@citeyearNP=\:tempc
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\Section{mla.sty bibtex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  

\<mla.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% mla.4ht                             |version %
% Copyright (C) |CopyYear.2002.      Eitan M. Gurari         %
|<TeX4ht copyright|>
   |<mla.sty|> 
\Hinput{mla}
\endinput
>>>        \AddFile{9}{mla}

\<mla.sty\><<<
\catcode`\:=12  
\def\@citedatax[#1]#2{%
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
  \def\@citea{}\csname a:cite\endcsname
  \@cite{\@for\@citeb:=#2\do%
    {\@citea\def\@citea{, }\@ifundefined% by Young
       {b@\@citeb}{{\bf ?}%
       \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
       {\cIteLink {X\@citeb}{}\csname b@\@citeb\endcsname \EndcIteLink
   }}}{#1}\csname b:cite\endcsname}
\catcode`\:=11 
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\Section{Biblatex}

\SubSection{biblatex.sty}

\<biblatex.4ht\><<<
% biblatex.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2007. Eitan M. Gurari
|<TeX4ht copywrite|>
   |<config biblatex|> 
   |<shared config biblatex|>
   |<biblatex-crosslinking|>
   |<biblatex AtEndPreamble|>
   |<biblatex backlinks|>
\Hinput{biblatex}
\endinput
>>>        \AddFile{6}{biblatex}

\<biblatex AtEndPreamble\><<<
\let\:temp\do
  \def\do#1{% 
    \patchcmd#1% 
      {\color@begingroup}% 
      {\color@begingroup\toggletrue{blx@footnote}}% 
      {\togglefalse{blx@tempa}\listbreak}%
      {}}% 
  \docsvlist{% 
    \@footnotetext,%          latex 
    \H@@footnotetext,%        hyperref 
    \scr@saved@footnotetext,% koma-script 3.x 
    \l@dold@footnotetext,%    ledmac 
    \l@doldold@footnotetext,% ledmac 
    \@fntORI}%                frenchle 
\let\do\:temp
>>>

\<config biblatex\><<<
\def\make:blx:ver#1.#2#3\relax{%
   %\ifdim#1pt< 3pt \xdef\blx:ver:no{2}\else\xdef\blx:ver:no{3}\fi%
   \gdef\blx:ver:no{#1}
   \gdef\blx:subver:no{#2}
}
\expandafter\make:blx:ver\abx@version.0\relax
\ifx\a:printshorthands\Undef\let\blx@shorthands\@empty\fi
\ifx\blx@startbib\:UnDef
 \pend:def\blx@shorthands{%
   \pend:def\blx@bibinit{%
       \HAssign\shorthands:cnt=0
       \NewConfigure{printfield-shorthand}{2}%
       \Configure{printfield-shorthand}%
         {\gHAdvance\shorthands:cnt by 1\relax
          \ifnum \shorthands:cnt=1 \a:printshorthands
          \else                    \c:printshorthands \fi
         }
         {\d:printshorthands}%
   \append:def\endtheshorthands{\b:printshorthands}%
   \csname a:@shorthands\endcsname}
}
>>>

\<config biblatex\><<<
\ifx\b:printshorthands\Undef\let\endtheshorthands\@empty\fi
\def\a:entryhead{CVR}
\def\a:entryhead:full{CV Radhakrishnan}
\ifx\bib@macro@entryhead:name\UnDef
  \let\bib@macro@entryhead:name\@empty\fi
\ifx\bib@macro@entryhead:full\UnDef
  \let\bib@macro@entryhead:full\@empty\fi
  \gdef\BibFileName[#1]#2{\expandafter\xdef\csname 
       BibFileName#1\endcsname{#2}}
>>>

\<config biblatex\><<<
\newcount\sv:sec:cnt
\def\bibSecConfigure{%
  \let\save:section\section
  \global\sv:sec:cnt=\c@secnumdepth  
  \def\section{\@ifstar
      {\c@secnumdepth=0\relax\save:section}%
      {\c@secnumdepth=\sv:sec:cnt\save:section}}% 
}
\gHAssign\bibN=0
>>>

Biblatex recently started to complain about ifthenelse
patching. It is quite strange, as this patching code is quite 
old and there were no such errors previously. Anyway, 
this code should try to patch ifthenelse using TeX4ht built-in
mechanism for ifthenelse.

We defined the hook macro depending on presence of Hyperref. 
I don't remember why, but it seems to works with Hyperref now,
so the package condition seems unnecessary. It even produces
an error when Hyperref is used before BibLaTeX, so I think
we should remove it.

This sections is kept here just for the future reference, the 
next section is actually used:
\<\><<<
\@ifpackageloaded{hyperref}{}{%
\ifdefined\TE@hook\else%
\def\TE@hook{}%
\fi%
}
>>>

Define TE@hook so BibLaTeX don't try to patch ifthenelse.
We put the hook ourselves thanks to Configure{ifthenelse}.

\<config biblatex\><<<
\ifdefined\TE@hook\else%
\def\TE@hook{}%
\fi%

\AtBeginDocument{%
  \Configure{ifthenelse}{\TE@hook}
}
>>>

\<biblatex-with-ooffice\><<<
\def\bibConfigure{\ConfigureList{thebibliography}%
      {\IgnorePar\EndP \gHAdvance\bib:N by 1
       \HCode{<text:bibliography text:name="bib-\bib:N" >
              <text:bibliography-source>\Hnewline
             <text:index-title-template>}
           \NoFonts\ref:name\EndNoFonts
       \HCode{</text:index-title-template>\Hnewline
%
           <text:bibliography-entry-template\Hnewline
            text:bibliography-type="custom1"
            text:style-name="Bibliography11">\Hnewline
%
            <text:index-entry-bibliography
             text:bibliography-data-field="identifier"/>\Hnewline
%
           <text:index-entry-span>: </text:index-entry-span>\Hnewline
           <text:index-entry-bibliography
            text:bibliography-data-field="author" />\Hnewline
           <text:index-entry-span>, </text:index-entry-span>\Hnewline
%
           <text:index-entry-bibliography
            text:bibliography-data-field="title" />\Hnewline
           <text:index-entry-span>, </text:index-entry-span>\Hnewline
%
           <text:index-entry-bibliography
            text:bibliography-data-field="year" />\Hnewline
           </text:bibliography-entry-template>\Hnewline\Hnewline
           </text:bibliography-source>\Hnewline
           <text:index-body>\Hnewline}%
         \let\en:bib=\empty
      }%
      {\en:bib\HCode{</text:index-body></text:bibliography>}}
      {\en:bib\gdef\en:bib{\HCode{</text:p>\Hnewline}}%
        \HCode{<text:p text:style-name="p-bibitem">}%
        \gHAdvance\bibN by 1
        \HCode{<text:reference-mark
          text:name="X0-\csname BIB-\bibN\endcsname">%
          </text:reference-mark>}%
      }%
      {}{}
  }
>>>

\<biblatex-without-ooffice\><<<
 \def\bibConfigure{%
  \ConfigureList{thebibliography}
  {\ifvmode \IgnorePar \fi \EndP \EndP
    \HCode {<dl class="thebibliography">}%
%
% This is for linking citations with biblist items which
% are in a different file when output is split into different
% chunks. [CVR 2012-09-27]
%
%
% <biblatex-2.2>
%
  \immediate\write\@auxout{%
    \string\providecommand\string\BibFileName[2][]{}
  }%
  \immediate\write\@auxout{%
      \string\BibFileName[\therefsection]{\FileName}}%
%
% </biblatex-2.2>
%
    \PushMacro \end:itm \global \let \end:itm =\empty}%
  {\ifvmode \IgnorePar \fi \EndP
    \PopMacro \end:itm \global \let \end:itm \end:itm \EndP
    \HCode {</dd></dl>}\ShowPar}%
  {\ifvmode \IgnorePar \fi \EndP \gHAdvance \bibN by 1 
    \end:itm \global \def \end:itm {\EndP \Tg </dd>}%
    \HCode {<dt id="X\therefsection-\abx@field@entrykey"
      class="thebibliography">}\bgroup \bf}%
  {\ifvmode \IgnorePar \fi \EndP
    \egroup
    \HCode {</dt><dd\Hnewline id="bib-\bibN"
      class="thebibliography">}%
    \par \ShowPar}%
 }
>>>

\<config biblatex\><<<
  \:CheckOption{ooffice}\if:Option
   |<biblatex-with-ooffice|>
  \else
   |<biblatex-without-ooffice|>
 \fi
>>>

\<config biblatex\><<<
\NewConfigure{printshorthands}{4}
\NewConfigure{@shorthands}[1]{\concat:config\a:@shorthands{#1}} 
\let\a:@shorthands\empty 
\def\nolinkurl#1{#1}
% \def\blx@checksum{\ifx \blx@checksum@old \blx@checksum@new \else
%   \blx@warning@noline {Page references have changed.\MessageBreak
%     Rerun to get references right}\@tempswatrue \blx@reruntrue \fi
%   \@nameuse {blx@rerun}}
\def\blx@checksum#1#2#3{%
  \begingroup
  \blx@tempcnta\the\numexpr0#2*0#3\relax
  \blx@tempcntb\blx@tempcnta
  \divide\blx@tempcntb10
  \multiply\blx@tempcntb10
  \advance\blx@tempcnta-\blx@tempcntb
  \xdef#1{#1\the\blx@tempcnta}%
  \endgroup}

\@ifpackagelater{biblatex}{2018/03/01}{\let\blx:pend:def\pend:defI}{\let\blx:pend:def\pend:def}
\blx:pend:def\blx@bibliography{\bibSecConfigure%
  \pend:def\blx@bibinit{%
    \bibConfigure
     \csname onthebibliography:list\endcsname
  }%
}
>>>

\<config biblatex\><<<
\let\en:bib\@empty
\newcounter{bib}
\ifnum\blx:ver:no < 3
 \protected\def\blx@bbl@entry#1#2#3{%
  \begingroup
  \def\texht@bibkey{#1}
  \edef\abx@field@entrykey{\detokenize{#1}}%
  \global\advance\c@bib 1
  \immediate\write\@auxout{\string\expandafter\string\gdef
    \string\csname\space BIB-\thebib\string\endcsname
     {\expandafter\strip@prefix\meaning\texht@bibkey}}%
  \Tag{)QX\therefsection-#1}{\thebib}%
  \blx@setoptions@type{#2}%
  \blx@bbl@options{#3}%
  \blx@setoptions@entry
  \edef\blx@bbl@data{blx@data@\the\c@refsection @\abx@field@entrykey}%
  \csuse\blx@bbl@data
  \cslet\blx@bbl@data\@empty
  \blx@bbl@addfield{entrykey}{\abx@field@entrykey}%
  \blx@bbl@addfield{entrytype}{#2}%
  \blx@imc@iffieldundef{options}
    {}
    {\blx@bbl@fieldedef{options}{\expandonce\abx@field@options}}}
%
 \protected\def\blx@finentry{%
  \unspace
  \a:finentry
      \finentrypunct
      \blx@postpunct
  \b:finentry
  \blx@initunit
 }
%
\else
% Biblatex 3.0
% 
% Hacks for biblatex

% I don't really understand this, but language processing is broken by default
% with biblatex. It loads language file, but it executes code which should be 
% executed only in the case if the language file fails, it displays an error message
% and language handling doesn't work. When we execute following code, the language 
% files are loaded before checking of the success and it seems to work.
 
\AtBeginDocument{%
\@ifpackageloaded{babel}
      {% This is required for languages which are never explicitly selected
        % It seems this code was executed also with Polyglossia, where it caused compilation error
        \@ifpackageloaded{polyglossia}{}{% 
        \def\do#1{\blx@lbxinput{#1}{}{}}%
       \ifx\@empty\bbl@loaded\else%
       \expandafter\docsvlist\expandafter{\bbl@loaded}%
      \fi}}{}%
}
\fi % end of version boolean
>>>

2022/07/25:  It seems that we don't need to redefine MakeUppercase and MakeLowercase, BiBLaTeX works without these
redefinitions, and on the contrary, we get compilation error with these, as they were changed in the LaTeX kernel. 
So I think it is best to remove them. 

\<biblatex dont use\><<<
% MakeUppercase is redefined by tex4ht, biblatex tries to redefine it as well, but it relies on original 
% LaTeX version:
\DeclareRobustCommand{\MakeUppercase}[1]{{%
  \def\i{I}\def\j{J}%
  \def\reserved@a##1##2{\let##1##2\reserved@a}%
  \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
  \let\UTF@two@octets@noexpand\@empty
  \let\UTF@three@octets@noexpand\@empty
  \let\UTF@four@octets@noexpand\@empty
  \blx@hook@uc\protected@edef\reserved@a{\uppercase{#1}}%
  \reserved@a
}}
% Same applies also for \MakeLowercase
\DeclareRobustCommand{\MakeLowercase}[1]{{%
  \def\reserved@a##1##2{\let##2##1\reserved@a}%
  \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
  \let\UTF@two@octets@noexpand\@empty
  \let\UTF@three@octets@noexpand\@empty
  \let\UTF@four@octets@noexpand\@empty
  \blx@hook@lc\protected@edef\reserved@a{\lowercase{#1}}%
  \reserved@a
}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% CVR 2010/03/31
% \bib@field@entrykey initialized with empty value
%
% CVR 2010/07/18
% null initialization will result in wrong hyperlinking of citations
% with respective bibitems.  Therefore, \bib@field@entrykey is defined
% as the entrykey which is the correct value.
%
% CVR 2010/09/10
% \blx@checksum macro added to match biblatex.sty 
% version 1.6 2011/07/29
% 
\<appto blx mkhyperref\><<<
\let\blx@anchors\@empty 
\let\bib@field@entrykey\@empty
\protected\def\blx@anchor{% 
  \xifinlist{|</the /c@refsection @|>\bib@field@entrykey}{\blx@anchors}% 
    {}% 
    {\listxadd\blx@anchors{|</the /c@refsection @|>\bib@field@entrykey}% 
     \hyper:natanchorstart{|</the /c@refsection @|>\bib@field@entrykey}% 
     \hyper:natanchorend}}
>>>

\<appto blx mkhyperref\><<<
\protected\def\blx@bibhyperref{%
   \@ifnextchar[%]
     {\blx@bibhyperref@i}%
     {\blx@bibhyperref@i[\bib@field@entrykey]}}%
\long\def\blx@bibhyperref@i[#1]#2{%
   \hyper:natlinkstart{|</the /c@refsection @|>#1}%
   #2\hyper:natlinkend}%
\protected\long\def\blx@bibhyperlink#1#2{%
   \hyper:natlinkstart{|</the /c@refsection :|>#1}%
   #2\hyper:natlinkend}%
\protected\long\def\blx@bibhypertarget#1#2{%
   \@bsphack
   \hyper:natanchorstart{|</the /c@refsection :|>#1}%
   \@esphack
   #2\hyper:natanchorend}%
>>>

\</the /c@refsection @\><<<
X\the\c@refsection -%@
>>>

\</the /c@refsection :\><<<
X\the\c@refsection --%:
>>>

\<appto blx mkhyperref\><<<
\let\blx@ifhyperref\@firstoftwo
\def\hyper:natanchorstart#1{\Link{}{#1}\EndLink}
\def\hyper:natanchorend{}
\def\hyper:natlinkstart#1{\Link{#1}{}}
\def\hyper:natlinkend{\EndLink}
>>>

\<\><<<
\long\def\blx@bibhyperref@i[#1]#2{#2}
\protected\long\def\blx@bibhyperlink#1#2{#2}
\protected\long\def\blx@bibhypertarget#1#2{#2}
>>>
%
% 2010/09/26 CVR
% Kristian Debrabant <Kristian.Debrabant@cs.kuleuven.be> and
% Christian Fearnot <fearnot@arcor.de> reported that consequent
% to revision of biblatex to version 0.9d, biblatex.4ht seemed to
% be broken.  It was true. The problem was the redefined
% \blx@checksum in biblatex.4ht which was either superfluous or
% erratic or both. So, I have commented out in biblatex.4ht
% and decided to use the default definition in the biblatex.sty.
% Both the bug reporters have told that the modified version
% solved their problems.
% 
% \<config biblatex\><<<
% \def\blx@checksum{\ifx \blx@checksum@old \blx@checksum@new \else 
%   \blx@warning@noline {Page references have changed.\MessageBreak 
%     Rerun to get references right}\@tempswatrue \blx@reruntrue \fi 
%   \@nameuse {blx@rerun}}
% >>>

\<config biblatex-???\><<<
\pend:def\blx@bibliography{% 
  \pend:def\blx@bibinit{%
     \ConfigureList{thebibliography}%
        {\a:thebibliography}%
        {\b:thebibliography}%
        {\c:thebibliography}%
        {\d:thebibliography}%
     \csname onthebibliography:list\endcsname  
  }%
%  \pend:def\endthebibliography{%
%     \if@newlist \global\@newlistfalse \fi
%  }%
}  
>>>

\<config biblatex-???\><<<
\pend:defI\blx@bibitem{% 
   \ifx \bibitem:key\:UnDef
       \let\blx:anchor\blx@anchor
       \def\blx@anchor{\let\blx@anchor\blx:anchor
                       \Link{}{\bibitem:key}\EndLink}%
   \fi
   \def\bibitem:key{##1}%   
}
>>>

\<config biblatex-???\><<<
\protected\def\blx@citeprint#1{% 
  \advance\c@citecount\@ne 
  \addtocounter{instcount}\@ne 
  \ifnum\c@citecount=\@ne 
    \blx@getdata@cite{#1}% 
    \blx@precode 
    \ifnum\c@citetotal>\@ne 
      \blx@resetdata 
    \fi 
  \else 
    \blx@dlimcode 
  \fi 
  \begingroup 
  \ifnum\c@citetotal>\@ne 
    \blx@getdata@cite{#1}% 
  \fi 
  \blx@entrysetcount 
  \blx@options 
  \blx@backref 
  \blx@pagetracker 
  \csuse{blx@hook@citekey}% 
  \csuse{blx@hook@citekey@next}% 
  \blx@execute 
  \cIteLink{#1}{}\blx@loopcode \EndcIteLink
  \blx@citetracker 
  \blx@ibidtracker 
  \blx@opcittracker 
  \blx@loccittracker 
  \ifnum\c@citecount=\c@citetotal 
    \def\blx@thecheckpunct{\blx@err@nestcite\@gobble}% 
    \blx@postcode 
  \fi 
  \endgroup} 
>>>

\<config biblatex\><<<
\NewConfigure{finentry}{2}
\def\:tempc[#1]#2{%
   \expandafter\ifx \csname a:printfield-#2\endcsname\relax
      \NewConfigure{printfield-#2}{2}%
      \a:printfield{printfield-#2}%
   \fi
   \Configure{blx@unit}%
       {\csname a:printfield-#2\endcsname}%
       {\csname b:printfield-#2\endcsname}%
   \csname o:\string\blx@printfield:\endcsname[#1]{#2}%   
}
\expandafter\HLet\csname\string\blx@printfield\endcsname\:tempc
>>>

\<config biblatex\><<<
\NewConfigure{printfield}[1]{\def\a:printfield##1{#1}}
\Configure{printfield}{%
    \Configure{#1}%
       {\HCode{<!--#1-->}}%
       {\HCode{<!--/#1-->}}%
}
>>>

\<config biblatex--???\><<<
\def\:tempc[#1]#2{%
   \expandafter\ifx \csname a:printtext-#2\endcsname\relax
      \NewConfigure{printtext-#2}{2}%
      \a:printfield{printtext-#2}%
   \fi
   \Configure{blx@unit}%
       {\csname a:printtext-#2\endcsname}%
       {\csname b:printtext-#2\endcsname}%
   \csname o:\string\blx@printtext:\endcsname[#1]{#2}%   
}
\expandafter\HLet\csname\string\blx@printtext\endcsname\:tempc
>>>

\<config biblatex\><<<
\def\:tempc[#1]#2{%
   \expandafter\ifx \csname a:bibstring-#2\endcsname\relax
      \NewConfigure{bibstring-#2}{2}%
      \a:printfield{bibstring-#2}%
   \fi
   \Configure{blx@unit}%
       {\csname a:bibstring-#2\endcsname}%
       {\csname b:bibstring-#2\endcsname}%
   \csname o:\string\blx@bibstring:\endcsname[#1]{#2}%   
}
\expandafter\HLet\csname\string\blx@bibstring\endcsname\:tempc
>>>

\<config biblatex\><<<
\def\:tempc[#1]#2{%
   \expandafter\ifx \csname a:bibcpstring-#2\endcsname\relax
      \NewConfigure{bibcpstring-#2}{2}%
      \a:printfield{bibcpstring-#2}%
   \fi
   \Configure{blx@unit}%
       {\csname a:bibcpstring-#2\endcsname}%
       {\csname b:bibcpstring-#2\endcsname}%
   \csname o:\string\blx@bibcpstring:\endcsname[#1]{#2}%   
}
\expandafter\HLet\csname\string\blx@bibcpstring\endcsname\:tempc
>>>

\<config biblatex\><<<
\def\:tempc[#1]#2{%
   \expandafter\ifx \csname a:biblcstring-#2\endcsname\relax
      \NewConfigure{biblcstring-#2}{2}%
      \a:printfield{biblcstring-#2}%
   \fi
   \Configure{blx@unit}%
       {\csname a:biblcstring-#2\endcsname}%
       {\csname b:biblcstring-#2\endcsname}%
   \csname o:\string\blx@biblcstring:\endcsname[#1]{#2}%   
}
\expandafter\HLet\csname\string\blx@biblcstring\endcsname\:tempc
>>>

\<config biblatex\><<<
\def\:tempc[#1]#2{%
   \expandafter\ifx \csname a:bibucstring-#2\endcsname\relax
      \NewConfigure{bibucstring-#2}{2}%
      \a:printfield{bibucstring-#2}%
   \fi
   \Configure{blx@unit}%
       {\csname a:bibucstring-#2\endcsname}%
       {\csname b:bibucstring-#2\endcsname}%
   \csname o:\string\blx@bibucstring:\endcsname[#1]{#2}%   
}
\expandafter\HLet\csname\string\blx@bibucstring\endcsname\:tempc
>>>

\<config biblatex pre v. 0.7 -??\><<<
\pend:def\blx@bibliography{% 
  \pend:def\thebibitem{\c:thebibliography}%
  \append:def\thebibitem{\relax\d:thebibliography}%
  \pend:def\blx@startbib{\a:thebibliography}%
  \pend:def\endthebibliography{%
     \if@newlist \global\@newlistfalse \fi
  }%
  \append:def\endthebibliography{\b:thebibliography}%
}  
>>>

\<shared config biblatex\><<<
\NewConfigure{thebibliography}{4}
>>>

\<config biblatex\><<<
\NewConfigure{biblatex-style}[2]{%
   \def\:temp{#1}%
   \ifx \:temp\blx@cbxfile 
      #2%
      \global\let\biblatex:style\def
   \fi
}

\def\biblatex:style{}
\Configure{biblatex-style}{}{}

\pend:def\at:docend{%
   \ifx \UnDef\biblatex:style
      \:warning{\string\Configure{biblatex-style}{\blx@cbxfile}{...} 
         not available}%
   \fi
}
>>>

\<config biblatex\><<<
\let\blx:item\@item
\def\@item[#1]{%
  \blx:item[#1]%
  \ifhmode \spacefactor\blx@sf@par\fi
}
\let\blx@resetpuncthook\@empty
\let\blx@csq@ifkernmark\@empty
\newskip\blx@unitmark
\blx@unitmark=10pt plus 1pt minus 1pt
\let\abx@aux@page\@gobbletwo
\let\abx@aux@fnpage\@gobbletwo
\let\abx@aux@refsection\@gobbletwo
%
% <Kristian.Debrabant@cs.kuleuven.be> reported that After updating
% biblatex and biblatex.ht to versions 2.2 respectively
% 2012-09-28-17:49 (using MiKTeX 2.9 64 bit), tex4ht seemed no longer
% respected the defernumbers option in biblatex.sty: When applied to
% the attached file tex4hterror.tex.
%
% The problem was due to nullifying \abx@aux@number which in fact
% should have been redefined to \blx@aux@number when defernumbers
% option is true.
%
% This is done now and as per Kristian, the fix works fine now.
%
\ifnum\blx:ver:no < 3 
%
 \protected\def\blx@aux@number#1#2#3#4{%
  \blx@bbl@addentryfield{\detokenize{#2}}{#3}{localnumber}{#4}%
  \ifblank{#4}%
    {}%
    {\csgdef{blx@labelnumber@#3}{#4}%
     %\blx@addchecksum{#1}{#4} % this can cause a nodocument error!
     }}
%
 \iftoggle{blx@defernumbers}%
    {\setkeys{blx@opt@pre}{labelnumber}%
     \let\blx@thelabelnumber\blx@addlabelnumber
     \let\abx@aux@number\blx@aux@number}%
    {\let\blx@thelabelnumber\relax
     \let\abx@aux@number\@gobblefour}
%
\else
  \def\@gobblefive#1#2#3#4#5{}%
 \protected\def\blx@aux@number#1#2#3#4#5{%
   \blx@bbl@addentryfield{\detokenize{#2}}{#3}{localnumber}{#4}{#5}%
   \blx@bbl@addentryfield{\detokenize{#2}}{#3}{labelnumber}{#4}{#5}%
   \global\toggletrue{blx@localnumber}%
   \ifblank{#5}
    {}
    {\csgdef{blx@labelnumber@#3@#4}{#5}}}

 \iftoggle{blx@defernumbers}%
    {\setkeys{blx@opt@pre}{labelnumber}%
     \let\blx@thelabelnumber\blx@addlabelnumber
     \let\abx@aux@number\blx@aux@number}%
    {\let\blx@thelabelnumber\relax
     \let\abx@aux@number\@gobblefive}
\fi % end of version boolean
%
\AtEndDocument{%
  \def\abx@aux@page#1#2{\blx@addpagesum{#1}{#2}}%
  \def\abx@aux@fnpage#1#2{\blx@addpagesum{#1}{#2}}%
}
%
\def\blx@begunit{%
  \toggletrue{blx@tempa}%
  \iftoggle{blx@insert}%
    {\iftoggle{blx@unit}%
       {\begingroup
          \let\blx@begunit\@empty
          \let\blx@endunit\@empty
          \let\blx@endnounit\@empty
          \blx@unitpunct\blx@postpunct
        \endgroup
        \global\togglefalse{blx@unit}%
        \togglefalse{blx@tempa}}
       {\blx@postpunct}%
     \iftoggle{blx@block}%
       {\begingroup
          \let\blx@begunit\@empty
          \let\blx@endunit\@empty
          \let\blx@endnounit\@empty
          \newblockpunct
        \endgroup
        \global\togglefalse{blx@block}%
        \togglefalse{blx@tempa}}%
       {}}%
    {}%
  \blx@postpunct
  \blx@imc@resetpunctfont
  \iftoggle{blx@tempa}%
    {}%
    {\global\togglefalse{blx@insert}}%
  \csname a:blx@unit\endcsname
  \blx@leavevmode
  \begingroup
    \Configure{blx@unit}{}{}%
}
\def\blx@endunit{%
  \endgroup
  \csname b:blx@unit\endcsname%
  \Configure{blx@unit}{}{}%
  \global\toggletrue{blx@insert}%
  \global\toggletrue{blx@lastins}%
}
\NewConfigure{blx@unit}{2}

%
   \else
\fi

>>>

The following code fixes non-ascii cite keys with XeLaTeX,
they caused compilation error when the AUX file is loaded.
\<config biblatex\><<<
\ifdefined\XeTeXversion
  \def\abx@aux@defaultrefcontext#1#2#3{%
  \csxdef{blx@assignedrefcontextbib@#1@\detokenize{#2}}{\detokenize{#3}}}
\fi
>>>

BibLaTeX don't use \`'\nobreakspace' command for non-breaking spaces, 
so TeX4ht outputs regular spaces in their place. This redefinition should
fix it.

\<config biblatex\><<<
\renewrobustcmd*{\addnbspace}{%
  \unspace\blx@postpunct%
  % insert real non-breaking space character
  \nobreakspace\blx@imc@resetpunctfont}
>>>

\<shared config biblatex\><<<
\append:def\blx@bibinit{\a:bibinit}%
\NewConfigure{bibinit}{1}%
>>>

\<biblatex-crosslinking\><<<
\let\blx@anchors\@empty
\let\bib@field@entrykey\@empty

\protected\def\blx@anchor{%
  \xifinlist{X\the\c@refsection -%@
    \bib@field@entrykey}{\blx@anchors}%
    {}%
    {\listxadd\blx@anchors{X\the\c@refsection -%@
      \bib@field@entrykey}%
     \hyper:natanchorstart{X\the\c@refsection -%@
      \bib@field@entrykey}%
     \hyper:natanchorend}}
     
\protected\def\blx@bibhyperref{%
   \@ifnextchar[%]
     {\blx@bibhyperref@i}%
     {\blx@bibhyperref@i[\bib@field@entrykey]}}%

\long\def\blx@bibhyperref@i[#1]#2{%
   \hyper:natlinkstart{X\the\c@refsection -%@
     #1}%
     #2\hyper:natlinkend}%

\protected\long\def\blx@bibhyperlink#1#2{%
   \hyper:natlinkstart{X\the\c@refsection -%:
     #1}%
     #2\hyper:natlinkend}%

\protected\long\def\blx@bibhypertarget#1#2{%
   \@bsphack
   \hyper:natanchorstart{X\the\c@refsection -%:
     #1}%
   \@esphack
     #2\hyper:natanchorend}%

\let\blx@ifhyperref\@firstoftwo

% Oleg Domanov odomanov@yandex.ru reports:
% tex4ht ends with an error when compiles biblatex files. I'm on
% Windows, texlive 2012. I put here a minimal example and files
% generated with the command latexmk test && mk4ht oolatex test
%
% https://www.dropbox.com/s/hn1zm40htqs13mf/t4htlink.zip
%
% There is a superfluous \relax in the file test.tmp, line 65 which
% seems to cause the error. 
%
% Changes to cope with biblatex upgrade caused this problem. It is now
% fixed. --CVR 2012/10/26
% 
\:CheckOption{ooffice}\if:Option
 \def\hyper:natanchorstart#1{\Link{}{#1}\EndLink}%  
 \def\hyper:natlinkstart#1{\Link{#1}{}}%
\else
 \def\hyper:natanchorstart#1{%
      \expandafter\ifx\csname QXpage.\thepage\endcsname\relax%
        \Tag{)Qpage.\thepage}{\file:id}%
        \HCode{<a id="page.\thepage"></a>}%
        \expandafter\xdef\csname QXpage.\thepage\endcsname{0}%
       \fi 
      \Link[\csname BibFileName\therefsection\endcsname]{}{#1}\EndLink}  
 \def\hyper:natlinkstart#1{%
      \expandafter\ifx\csname QXpage.\thepage\endcsname\relax%
        \Tag{)Qpage.\thepage}{\file:id}%
        \HCode{<a id="page.\thepage"></a>}%
        \expandafter\xdef\csname QXpage.\thepage\endcsname{0}%
       \fi 
      \Link[\csname BibFileName\therefsection\endcsname]{#1}{}}
\fi
\def\hyper:natanchorend{}
\def\hyper:natlinkend{\EndLink}
\def\writeCiteLink#1{\immediate\write\@mainaux{%
    \string\@namedef{#1.\thepage}{\FileName}}}
\let\blx@addpagesum\@gobbletwo
% \let\nolinkurl\relax

\ifx\blx:ver:no < 3
%
% biblatex 2.9a
%
% Newly added to process {keylist} environment (CVR)
% 
\let\keylist\description
\let\endkeylist\enddescription
\def\keyitem#1{\item[#1]}%
%
%
\else
%
% biblatex 3.0
%
\let\keylist\Un:def
\let\endkeylist\Un:def
\newenvironment*{keylist}
  {\list{}{%
     \setlength{\labelwidth}{1.25in}%
     \setlength{\labelsep}{10pt}%
     \setlength{\leftmargin}{0pt}%
     \setlength{\itemsep}{0pt}%
     \raggedright%
     \renewcommand*{\makelabel}[1]{\hss\bfseries##1}}}
  {\endlist}
%
\def\keyitem#1{%
  \item[#1]
  \begingroup
    \keyitemhook%
    \blx@bibinit%
    \midsentence\ifbibstring{#1}{}{\latintext}\biblstring{#1}%
    \expandafter\lbx@initnamehook\lsmartoftext%
    \par\nobreak
    \midsentence\ifbibstring{#1}{}{\latintext}\bibsstring{#1}%
    \expandafter\lbx@initnamehook\ssmartoftext%
  \endgroup
  \par\nobreak}
\fi  % End of version boolean 

\ConfigureList{keylist}%
   {\EndP\HCode{<dl \a:LRdir class="description">}%
      \PushMacro\end:itm
\global\let\end:itm=\empty}%
   {\PopMacro\end:itm \global\let\end:itm \end:itm
\EndP\HCode{</dd></dl>}\ShowPar}%
   {\end:itm \global\def\end:itm{\EndP\Tg</dd>}\HCode{<dt
        class="description">}\bgroup \bf}%
   {\egroup\EndP\HCode{</dt><dd\Hnewline class="description">}}
>>>

Fix backlink support in BibLaTeX

\<biblatex backlinks\><<<
\pend:defI\blx@backref{%
  % prevent duplicate backlink on the same page
  \ifcsdef{bk##1\thepage}{}{%
    % insert link to the page
    \html:addr\Link-{}{|<haddr prefix|>\last:haddr}\EndLink%
    % save link to the .xref file
    % we need to use \protected@write to get correct page numbers in backrefs
    \protected@write\:refout{}{\string\:CrossWord{)Q##1\thepage}{|<haddr prefix|>\last:haddr}{\folio}}%
    % we need to save the link destination in .xref file
    % too, otherwise \Link command would issue warning
    \Tag{)Q|<haddr prefix|>\last:haddr}{\FileNumber}%
  }%
  % declare this backlink destination as used, so we don't
  % declare another one with the same name
  \expandafter\gdef\csname bk##1\thepage\endcsname{}%
}

% version of \hyperlink that links back to saved link in citation
% on the given DVI page
\def\bbx:hyperlink#1#2{
  % first argument is destination used by Hyperref, second is page number
  % test if we saved link to the current bibitem and page
  \ifTag{)Q\abx@field@entrykey#2}{%
      \Link{\LikeRef{)Q\abx@field@entrykey#2}}{}#2\EndLink%
  }%
  {#2}% print just page number if there is no saved link
  }

% we need to redefine pageref format, which is used for printing of
% back link page numbers. custom \hyperlink command is used
\DeclareListFormat{pageref}{%
  % we redefine \hyperlink command to link page numbers in backreferences
  % back to the citations on the given pages
  \let\orig:hyperlink\hyperlink%
  \let\hyperlink\bbx:hyperlink%
  \ifnumless{\abx@pagerefstyle}{0}%
    {\usebibmacro{list:plain}%
     \ifhyperref%
       {\hyperlink{page.#1}{#1}}%
       {#1}}%
    {\ifnumequal{\value{listcount}}{1}%
       {\usebibmacro{pageref:init}}%
       {}%
     \usebibmacro{pageref:comp}{#1}%
     \ifnumequal{\value{listcount}}{\value{liststop}}%
       {\usebibmacro{pageref:dump}}%
       {}}%
  \let\hyperlink\orig:hyperlink%
}

>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\SubSection{backref.4ht}

\<backref.4ht\><<< 
% backref.4ht (|version), generated from |jobname.tex 
% Copyright 2021 TeX Users Group 
|<TeX4ht license text|> 
|<backref definitions|>
\Hinput{backref} 
\endinput 
>>> \AddFile{9}{backref}

\<backref definitions\><<<
% patch command that inserts backlink destinations
\pend:defI\Hy@backout{%
  % prevent duplicate backlink on the same page
  \ifcsname bk##1\thepage\endcsname\else%
    % insert link to the page
    \html:addr\Link-{}{|<haddr prefix|>\last:haddr}\EndLink%
    % save link to the .xref file
    \Tag{)Q##1\thepage}{|<haddr prefix|>\last:haddr}%
    % we need to save the link destination in .xref file
    % too, otherwise \Link command would issue warning
    \Tag{)Q|<haddr prefix|>\last:haddr}{\FileNumber}%
  \fi%
  % declare this backlink destination as used, so we don't 
  % declare another one with the same name
  \expandafter\def\csname bk##1\thepage\endcsname{}%
}

% redefine macro that puts out backlinks
\def\:tempa#1#2#3{%
  % test if we saved link to the current bibitem and page
  \ifTag{)Q\current:back:desc#1}{%
      \Link{\LikeRef{)Q\current:back:desc#1}}{}#1\EndLink%
  }% 
  {#1}% print just page number if there is no saved link
}%
\HLet\backrefxxx\:tempa

% save current bibkey for use in \backrefxxx
\pend:defI\BR@backref{\def\current:back:desc{##1}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\SubSection{multibib.4ht}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<multibib.4ht\><<< 
% multibib.4ht (|version), generated from |jobname.tex 
% Copyright 2024 TeX Users Group 
|<TeX4ht license text|> 
\Hinput{multibib} 
\endinput 
>>> \AddFile{9}{multibib}

\<add to usepackage\><<<
\Configure{PackageHooks}{multibib.sty}{multibib-hooks.4ht}
>>>


\<multibib-hooks.4ht\><<< 
% multibib-hooks.4ht (|version), generated from |jobname.tex 
% Copyright 2024 TeX Users Group 
|<TeX4ht license text|> 
\:AtEndOfPackage{
|<multibib newcites|>
}
\endinput
>>>  \AddFile{9}{multibib-hooks}

The \Verb"newcites" command uses the \Verb"\@input@" command to load the .bbl file internally. It causes TeX4ht
to load a corresponding .4ht file named as the .bbl file. For example, when you have book.bbl, it will load
book.4ht. It can lead to a fatal error if the document uses a different class than book.

\<multibib newcites\><<<
  \let\orig:newcites\newcites
  \renewcommand\newcites[2]{\let\orig:@input@\@input@\let\@input@\@input\orig:newcites{#1}{#2}\let\@input@\orig:@input@}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\SubSection{reading.4ht}

\<reading.4ht\><<<
% reading.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2008. Eitan M. Gurari
|<TeX4ht copywrite|>
   |<config reading|> 
\Hinput{reading}
\endinput
>>>        \AddFile{6}{reading}

\<config reading\><<<
\def\bbx@thebibitem{% 
  \@itempenalty\z@ 
  \itemsep4\bibitemsep 
  \item\relax 
  \@itempenalty\@M 
  \itemsep\bibitemsep 
  \begingroup 
  \samepage\bfseries 
  \def\finentrypunct{\strut}% 
  \ifnum\bbx@head<\tw@ 
    \usebibmacro{entryhead:full}% 
    \ifbool{bbx:entrykey}% 
      {\def\newblockpunct{% 
         \nobreak\hskip\z@skip\strut 
         \hfill\penalty100\hskip1em\relax 
         \hbox{}\nobreak\hfill\strut}% 
       \def\finentrypunct{% 
         \parfillskip\z@\finalhyphendemerits\z@ 
         \par\nobreak}% 
       \newblock 
       \printfield{entrykey}}% 
      {}% 
  \else 
    \usebibmacro{entryhead:name}% 
  \fi 
  \finentry 
  \endgroup 
  \vskip 1.25pt\relax  `%hrule height`%
  \item\strut} 
>>>

\<\><<<
\renewcommand*{\thebibitem}{% 
  \@itempenalty\z@ 
  \itemsep4\bibitemsep 
  \item\relax 
  \@itempenalty\@M 
  \itemsep\bibitemsep
  \begingroup 
  \samepage\bfseries 
  \usebibmacro{entryhead}% 
  \endgroup 
  \vskip 1pt
  \item\strut 
}
>>>

\<config reading\><<<
\pend:def\bib@macro@entryhead:name{\a:entryhead}
\append:def\bib@macro@entryhead:name{\b:entryhead}
\pend:def\bib@macro@entryhead:full{\a:entryhead:full}
\append:def\bib@macro@entryhead:full{\b:entryhead:full}
\NewConfigure{entryhead:name}{2}
\NewConfigure{entryhead:full}{2}
>>>

\<config biblatex-???\><<<
\let\blx:item\@item %% discarded CVR
\def\@item[#1]{%
  \blx:item[#1]%
  \ifhmode \spacefactor\blx@sf@par\fi 
}
>>>

The definition of \Verb=\@item= ends with \Verb=\leavevmode=, and
biblatex has a \Verb=\blx@leavevmode= definition with the following
spacefactor assignment.  Biblatex uses the spacefactor for checking
different statuses of the compilation.

The following macros were not initialized, hence done now:

 \Verb=\let\blx@resetpuncthook\@empty=
 \Verb=\let\blx@csq@ifkernmark\@empty=
 \Verb=\let\bib@field@entrykey\@empty=

%
% Bug posted by Nicholas Cole <nicholas.cole@gmail.com>
% Bug posted by Joanna Bryson <joanna.j@gmail.com>
%

\Verb=\blx@unitmark= is defined as a new skip to match the introduction
of the same in biblatex.sty v 1.6. [CVR 2011/09/10]

\<config biblatex-???\><<<
\newskip\blx@unitmark %% discarded CVR
\blx@unitmark=10pt plus 1pt minus 1pt
\let\abx@aux@page\@gobbletwo
\AtEndDocument{%
  \def\abx@aux@page#1#2{\blx@addpagesum{#1}{#2}}%
  \def\abx@aux@fnpage#1#2{\blx@addpagesum{#1}{#2}}}
%
\let\blx@resetpuncthook\@empty
\let\blx@csq@ifkernmark\@empty
\def\blx@begunit{% 
  \toggletrue{blx@tempa}% 
  \iftoggle{blx@insert}% 
    {\iftoggle{blx@unit}% 
       {\begingroup 
          \let\blx@begunit\@empty 
          \let\blx@endunit\@empty 
          \blx@unitpunct\blx@postpunct 
        \endgroup 
        \global\togglefalse{blx@unit}% 
        \togglefalse{blx@tempa}} 
       {\blx@postpunct}% 
     \iftoggle{blx@block}% 
       {\begingroup 
          \let\blx@begunit\@empty 
          \let\blx@endunit\@empty 
          \newblockpunct 
        \endgroup 
        \global\togglefalse{blx@block}% 
        \togglefalse{blx@tempa}}%
       {}}% 
    {}% 
  \blx@postpunct 
  \blx@resetpuncthook 
  \iftoggle{blx@tempa}% 
    {}% 
    {\global\togglefalse{blx@insert}}% 
  \csname a:blx@unit\endcsname
  \blx@leavevmode 
  \blx@csq@ifkernmark 
    {}% 
    {\penalty\@M 
     \hskip-\blx@unitmark\relax 
     \hskip\blx@unitmark\relax}% 
  \begingroup
    \Configure{blx@unit}{}{}%
} 
>>>

\<config biblatex-???\><<<
\def\blx@begunit{% 
  \toggletrue{blx@tempa}% 
  \iftoggle{blx@insert}% 
    {\iftoggle{blx@unit}% 
       {\begingroup 
          \let\blx@begunit\@empty 
          \let\blx@endunit\@empty 
          \blx@unitpunct 
        \endgroup 
        \global\togglefalse{blx@unit}% 
        \togglefalse{blx@tempa}}% 
       {}% 
     \iftoggle{blx@block}% 
       {\begingroup 
          \let\blx@begunit\@empty 
          \let\blx@endunit\@empty 
          \newblockpunct 
        \endgroup 
        \global\togglefalse{blx@block}% 
        \togglefalse{blx@tempa}}% 
       {}}% 
    {}% 
  \blx@postpunct 
  \blx@resetpuncthook 
  \iftoggle{blx@tempa}% 
    {}% 
    {\global\togglefalse{blx@insert}}% 
  \csname a:blx@unit\endcsname
  \blx@leavevmode 
  \blx@csqmarkcheck{% 
    \penalty\@M 
    \hskip-\blx@unitmark\relax 
    \hskip\blx@unitmark\relax}% 
  \begingroup
    \Configure{blx@unit}{}{}%
} 
>>>

\<config biblatex-???\><<<
\def\blx@endunit{% 
  \endgroup   
  \csname b:blx@unit\endcsname
  \Configure{blx@unit}{}{}%
  \ifdim\lastskip=\blx@unitmark 
    \unskip\unskip\unpenalty 
    \global\togglefalse{blx@lastins}% 
  \else 
    \global\toggletrue{blx@insert}% 
    \global\toggletrue{blx@lastins}% 
  \fi 
} 
>>>

\<config biblatex-???\><<<
\NewConfigure{blx@unit}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\SubSection{biblatex-chicago.4ht}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  

The tex4ht output contains wrong punctuation, it should follow 
US rules.
\Link[https://tex.stackexchange.com/q/301287/2891]{}{}Source.\EndLink

\<biblatex-chicago.4ht\><<<
% biblatex-chicago.4ht (|version), generated from |jobname.tex
% Copyright 2018 TeX Users Group
|<TeX4ht license text|>
\blx@defbibextras{english}{\uspunctuation}
\Hinput{biblatex-chicago}
\endinput
>>> \AddFile{6}{biblatex-chicago}

BibLaTeX Chicago fails with errors related to Ifthen package. It seems
that we need to load it before BibLaTeX.

\<add to usepackage\><<<
\Configure{PackageHooks}{biblatex-chicago.sty}{biblatex-chicago-hooks.4ht}
>>>

\<biblatex-chicago-hooks.4ht\><<<
% biblatex-chicago-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
\TivhTcats% we need to reset catcodes for : and @ before \RequirePackage
\RequirePackage{ifthen}
\catcode`\:=11\makeatletter
\endinput
>>> \AddFile{9}{biblatex-chicago-hooks}

%%%%%%%%%%%%%
\SubSection{debug.bbx}
%%%%%%%%%%%%%

\<debug.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% debug.4ht                            |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<debug config|>
\Hinput{debug}
\endinput
>>>        \AddFile{5}{debug}

\<debug config\><<<
\def\bbx@fieldlabel#1{%
  \thebibitem
  [\texttt{\makebox[\leftmargin][l]{[#1]}}]}
\def\bbx@subfieldlabel#1{%
  \par\nobreak
  \makebox[6em][l]{\a:subfieldlabel\ttfamily [#1]\b:subfieldlabel}}
\NewConfigure{subfieldlabel}{2}
>>>

%%%%%%%%%%%%%
\SubSection{footnote-dw}
%%%%%%%%%%%%%

\<footnote-dw.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% footnote-dw.4ht                      |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<footnote-dw config|>
\Hinput{footnote-dw}
\endinput
>>>        \AddFile{5}{footnote-dw}

\<footnote-dw config\><<<
\def\bib@macro@footref{\:label{\thefield {entrykey}}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\Section{amstex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  

\<label of amstex.sty\><<<
\edef\l:bel#1{\noexpand\@bsphack
   \expandafter\noexpand\csname iffirstchoice@\endcsname
   \expandafter\noexpand\csname if@filesw\endcsname
   \noexpand \L:bll{#1}%
   \expandafter\noexpand\csname if@nobreak\endcsname
   \noexpand\ifvmode\noexpand\nobreak\noexpand\fi
   \expandafter\noexpand\csname fi\endcsname
   \expandafter\noexpand\csname fi\endcsname
   \expandafter\noexpand\csname fi\endcsname
   \noexpand\@esphack}
\def\L:bll#1{{\let\thepage|=\relax
   \def\protect{\noexpand\noexpand\noexpand}%
   \cur:lbl{}\let\Link|=\:gobbleII \let\EndLink|=\empty \let\ref|=\o:ref
   \a:@currentlabel
   \xdef\@gtempa{\write\@auxout{\string
      \newlabel{#1}{{|<logical label|>}{|<page label|>}|<hyperref label|>}}}%
   }\@gtempa}
\let\l:bel:|=\l:bel
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\Section{varioref.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  

\<varioref.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% varioref.4ht                         |version %
% Copyright (C) |CopyYear.1997.      Eitan M. Gurari         %
|<TeX4ht copyright|>
   |<varioref.sty|> 
\Hinput{varioref}
\endinput
>>>        \AddFile{8}{varioref}

\<varioref.sty\><<<
   |<fix varioref|>
   |<varioref.sty shared config|>
>>>

\<fix varioref\><<<
\let\:vpageref|=\@@vpageref
\def\@@vpageref#1[#2]#3{{%
  \advance\c@vrcnt\@ne
  \expandafter\let\csname r@\the\c@vrcnt @vr\expandafter\endcsname
        \csname r@\the\c@vrcnt @xvr\endcsname
  \advance\c@vrcnt-\@ne  
  \Configure{ref}{}{}{}%
  \:vpageref{#1}[#2]{#3}}}
>>>

\Link[/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/tools/varioref.sty]{}{}%
varioref.sty\EndLink

%%%%%%%%%%%%%%%%%%
\Section{nameref}
%%%%%%%%%%%%%%%%%%

\<nameref.4ht\><<<
% nameref.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2005. Eitan M. Gurari
|<TeX4ht copywrite|>
   |<nameref v.2 configurations|>
\Hinput{nameref}
\endinput
>>>        \AddFile{8}{nameref}

\<nameref configurations\><<<
\let\ltx@label\label
>>>

Bug \#130: Optional argument of a sectional unit does not appear as
the title when \Verb+\nameref+ command is used in a document. The
problem was \Verb+\NR:Title+ expands to the real heading of the
sectional unit. It has been fixed now.
%
% CVR 2010/09/4
% 

\<nameref v.1 configurations\><<<
\def\prf:label{{\ifx \NR:Title\:UnDef \else \NR:Title\fi}%
               {\ifx \NR:Type\:UnDef \else \NR:Type .1\fi}{}}%
\let\NR:StartSec\:StartSec
\let\NR:no@sect\no@sect
\def\no@sect#1#2#3#4#5#6[#7]#8{\gdef\NR:Title{\a:newlabel{#7}}%
     \NR:no@sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{#8}}
\def\:StartSec#1#2#3{%
   \gdef\NR:Title{\a:newlabel{#3}}%
   \gdef\NR:Type{#1}%
   \gdef\@currentlabelname{#3}%
   \NR:StartSec{#1}{#2}{#3}%
}
\pend:defI\begin{\PushMacro\NR:Type \PushMacro\NR:Title}
\pend:defI\end{%
   \PopMacro\NR:Type \PopMacro\NR:Title
   \global\let\NR:Type\NR:Type
   \global\let\NR:Title\NR:Title
}
>>>

\<nameref v.1 configurations\><<<
\def\:tempc#1#2#3#4#5#6[#7]#8{%
   \gdef\NR:Title{\a:newlabel{#7}}%
   \gdef\NR:Type{#1}%
   \o:NR@sect:{#1}{#2}{#3}{#4}{#5}{#6}[#7]{#8}}
\HLet\NR@sect\:tempc

\def\:tempc#1#2#3#4#5{% 
   \gdef\NR:Title{\a:newlabel\ssect:ttl}%
   \gdef\NR:Type{#1}%
   \o:NR@ssect:{#1}{#2}{#3}{#4}{#5}%
   \def\@currentlabelname{\ssect:ttl}}
\HLet\NR@ssect\:tempc

\def\:tempc[#1]#2{%
   \gdef\NR:Title{\a:newlabel{#1}}%
   \o:no@part:[{#1}]{#2}}
\HLet\no@part\:tempc

\def\:tempc#1{%
   \gdef\NR:Title{\a:newlabel{#1}}%
   \o:no@spart:{#1}}
\HLet\no@spart\:tempc

\def\:tempc[#1]#2{% 
   \gdef\NR:Title{\a:newlabel{#1}}%
   \o:NR@chapter:[#1]{#2}} 
\HLet\NR@chapter\:tempc

\def\:tempc#1{%
   \gdef\NR:Title{\a:newlabel\sch:ttl}%
   \o:NR@schapter:{#1}%
   \def\@currentlabelname{\sch:ttl}}
\HLet\NR@schapter\:tempc

% \long\def\:tempc#1[#2]{%
%    \gdef\NR:Type{#1}%
%    \gdef\NR:Title{\a:newlabel{#2}}% 
%   \gdef\@currentlabelname{#2}% 
%   \o:NR@@caption:{#1}[{#2}]% 
% }
% \HLet\NR@@caption\:tempc 

\let\NR@@caption\@caption

\long\def\@caption#1[#2]{%
      \NR@gettitle{#2}%
      \NR@@caption{#1}[{#2}]}%

\AtBeginDocument{% 
  \@ifpackageloaded{listings}{% 
      \def\:tempc#1{% 
         \gdef\NR:Title{\a:newlabel{listing}}%
         \gdef\NR:Type{lstlisting}%
         \o:NROrg@lst@MakeCaption:{#1}% 
         \gdef\@currentlabelname{listing}}
      \HLet\NROrg@lst@MakeCaption\:tempc 
  }{}% 
}
>>>

\<star ch title\><<<
\gdef\sch:ttl{#1}%
>>>

\<star sec title\><<<
\gdef\ssect:ttl{##5}%
>>>

\<nameref v.1 configurations\><<<
\let\T:ref=\::ref
\def\::ref{\protect\T@ref}
\def\T@ref#1{% 
  \@safe@activestrue
  \let\::ref \T:ref
  \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}% 
  \def\::ref{\protect\T@ref}%
  \@safe@activesfalse 
}
>>>

% Version 2 configurations for nameref.4ht was added consequent to
% bugs reported by Martin Heller <mr_heller@yahoo.dk> and  Denis
% Bitouz\'e <dbitouze@wanadoo.fr>. A thorough revamping was needed to
% fix the problems. Apparently, in my tests, all reported problems
% seem to have been fixed, though, \label{...} when used inside the
% caption appears when \nameref'ed. Also, \@begintheorem with amsthm
% loaded needs to be tried and tested thoroughly. Otherwise, the fixes
% are OK as vouched by Martin and Denis.
%
% A new function \defineautorefname has been defined and included in
% the newtheorem definitions so that funny enunciation environment
% names will resolve to the correct printed enunciation name when
% \nameref'd. Users need not separately define the same.
%
% CVR 2012-09-20-12:48
% 

% Bug No: 185
%
% There is spurious "]" in the output document when package hyperref is used
% with tex4ht in new texlive 2013. This issue was reported at
%
% http://tex.stackexchange.com/q/120617/2891
%
% Optional arguments in various heands need to be further grouped in
% nameref.4ht. Done.
%
% CVR 2013-06-28 15:00
% 

% Michal 2016-12-16 
Bug 348: Support for amsmath environments

We can easily define \`|\NR:Type| and \`|\NR:Title| in 
\`|\Configure{@begin}{env name}{definitions}|. I didn't knew about this
configuration until now. It seems to be useful when we need to inject something
into the environment without messing the existing \`|\ConfigureEnv|
definitions.

% Michal 2024-06-15
% I've added use of \a:newlabel{\@currentlabelname} if \NR:Type is empty. 
% It seems to add support for name ref labels that are not supported yet
% We need to empty \NR:Type after \label. I hope this doesn't break anything.
% https://tex.stackexchange.com/a/720647/2891

\<nameref v.2 configurations\><<<
\let\NR:Type\relax
\let\ltx@label\label
\def\prf:label{{\ifx \NR:Title\:UnDef \a:newlabel{\@currentlabelname}\else \NR:Title\fi}%
               {\ifx \NR:Type\relax \else \NR:Type .1\fi}{}}%

\append:defI\label{\let\NR:Title\undefined}

\let\NR:StartSec\:StartSec
\let\NR:no@sect\no@sect
\def\no@sect#1#2#3#4#5#6[#7]#8{\gdef\NR:Title{\a:newlabel{#7}}%
    \gdef\NR:Type{#1}%
    \NR:no@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}}
\def\:StartSec#1#2#3{%
   \gdef\NR:Title{\a:newlabel{#3}}%
   \gdef\NR:Type{#1}%
   \NR:StartSec{#1}{#2}{#3}%
}

\def\:tempc#1#2#3#4#5#6[#7]#8{%
   \gdef\NR:Title{\a:newlabel{#7}}%
   \gdef\NR:Type{#1}%
   \o:NR@sect:{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}}
\HLet\NR@sect\:tempc

\def\:tempc#1#2#3#4#5{%
   \gdef\NR:Title{\a:newlabel\ssect:ttl}%
   \gdef\NR:Type{#1}%
   \o:NR@ssect:{#1}{#2}{#3}{#4}{#5}%
}
\HLet\NR@ssect\:tempc

\def\:tempc[#1]#2{%
   \gdef\NR:Title{\a:newlabel{#1}}%
   \gdef\NR:Type{part}%
   \o:no@part:[{#1}]{#2}}

% this definition clashes with asmart and amsproc classes, so we
% need to skip if these are active
\@ifundefined{opt@amsart.cls}{% 
\@ifundefined{opt@amsproc.cls}{%
\HLet\no@part\:tempc
}{}}{} 


\def\:tempc#1{%
   \gdef\NR:Title{\a:newlabel{#1}}%
   \gdef\NR:Type{part}%
   \o:no@spart:{#1}}
\HLet\no@spart\:tempc

\def\:tempc[#1]#2{%
   \gdef\NR:Title{\a:newlabel{#1}}%
   \gdef\NR:Type{chapter}%
   \o:NR@chapter:[{#1}]{#2}}
\HLet\NR@chapter\:tempc

\def\:tempc#1{%
   \gdef\NR:Title{\a:newlabel\sch:ttl}%
   \o:NR@schapter:{#1}%
   \gdef\NR:Type{chapter}%
}
\HLet\NR@schapter\:tempc

\let\o:NR@@caption\@caption
%
%
% Keith Andrews <kandrews@iicm.edu> reported that \@captype as
% \NR:Type threw an undefined control sequence error. I think
% \@currenvir is safe, there is nothing special about \@captype. 
%   
% use of \index and \label inside caption results in a fatal error
% we need to disable them in \NR:Title

% there can be more problematic commands, so we provide a configuration
% that can be used multiple times - the default value fixes known commands
% but a user can add more of them

\def\a:captioncommandsfix{}
\NewConfigure{CaptionCommandsFix}[1]{\concat:config\a:captioncommandsfix{#1}}
\Configure{CaptionCommandsFix}{
  \let\index\:gobble%
  \let\label\:gobble%
  \let\\\relax% causes issues when \centering is active
}

\long\def\@caption#1[#2]{%
    \gdef\NR:Type{\@currenvir}%
    \begingroup%
    \a:captioncommandsfix
    \protected@xdef\NR:Title{\a:newlabel{#2}}%
    \endgroup%
   \o:NR@@caption{#1}[{#2}]%
}      

\let\o:NRorg@opargbegintheorem\@opargbegintheorem
  \def\@opargbegintheorem#1#2#3{%
    \gdef\NR:Title{\a:newlabel{#3}}%
    \gdef\NR:Type{\@currenvir}%
    \NR@gettitle{#3}%
    \defineautorefname{\@currenvir}{#1}%
    \o:NRorg@opargbegintheorem{#1}{#2}{#3}%
  }%

\let\o:NRorg@begintheorem\@begintheorem
  \def\@begintheorem#1#2{%
    \gdef\NR:Title{\a:newlabel{#1 #2}}%
    \gdef\NR:Type{\@currenvir}%
    \defineautorefname{\@currenvir}{#1}%
    \NR@gettitle{}%
    \o:NRorg@begintheorem{#1}{#2}%
  }%

% I don't know if this was useful for anything
% but we cannot use it anymore
% \AtBeginDocument{%
\@ifpackageloaded{listings}{%
      \def\:tempc#1{%
         \gdef\NR:Title{\a:newlabel{listing}}%
         \gdef\NR:Type{lstlisting}%
         \o:NROrg@lst@MakeCaption:{#1}%
         \gdef\@currentlabelname{listing}}
      \HLet\NROrg@lst@MakeCaption\:tempc
}{}%
  % bug [348]
\def\:tempams{%
    \gdef\NR:Title{\a:newlabel{equation}}%
    \gdef\NR:Type{equation}%
    \gdef\@currentlabelname{equation}%
}

% https://tex.stackexchange.com/a/581856/2891
\@ifpackageloaded{caption}{
  \pend:defIII\caption@beginex{%
    \gdef\NR:Type{\@currenvir}%
    % handle \label and \index in Caption's package
    % version of \caption
    \begingroup%
    \a:captioncommandsfix
    \protected@xdef\NR:Title{\a:newlabel{##2}}%
    \endgroup%
  }
}{}


\@ifpackageloaded{amsmath}{%
     \Configure{@begin}{align}{\:tempams}
     \Configure{@begin}{multline}{\:tempams}
     \Configure{@begin}{equation}{\:tempams}
     \Configure{@begin}{boxed}{\:tempams}
     \Configure{@begin}{equations}{\:tempams}
     \Configure{@begin}{equation}{\:tempams}
     \Configure{@begin}{gather*}{\:tempams}
     \Configure{@begin}{gather}{\:tempams}
     \Configure{@begin}{genfrac}{\:tempams}
     \Configure{@begin}{measure@}{\:tempams}
     \Configure{@begin}{multline*}{\:tempams}
     \Configure{@begin}{multline}{\:tempams}
     \Configure{@begin}{overset}{\:tempams}
     \Configure{@begin}{smallmatrix}{\:tempams}
     \Configure{@begin}{split}{\:tempams}
     \Configure{@begin}{subarray}{\:tempams}
     \Configure{@begin}{substack}{\:tempams}
     \Configure{@begin}{underset}{\:tempams}
     \Configure{@begin}{xleftarrow}{\:tempams}
     \Configure{@begin}{xrightarrow}{\:tempams}
  }{
     \Configure{@begin}{equation}{\:tempams}
}

\let\T:ref=\::ref
\def\::ref{\@ifstar{\protect\T@ref}{\protect\T@ref}}
\def\T@ref#1{%
  \@safe@activestrue%
  \let\::ref\T:ref%
  \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}%
  \def\::ref{\@ifstar{\protect\T@ref}{\protect\T@ref}}%
  \@safe@activesfalse%
}

\gdef\defineautorefname#1#2{%
    \expandafter\gdef\csname #1autorefname\endcsname{#2}}
\defineautorefname{theorem}{Theorem}

\Configure{newlabel}
   {\csname cur:th\endcsname \csname :currentlabel\endcsname}
   {\string\csname\space :autoref\string\endcsname 
     {\NR:Type}#1}

\ifx \@currentlabelname\:UnDef
   \let\@currentlabelname\empty
\fi

\pend:defIII\@setref{\edef\RefArg{##3}}
\append:defIII\@setref{\let\:autoref\:gobble}
\let\:autoref\:gobble

>>>

%%%%%%%%%%%%%%%%%%
\Section{cleveref}


\<cleveref.4ht\><<<
% cleveref.4ht (|version), generated from |jobname.tex
% Copyright 2018-2023 TeX Users Group
|<TeX4ht license text|>

|<cleveref refstepcounter|>
|<cleveref links|>
|<cleveref amsthm|>

\Hinput{cleveref}

\endinput
>>> \AddFile{8}{cleveref}

This is basic support for the cleveref package. 
\Link[https://tex.stackexchange.com/a/220345/2891]{}{}Source.\EndLink

\<cleveref refstepcounter\><<<

% orig:refstepcounter is saved in cleveref-hooks.4ht
\let\cref@old@refstepcounter\orig:refstepcounter%
\def\refstepcounter{%
  \@ifnextchar[{\refstepcounter@optarg}{\refstepcounter@noarg}%]
}%

% fix for TeX4ht label mechanism
\def\cref:currentlabel#1{|<def :currentlabel for refstepcounter|>%
  \anc:lbl r{#1}%
}

\def\refstepcounter@noarg#1{%
  \cref@old@refstepcounter{#1}%
  \cref@constructprefix{#1}{\cref@result}%
  \@ifundefined{cref@#1@alias}%
    {\def\@tempa{#1}}%
    {\def\@tempa{\csname cref@#1@alias\endcsname}}%
  \protected@xdef\cref@currentlabel{%
    [\@tempa][\arabic{#1}][\cref@result]%
    \csname p@#1\endcsname\csname the#1\endcsname}%
    \cref:currentlabel{#1}%
    }%
\def\refstepcounter@optarg[#1]#2{%
  \cref@old@refstepcounter{#2}%
  \cref@constructprefix{#2}{\cref@result}%
  \@ifundefined{cref@#1@alias}%
    {\def\@tempa{#1}}%
    {\def\@tempa{\csname cref@#1@alias\endcsname}}%
  \protected@xdef\cref@currentlabel{%
    [\@tempa][\arabic{#2}][\cref@result]%
    \csname p@#2\endcsname\csname the#2\endcsname}%
    \cref:currentlabel{#2}%
  }%
>>>

Support for links from the \Verb|\cref| command. 
\Link[https://tex.stackexchange.com/a/475664/2891]{}{}More information.\EndLink

\<cleveref links\><<<
\ifdefined\@firstoffive\else%
  \def\@firstoffive#1#2#3#4#5{#1}%
\fi
\def\:tempa#1#2{\bgroup%
  \def\rEfLiNK##1##2{\Link{##1}{}}%
  \def\XRrEfLiNK[##1]##2##3{\Link[##1]{##2}{}}% handle links from Xr and Xr-hyper
  \cref@getlabel{#2}{\@templabel}%
  #1{% add links only around reference numbers, not the previous text, because it can contain punctuation
    \expandafter\expandafter\expandafter\@firstoffive\csname r@#2\endcsname{}{}{}{}{}%
  \@templabel\EndLink}{}{}%
  \egroup%
}%

\HLet\@@@setcref=\:tempa
>>>

Fixes for the amsthm cleveref redefinitions.
\Link[https://tex.stackexchange.com/q/491933/2891]{}{}More information.\EndLink

\<cleveref amsthm\><<<
\@ifpackageloaded{amsthm}{
  \let\cref@thmnoarg\@thm%
  \def\@thm{\@ifnextchar[{\cref@thmoptarg}{\cref@thmnoarg}}%]
  \def\:tempb[#1]#2#3#4{%
   % call original amsthm theorem definition, but
   % disable \:thm in order to prevent infinite loop
   \let\:thm\:gobble%
   \cref@thmnoarg{#2}%
   \o:cref@thmoptarg:[#1]{#2}{#3}{#4}
  }%
  \HLet\cref@thmoptarg\:tempb%
}{}%
>>>


Cleveref depends on internal Hyperref macro when Hyperref is loaded. It causes crash,
because Hyperref exits before this macro is defined.
\Link[https://tex.stackexchange.com/a/540277/2891]{}{}More information\EndLink.

\<add to usepackage\><<<
\Configure{PackageHooks}{cleveref.sty}{cleveref-hooks.4ht}
>>>

\<cleveref-hooks.4ht\><<<
% cleveref-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020-2021 TeX Users Group
|<TeX4ht license text|>
\let\HyOrg@addtoreset\@addtoreset
% fixes for \refstepcounter
\let\orig:refstepcounter\refstepcounter
\let\orig:@thm\@thm
\:AtEndOfPackage{%
\let\refstepcounter\orig:refstepcounter
\let\@thm\orig:@thm
}

>>> \AddFile{9}{cleveref-hooks}

%%%%%%%%%%%%%%%%%%
\Section{authblk}

\<authblk.4ht\><<<
% authblk.4ht (|version), generated from |jobname.tex
% Copyright 2017-2022 TeX Users Group
|<TeX4ht license text|>
|<authblk maketitle|>
\Hinput{authblk}
\endinput
>>> \AddFile{8}{authblk}

This is a basic fix for authblk package. 
\Link[https://tex.stackexchange.com/a/309246/2891]{}{}Original issue.\EndLink

This is modified  version of TeX4ht maketitle, with support for arguments in
@author, and it uses AB@maketitle, as o:maketitle: caused infinite loop.

\<authblk maketitle\><<<
\let\o:maketitle:|=\maketitle
\def\maketitle{\bgroup 
   |<adjust minipageNum for setcounter footnote 0|>%
   \ifx \EndPicture\:UnDef  
      \def\sec:typ{title}%
      \Configure{HtmlPar}{}{}{}{}%
      \Configure{newpage}{}%
      \ConfigureEnv{center}{\empty}{}{\empty}{\empty}
      \renewenvironment{tabular}[2][]{\begin{center}}{\end{center}}
      \ConfigureEnv{tabular}{\empty}{}{}{}%
      |<title for TITLE|>%
      \pend:def\@title{\a:ttl}\append:def\@title{\b:ttl}%
      \pend:def\@date{\a:date}\append:def\@date{\b:date}%
      \pend:defI\@author{\a:author}\append:def\@author{\b:author}%
      |</and for maketitle|>%
   \fi 
   \pic:gobble\a:mktl  \AB@maketitle \pic:gobble\b:mktl
   \egroup \let\maketitle|=\empty}
>>>

%%%%%%%%%%%%%%%%%%
\Section{geometry}

Geometry with {\tt showframe} option writes spurious lines before 
every DVI page in the XML output.
\Link[https://puszcza.gnu.org.ua/bugs/?303]{}{}Bug report.\EndLink

\<geometry.4ht\><<<
% geometry.4ht (|version), generated from |jobname.tex
% Copyright 2016 TeX Users Group
|<TeX4ht license text|>
|<geometry configurations|>
\Hinput{geometry}
\endinput
>>>    \AddFile{8}{geometry}

\<geometry configurations\><<<
\renewcommand*{\Gm@pageframes}{}
>>>

%%%%%%%%%%%%%%%%%%
\Section{by name}
%%%%%%%%%%%%%%%%%%

\<byname.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% byname.4ht                           |version %
% Copyright (C) |CopyYear.2005.       Eitan M. Gurari         %
|<TeX4ht copyright|>
   |<byname configurations|>
\Hinput{byname}
\endinput
>>>        \AddFile{8}{byname}

\<byname configurations\><<<
\def\prf:label{{\ifx \BNa:Title\:UnDef \else \BNa:Title\fi}%
               {\ifx \BNb:Title\:UnDef \else \BNb:Title\fi}{}}% 
\def\byn@melabel#1#2{% 
    \gdef\NRa:Title{\a:newlabel{#1}}% 
    \gdef\NRb:Title{\a:newlabel{#1}}% 
    \gdef\@currnamelabel{{\a:newlabel{#1}}{\a:newlabel{#1}}}%
} 

\@ifpackageloaded{hyperref}{% 
   \def\byname#1{% 
       \expandafter\@setref\csname name@#1\endcsname\@secondoftwo{#1}% 
       } 
   \def\byshortname#1{% 
       \expandafter\@setref\csname name@#1\endcsname\@firstoftwo{#1}% 
       } 
}{}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{xr.sty: Cross-Document References}
%%%%%%%%%%%%%%%%%%%%%

Defines a command \`'\externaldocument' for importing exterla aux
files from foreugn sources. Should be called after \''\Preamble', and
before \''\begin{document}'.

\<xr.4ht\><<<
% xr.4ht (|version), generated from |jobname.tex
% Copyright 1997-2023 TeX Users Group
|<TeX4ht copywrite|>
   |<fix xr|>
   |<fix xr-nonhyper|>
\Hinput{xr}
\endinput
>>>        \AddFile{7}{xr}

\<add to usepackage\><<<
\Configure{PackageHooks}{xr.sty}{xr-hooks.4ht}
>>>

\<xr-hooks.4ht\><<<
% xr-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht copywrite|>
|<xr cut files|>
|<wait with xr|>
>>>\AddFile{7}{xr-hooks}

\<wait with xr\><<<
\:AtEndOfPackage{\let\XR:\XR@ 
   \def\XR@[#1]#2{%
    % save directory for the linked file
    \filename@parse{#2}%
    % \filename@base is filename, \filename@area directory
    \expandafter\xdef\csname xr:dir:\filename@base\endcsname{\filename@area}%
		\:declare:xref:files{\filename@area\filename@base}{\filename@area}% declare directory for cut files
    \Configure{AtBeginDocument}{\XR:[#1]{#2}}{}}%
}
>>>

\<fix xr\><<<
\let\XR:loop=\XR@loop
\def\XR@loop#1{%
   \def\:temp##1.aux{|<load xref of aux|>}%
   \catcode`\:=11 
     |<xref for xr|>%
     \:temp#1%
   \catcode`\:=12
   \XR:loop{#1}%
}
>>>

\<load xref of aux\><<<
\openin15=##1.xref 
\ifeof15
   \:warning{missing ##1.xref for ##1.aux}%
   \let\:temp\empty    
\else
   \def\:temp{\input ##1.xref}%
\fi
\closein15  \:temp
>>>

\<xref for xr\><<<
\expandafter\ifx \csname xr:CrossWord\endcsname\relax
  \let\xr:CrossWord=\Cross:Word
  \def\Cross:Word##1##2{%
     \expandafter\let\csname  cw:\cw:format{##1##2}\endcsname\:UnDef
     \xr:CrossWord{##1}{##2}}%
\fi
>>>

\<fix xr-nonhyper\><<<
\def\XRrEfLiNK[#1]#2#3{%
  \filename@parse{#1}% Get basename of the linked html file, 
  % xr:dir\filename@base contains file's directory
  \a:xr[\csname xr:dir:\filename@base\endcsname#1]{#2}{}%
   \ifx\hyperrefLabel\:UnDef #3\else \hyperrefLabel\fi \b:xr}
\NewConfigure{xr}{2}
\Configure{xr}{\Link}{\EndLink}
\def\XR:rEfLiNK#1#2{{\xr:rEfLiNK#1}{\xr:rEfLiNK#2}}
\def\xr:rEfLiNK#1#2{\noexpand\XRrEfLiNK[\Get:HFile#2-]{#2}}
\def\Get:HFile#1-#2-{\:LikeRef{)F\:gobble #1F-}}
>>>

For xref file

\Verbatim
\:CrossWord{)F1F-}{essai.html}{1}%
\:CrossWord{)Qx1-10000.1}{1}{1}%
\EndVerbatim

\''\XGet:HFile' acts on \''x1-10000.1' to retrieve the 1 between \`'x' and
\`'-'. The if acts on \`')F1F-' to get the file name. Where the \`'x'
got into the picture? Did \''\aXrefFile' introduced it? where? 

We must also test for references with the @cref suffix - these are automatically
created by Cleveref and contain meta info about reference types.

\<xr newlabel\><<<
\regex_match:nnTF{@cref}{#2}% we must handle cleveref meta references
{\expandafter\xdef\csname r@\XR@prefix#2\endcsname{#3}}%
{\expandafter\xdef\csname r@\XR@prefix#2\endcsname{\XR:rEfLiNK #3}}%
>>>

\<fix xr\><<<
\ExplSyntaxOn
\long\def\XR@test#1#2#3#4\XR@{%
  \ifx#1\newlabel
     |<xr newlabel|>%
  \else\ifx#1\@input
     \edef\XR@list{\XR@list#2\relax}%
  \fi\fi
  \ifeof\@inputcheck\expandafter\XR@aux
  \else\expandafter\XR@read\fi}
\ExplSyntaxOff
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{xr-hyper.sty: Hyperref-Oriented Cross-Document References}
%%%%%%%%%%%%%%%%%%%%%

\<xr-hyper.4ht\><<<
% xr-hyper.4ht (|version), generated from |jobname.tex
% Copyright 2003-2023 TeX Users Group
|<TeX4ht copywrite|>
   |<fix xr|>
   |<fix xr-hyper|>
\Hinput{xr}
\endinput
>>>        \AddFile{7}{xr-hyper}


Hyperref pasess five arguments to \`|\newlabel|, we must adapt \`|\XR:rEfLiNK| to that

\<fix xr-hyper\><<<
\def\XRrEfLiNK[#1]#2#3{%
  \filename@parse{#1}% Get basename of the linked html file, 
  % xr:dir\filename@base contains file's directory
  \a:xr[\csname xr:dir:\filename@base\endcsname#1]{#2}{}%
  \ifx\hyperrefLabel\:UnDef #3\else \hyperrefLabel\fi \b:xr}
\NewConfigure{xr}{2}
\Configure{xr}{\Link}{\EndLink}
\def\XR:rEfLiNK#1#2#3#4#5{{\xr:rEfLiNK#1}{\xr:rEfLiNK#2}{\xr:rEfLiNK#3}}
\def\xr:rEfLiNK#1#2{\noexpand\XRrEfLiNK[\Get:HFile#2-]{#2}}
\def\Get:HFile#1-#2-{\:LikeRef{)F\:gobble #1F-}}
>>>


\<add to usepackage\><<<
\Configure{PackageHooks}{xr-hyper.sty}{xrhyper-hooks.4ht}
>>>

\<xrhyper-hooks.4ht\><<<
% xrhyper-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020-2022 TeX Users Group
|<TeX4ht license text|>
|<xr cut files|>
|<wait with xr-hyper|>
>>> \AddFile{9}{xrhyper-hooks}

xr-hyper add optional argument after mandatory argument of
\`|\externaldocument|. It is a full path to the PDF file. We don't really need
it, so we can safely eat that.

\<wait with xr-hyper\><<<
\:AtEndOfPackage{\let\XR:\XR@
    \def\XR@[#1][#2]#3{%
       % save directory for the linked file
      \filename@parse{#3}%
      % \filename@base is filename, \filename@area directory
      \expandafter\xdef\csname xr:dir:\filename@base\endcsname{\filename@area}%
      \:declare:xref:files{\filename@area\filename@base}{\filename@area}% declare directory for cut files
      \AtBeginDocument{\XR:[#1][#2]{#3}}
    }%
}
>>>

Declare file directory for filtes that were cut from the main file (using options "3", "4", etc.)

\<xr cut files\><<<
\ExplSyntaxOn
% detect )F[number]F- using l3regex
\regex_new:N \l_xref_filename
\regex_set:Nn \l_xref_filename {F\d+F}
% save all filenames declared in the xref file
\def\:extract:filename:from:xref#1#2#3{%
  \regex_match:NnTF \l_xref_filename {#1}{%
   \filename@parse{#2}
   \expandafter\xdef\csname xr:dir:\filename@base\endcsname{\:tempa}
}{}
}
\def\:declare:xref:files#1#2{
  \begingroup
    % we need to find filenames of cutfiles
    % we will use \filename@parse again, so we need to save the directory name
    \edef\:tempa{#2}%
    \def\:CrossWord##1##2##3{\:extract:filename:from:xref{##1}{##2}{\:tempa}}%
    \catcode`\:=11% : is not letter at this moment
    \InputIfFileExists{#1.xref}{}{}% load saved cross-references
    \endgroup
}

\ExplSyntaxOff
>>>

%%%%%%%%%%%%%%%%%%
\Section{eso-pic}
%%%%%%%%%%%%%%%%%%

Eso-pic can add some code at every page, using picture commands. This results in lots on unvanted
images in the HTML file. It seems best to just disable this functionality.


\<add to usepackage\><<<
\Configure{PackageHooks}{eso-pic.sty}{esopic-hooks.4ht}
>>>

\<esopic-hooks.4ht\><<<
% esopic-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{eso-pic}
\providecommand\AddToShipoutPicture{\@ifstar\@gobble\@gobble}
\let\AddToShipoutPictureBG\AddToShipoutPicture
\let\AddToShipoutPictureFG\AddToShipoutPicture
\let\ClearShipoutPictureBG\relax
\let\ClearShipoutPictureFG\relax
\let\ClearShipoutPicture\relax
\providecommand*\LenToUnit[1]{}
\providecommand\gridSetup[6][]{}
>>> \AddFile{9}{esopic-hooks}

%%%%%%%%%%%%%%%%%%
\Section{showframe}
%%%%%%%%%%%%%%%%%%

The Showframe package is not useful in HTML mode. It also breaks TeX4ht, so we should block it.


\<add to usepackage\><<<
\Configure{PackageHooks}{showframe.sty}{showframe-hooks.4ht}
>>>

\<showframe-hooks.4ht\><<<
% showframe-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{showframe}
>>> \AddFile{9}{showframe-hooks}

%%%%%%%%%%%%%%%%%
\Section{expl3.sty}
%%%%%%%%%%%%%%%%%

Expl3 package makes some unicode characters active. This clashes
with out active characters for XeTeX, so we must deactivate them 
temporarily.

\<add to usepackage\><<<
\Configure{PackageHooks}{expl3.sty}{expl3-hooks.4ht}
>>>

\<expl3-hooks.4ht\><<<
% expl3-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
\ifdefined\XeTeXversion%
\xenunidelblock{Latin-expl3}%
\:AtEndOfPackage{\xeuniuseblock{Latin-expl3}}
\fi
>>> \AddFile{9}{expl3-hooks}

%%%%%%%%%%%%%%%%%%
\Section{savetrees.sty}
%%%%%%%%%%%%%%%%%%

This fix is really simple. Savetrees package doesn't make sense in HTML and it
breaks TeX4ht, so we just disable it.

\<add to usepackage\><<<
\Configure{PackageHooks}{savetrees.sty}{savetrees-hooks.4ht}
>>>

\<savetrees-hooks.4ht\><<<
% savetrees-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{savetrees}
>>> \AddFile{9}{savetrees-hooks}

%%%%%%%%%%%%%%%%%
\Section{newcomputermodern.sty}
%%%%%%%%%%%%%%%%%

This is a really nice variant of Computer Modern in OpenType format. The
rendered text is a bit darker and more readable than Latin Modern. It also
supports Cyrillics, Hebrew and Greek.

We need to disable it with TeX4ht though, because it forces loading of OpenType
fonts which results in compilation failure.


\<add to usepackage\><<<
\Configure{PackageHooks}{newcomputermodern.sty}{newcomputermodern-hooks.4ht}
>>>

\<newcomputermodern-hooks.4ht\><<<
% newcomputermodern-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{newcomputermodern}
>>> \AddFile{9}{newcomputermodern-hooks}

\<add to usepackage\><<<
\Configure{PackageHooks}{newcomputermodern.sty}{newcomputermodern-hooks.4ht}
>>>

%%%%%%%%%%%%%%%%%
\Section{fontawesome}
%%%%%%%%%%%%%%%%%

We need to prevent use of OpenType fonts with Fontawesome5 package.

\<add to usepackage\><<<
\Configure{PackageHooks}{fontawesome5-utex-helper.sty}%
{fontawesome5-utex-helper-hooks.4ht}
\Configure{PackageHooks}{fontawesome5.sty}{fontawesome5-hooks.4ht}
>>>

This file prevents loading of OpenType fonts that are loaded automatically
when LuaLaTeX or XeLaTeX are used. It loads Type 1 fonts instead.

\<fontawesome5-utex-helper-hooks.4ht\><<<
% fontawesome5-utex-helper-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{fontawesome5-utex-helper}
\RequirePackage{fontawesome5-generic-helper}
\endinput
>>> \AddFile{9}{fontawesome5-utex-helper-hooks}

It seems that catcode of : character is wrongly set after end of this package
when we use package hooks. It is probably because of some Expl3 catcode
checks. We need to reset the catcode manually. 

\<fontawesome5-hooks.4ht\><<<
% fontawesome5-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
\:AtEndOfPackage{\catcode`\:=12}
\endinput
>>> \AddFile{9}{fontawesome5-hooks}

Finally, we can provide some configuration for Fontawesome itself. It turns all
icons to pictures by TeX4ht conversion.

\<fontawesome5.4ht\><<<
% fontawesome5.4ht (|version), generated from |jobname.tex
% Copyright 2021-2024 TeX Users Group
|<TeX4ht license text|>
\NewConfigure{fontawesome}{2}
\ExplSyntaxOn
\cs_new_protected:Nn\temp:nn{%
\def\:fontawesomeicon{#2}% to be used in the alt text
\a:fontawesome%
\o:fontawesome_use_icon:nn:{#1}{#2}
\b:fontawesome}

\HLet\fontawesome_use_icon:nn\temp:nn
\ExplSyntaxOff
\Configure{fontawesome}{\Picture+[icon: \:fontawesomeicon]{}}{\EndPicture}
\Hinput{fontawesome5}
\endinput
>>> \AddFile{9}{fontawesome5}



%%%%%%%%%%%%%%%%%
\Section{biblatex}
%%%%%%%%%%%%%%%%%

This is a fix for XeLaTeX, it sometimes 
reported that English language strings
can't be loaded, even if they were loaded
correctly. This just removes the error message.

\<add to usepackage\><<<
\Configure{PackageHooks}{biblatex.sty}{biblatex-hooks.4ht}
>>>

\<biblatex-hooks.4ht\><<<
% biblatex-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020-2021 TeX Users Group
|<TeX4ht license text|>
\:AtEndOfPackage{%
  \def\blx@mknoautolang{%
    \blx@lbxinput{\blx@languagename}%
    {}{}%
  }%
  |<fix biblatex lang handling|>
}
%|<early biblatex nameref|>
>>> \AddFile{9}{biblatex-hooks}

Some biblatex styles reported error missing English language. 
\Link[https://tex.stackexchange.com/q/469718/2891]{}{}For example here\EndLink.
The issue was that patched version of \Verb|\IfFileExists| command contains
some additional tokens that caused the \Verb|\@firstoftwo| command to read
a wrong code. The saved version of that command must be used instead.

\<fix biblatex lang handling\><<<
\def\blx@lbxinput@iii#1#2{%
  \global\csundef{blx@lng@#2}%
  \:IfFileExists{#1.lbx}
    {\blx@lbxinput@iv{#2}{#1}{language '#2' -> '#1'}}
    {\ifcsdef{blx@suffmaptried@#2}
      {}
      {\blx@warning@noline{%
          File '#1.lbx' not found!\MessageBreak
          Ignoring mapping '#2' -> '#1'}%
       \global\cslet{blx@suffmaptried@#2}\@empty}%
     \blx@lbxinput@iv{#2}{#2}{language '#2'}}}
>>>

Updata 2021/12/08: There is still error. I had to reintroduce Nameref to
hyperref-hooks.4ht, because it's removal broke lot of documents that don't 
use BibLaTeX. BibLaTeX + Hyperref remain broken.

Update 2021/11/04: the following information is here for the historical reasons.
We don't load Nameref from BibLaTeX anymore. I've found that we need to 
remove Nameref from hyperref-hooks.4ht and then everything works.

Historical info: 
BibLaTeX and TeX4ht both redefine the \Verb|\ifthenelse| command. We take care 
of it in biblatex.4ht by defining the \Verb|\TE@hook| command. But some BibLaTeX
styles still have issues (namely "anbt"). I've found that loading of "nameref"
package helps in this case. 
\Link[https://tex.stackexchange.com/a/619816/2891]{}{}More info\EndLink.

We also need to post-pone the Nameref loading outside of the hooks file, as
it seems to cause other issues if we used \Verb|\RequirePackage| directly.
We can utilize the LaTeX hook system for that.
\Link[https://tex.stackexchange.com/a/620503/2891]{}{}See this issue\EndLink.

This code is not used anymore:
\<early biblatex nameref\><<<
\AddToHook{package/before/biblatex}{\RequirePackage{nameref}}
>>>

%%%%%%%%%%%%%%%%%
\Section{xeCJK}
%%%%%%%%%%%%%%%%%

The xeCJK package makes CJK characters active and the macros they call fall.
Best what we can do is to block it.

We need to load fontspec explicitly, block the package, define some basic commands
this package provides and load definitions for CJK Unicode block.

Note that not all commands are provided, more can be added on user request.

\<add to usepackage\><<<
\Configure{PackageHooks}{xeCJK.sty}{xecjk-hooks.4ht}
>>>

\<xecjk-hooks.4ht\><<<
% xecjk-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020-2023 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{xeCJK}
\:AtEndOfPackage{%
  \RequirePackage{fontspec}
}
\DeclareDocumentCommand\setCJKmainfont{o m o}{}
\let\setCJKsansfont\setCJKmainfont
\let\setCJKmonofont\setCJKmainfont

\DeclareDocumentCommand\setCJKfamilyfont {m o m }{}
\DeclareDocumentCommand\newCJKfontfamily {o m o m}{\expandafter\gdef\csname #2\endcsname{\relax}}

\DeclareDocumentCommand\xeCJKsetup{m}{}
% }
\AtBeginDocument{%
  \ifdefined\xeuniuseblock%
  \xeuniuseblock{CJK}%
  \fi%
}
>>> \AddFile{9}{xecjk-hooks}

%%%%%%%%%%%%%%%%%
\Section{unicode-math}
%%%%%%%%%%%%%%%%%

This is a basic support for Unicode-math. It blocks it's loading,
and defines the \`'\setmathfont' command, which can be used in the
document.

\<add to usepackage\><<<
\Configure{PackageHooks}{unicode-math.sty}{unicode-math-hooks.4ht}
>>>

\<unicode-math-hooks.4ht\><<<
% unicode-math-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2021-2024 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{unicode-math}
\TivhTcats% we need to reset catcodes for : and @ before \RequirePackage
\@ifpackageloaded{fontspec}{}
{\RequirePackage{fontspec}} % it is loaded by unicode-math
\RequirePackage{amsmath}
\DeclareDocumentCommand \setmathfont { O{} m O{} }{}
\DeclareDocumentCommand \unimathsetup {m} {} 
\catcode`\:=11\makeatletter
% declare prime and backprime Unicode symbols. they shouldn't be used with
% explicit superscripts
\DeclareDocumentCommand\dprime{}{\sp{\ht:special{t4ht@+\string&{35}x2033;}x}}
\DeclareDocumentCommand\trprime{}{\sp{\ht:special{t4ht@+\string&{35}x2034;}x}}
\DeclareDocumentCommand\qprime{}{\sp{\ht:special{t4ht@+\string&{35}x2057;}x}}
\DeclareDocumentCommand\backprime{}{\sp{\ht:special{t4ht@+\string&{35}x2035;}x}}
\DeclareDocumentCommand\backdprime{}{\sp{\ht:special{t4ht@+\string&{35}x2036;}x}}
\DeclareDocumentCommand\backtrprime{}{\sp{\ht:special{t4ht@+\string&{35}x2037;}x}}
\endinput
>>> \AddFile{9}{unicode-math-hooks}

%%%%%%%%%%%%%%%%%
\Section{ctex}
%%%%%%%%%%%%%%%%%

We need to pass some options to Ctex to prevent it from font loading.
It is also necessary to take special care with LuaTeX, as it loads
configuration file that caused TeX4ht to fail. We block this file 
from loading.


\<add to usepackage\><<<
\Configure{PackageHooks}{ctex.sty}{ctex-hooks.4ht}
>>>

\<ctex-hooks.4ht\><<<
% ctex-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
\PassOptionsToPackage{fontset=none,autoindent=false}{ctex}
\ExplSyntaxOn
\let\o:file_input\file_input:n% patch \file_input:n to block
                              % ctex-engine-luatex.def from loading
\xdef\ctex:luaname{\detokenize{ctex-engine-luatex.def}}
\def\:tempa#1{%
  \edef\:tempb{#1}%
  \ifx\:tempb\ctex:luaname%
  % this macro is defined in the blocked file, just add dummy definition
  \cs_new_protected:Npn \ctex_add_to_selectfont:n ##1{}%
  \else%
  \o:file_input{#1}%
  \fi%
}
\let\file_input:n\:tempa
\:AtEndOfPackage{%
\let\file_input:n\o:file_input
}
\ExplSyntaxOff
>>> \AddFile{9}{ctex-hooks}

Add dummy .4ht file. We may use it in the future.

\<ctex.4ht\><<<
% ctex.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
\Hinput{ctex}
\endinput
>>> \AddFile{9}{ctex}

%%%%%%%%%%%%%%%%%
\Section{ctexart}
%%%%%%%%%%%%%%%%%

This is a class relatex to Ctex. It fails with a fatal error 
with LuaTeX and XeTeX, so we need to suppress lot of it's behavior.

We need to use the LaTeX hook mechanism to load the patch file
before the class itself.

\<add to usepackage\><<<
\AddToHook{class/ctexart/before}{\input{ctexart-hooks.4ht}}
>>>

\<ctexart-hooks.4ht\><<<
% ctexart-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
\ExplSyntaxOn

% prevent multiple execution of this file
\ifdefined\l_save_engine_str\endinput\fi
\str_new:N \l_save_engine_str 
% stop processing if the engine is pdftex, we want to change processing only for LuaTeX
\def\l_save_engine_str{pdftex}
\str_if_eq:NNTF \c_sys_engine_str\l_save_engine_str{\ExplSyntaxOff\endinput}{}

% the luatexja package causes fatal error
\:dontusepackage{luatexja}

% fix compilation errors 
\AddToHook{package/ctexhook/after}{
  % don't let ctex to insert any files
  \cs_set:Npn \ctex_file_input:n #1{}
  % define some macros that are declared in the input files, and which are needed in the class
  \cs_set:Npn \ctex_add_to_selectfont:n #1{}
  \dim_new:N \ccwd
  \skip_new:N \l__ctex_ccglue_skip
  \cs_set_protected:Npn \ctex_update_em_unit:
  { \dim_set:Nn \ccwd { \f@size \p@ } }
  \cs_set_protected:Npn \ctex_update_ccglue: {}
}

\ExplSyntaxOff
\endinput
>>> \AddFile{9}{ctexart-hooks}

Add dummy .4ht file. We may use it in the future.

\<ctexart.4ht\><<<
% ctexart.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
\Hinput{ctexart}
\endinput
>>> \AddFile{9}{ctexart}

%%%%%%%%%%%%%%%%%
\Section{luatexja}
%%%%%%%%%%%%%%%%%

The LuaTeX-ja package produces fatal errors with \TeX4ht, so we need to disable it. 
The same is true also for the luatexja-fontspec package.

\<add to usepackage\><<<
\Configure{PackageHooks}{luatexja.sty}{luatexja-hooks.4ht}
\Configure{PackageHooks}{luatexja-fontspec.sty}{luatexja-hooks.4ht}
>>>

\<luatexja-hooks.4ht\><<<
% luatexja-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{luatexja}
\:dontusepackage{luatexja-fontspec}
\endinput
>>> \AddFile{9}{luatexja-hooks}


%%%%%%%%%%%%%%%%%
\Section{polyglossia}
%%%%%%%%%%%%%%%%%

The direction option for Polyglossia's language selection commands causes
tex4ht support for XeLaTeX fail. tex4ht use a different mechanism for direction
handling, so we can just disable it.

User needs to use \`'\Configure{LRdir}'to achieve the correct direction.


\<add to usepackage\><<<
\Configure{PackageHooks}{polyglossia.sty}{polyglossia-hooks.4ht}
>>>

\<polyglossia-hooks.4ht\><<<
% polyglossia-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
\ExplSyntaxOn
\:AtEndOfPackage{
\ifdefined\orig_polyglossia@keys_define_lang:n\else
\cs_set_eq:NN\orig_polyglossia@keys_define_lang:n\polyglossia@keys_define_lang:n
%\let\orig_polyglossia@keys_define_lang:n\polyglossia@keys_define_lang:n
\cs_set_protected:Npn \polyglossia@keys_define_lang:n #1 {
   \orig_polyglossia@keys_define_lang:n{#1}
   \keys_define:nn {polyglossia}{
     #1 / direction
     .  code:n = {},
     #1 / script
     .  code:n = {\ifdefined\XeTeXversion
       \edef\:tempscript{\str_uppercase:f{\tl_head:n {#1}}\tl_tail:n{#1}}
       \xeuniuseblock{#1}
       \expandafter\xeuniuseblock\expandafter{\:tempscript}
     \fi},
   }
}
\def\RequireBidi{}%
\fi
}
\ExplSyntaxOff
>>> \AddFile{9}{polyglossia-hooks}

\<polyglossia.4ht\><<<
% polyglossia.4ht (|version), generated from |jobname.tex
% Copyright 2019-2021 TeX Users Group
|<TeX4ht license text|>
\NewConfigure{PolyglossiaRtl}{2}
|<arabic digits|>
\Hinput{polyglossia}
\endinput
>>> \AddFile{9}{polyglossia}

Fix for French Polyglossia. It makes lot of characters active. This can clash 
with TeX4ht. For example : character in title results in fatal error.

\<gloss-french.4ht\><<<
% gloss-french.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
\pend:def\french@punctuation{\bgroup\let\nobreakspace\space}
\append:def\french@punctuation{\egroup}
\Hinput{gloss-french}
\endinput
>>> \AddFile{9}{gloss-french}



%%%%%%%%%%%%%%%%%
\Section{fontspec}
%%%%%%%%%%%%%%%%%

We have to alter package fontspec loading, as it causes tex4ht to fail.  Some
macros are redefind to do nothing, as we don't really need OpenType fonts
handling in tex4ht

The defintions for fontspec are rather big, we moved them to standalone file
to save some time in package checking.

We also  want to load fontspec only once, it fails with Polyglossia otherwise.

\<add to usepackage\><<<
\Configure{PackageHooks}{fontspec.sty}{fontspec-hooks.4ht}
>>>

\<fontspec-hooks.4ht\><<<
% fontspec-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
\ifdefined\texfourhtfontspecloaded%
  \:dontusepackage{fontspec}
\else 
  \input usepackage-fontspec.4ht
\fi
>>> \AddFile{9}{fontspec-hooks}

The actual configurations which are used when fontspec is loaded:

\<usepackage-fontspec.4ht\><<<
% usepackage-fontspec.4ht (|version), generated from |jobname.tex
% Copyright 2017-2023 TeX Users Group
|<TeX4ht license text|>
% \RequirePackage{expl3}% we need to disable them before loading
\ExplSyntaxOn
\seq_new:N \fontspec_ht_scripts
\gdef\texfourhtfontspecloaded{yes}% used to prevent subsequent loading of this file
\ExplSyntaxOff
\ifdefined\XeTeXversion%
\xenunidelblock{Latin-expl3}% expl3 package makes some characters active
\xeuniuseblock{Latin-expl3}% and define again
\fi%
\PassOptionsToPackage{no-math}{fontspec}
\ExplSyntaxOn
\:AtEndOfPackage{%
  \tl_gset:Ne \l__fontspec_nfss_enc_tl {T1}
  \tl_gset:Ne \g_fontspec_encoding_tl {T1}
  \tl_gset:Ne \l__fontspec_ttfamily_encoding_tl {T1}
  \tl_gset:Ne \l__fontspec_sffamily_encoding_tl {T1}
  \tl_gset:Ne \l__fontspec_rmfamily_encoding_tl {T1}
  \seq_new:N \fontspec_ht_fontfamilies
  \ifdefined\XeTeXversion
  \keys_define:nn {fontspec4ht}{
    Script .code:n = \xeuniuseblock{#1}
  }
  \else
  \keys_define:nn {fontspec4ht}{
    Script .code:n = \seq_put_right:Nn \fontspec_ht_scripts {#1}
  }
  \fi
\cs_set:Nn \fontspec_set_family:Nnn
 {
  % \tl_set:Nn \l__fontspec_family_label_tl { #1 }
  % \__fontspec_select_font_family:nn {#2}{#3}
  % \tl_set_eq:NN #1 \l_fontspec_family_tl
  \def#1{\relax}
 }


\prg_set_conditional:Nnn \fontspec_if_fontspec_font: {TF,T,F}
{
  \prg_return_false:
}

\DeclareDocumentCommand \setmainfont { O{} m O{} }
 {
   % Optional argument can be in both first and third parameter
  \keys_set_known:nn {fontspec4ht}{#1}
  \keys_set_known:nn {fontspec4ht}{#3}
  \seq_put_right:Nn \fontspec_ht_fontfamilies {#2}
  \use:x { \exp_not:n { \DeclareRobustCommand \rmfamily }
   {
    \relax
   }
  }
  \normalfont
  \ignorespaces
 }

 % define aliases for other user commands
\cs_set_eq:NN \fontspec\setmainfont
\cs_set_eq:NN \setsansfont\setmainfont
\cs_set_eq:NN \setmonofont\setmainfont
\cs_set_eq:NN \setromanfont\setmainfont
\cs_set_eq:NN \setmathrm\setmainfont
\cs_set_eq:NN \setmathsf\setmainfont
\cs_set_eq:NN \setboldmathrm\cs_set_eq:NN
\cs_set_eq:NN \setmatht\cs_set_eq:NN



\DeclareDocumentCommand \newfontfamily { m O{} m O{} }
 {
  % \fontspec_set_family:cnn { g__fontspec_ \cs_to_str:N #1 _family } {#2} {#3}
  \keys_set_known:nn {fontspec4ht}{#2}
  \keys_set_known:nn {fontspec4ht}{#4}
  \seq_put_right:Nn \fontspec_ht_fontfamilies {#3}
  \use:x
   {
    \exp_not:N \DeclareRobustCommand \exp_not:N #1
     {
       \relax
     }
   }
 }
 % \tl_set:Nn \g_fontspec_encoding_tl{T1}
 %  \tl_set_eq:NN \encodingdefault\g_fontspec_encoding_tl
 \DeclareDocumentCommand \addfontfeatures {m}
 {
   \keys_set_known:nn {fontspec4ht}{#1}
   \typeout{Add font features}
 }
 \cs_set_eq:NN \addfontfeature \addfontfeatures
  \global\expandafter\let\csname ver@fontenc.sty\endcsname\relax
  \global\expandafter\let\csname opt@fontenc.sty\endcsname\relax
}
\ExplSyntaxOff
|<Restore TivhTcats|>
\endinput
>>>\AddFile{9}{usepackage-fontspec}

I am not really sure what is the problem here, but I've found that use of
Expl3 package in fontspec patch causes catcode problems in packages which
are loaded latter, for example with calc.sty. The catcodes are stored in
\`|\TivhTcats| macro, we need to set catcode of : to 12 manually, saved catcode 
of @ is OK, so we don't need to reset it.

\<Restore TivhTcats\><<<
\edef\TivhTcats{%                                                                                                                                     
  \catcode`:=12%
  \catcode`@=\the\catcode`@%
} 
>>> 

We need to add support for utf-8 input. Different methods are used for LuaTeX
and XeTeX. In LuaTeX, node callbacks are used, in XeTeX, all used characters
must be declared first. This is done in the fontspec-xetex.4ht file.

\<fontspec.4ht\><<<
% fontspec.4ht (|version), generated from |jobname.tex
% Copyright 2016-2021 TeX Users Group
|<TeX4ht license text|>
\Hinput{fontspec}

>>> \AddFile{9}{fontspec}

\<fontspec-4ht.lua\><<<
-- fontspec-4ht.lua (|version), generated from |jobname.tex
-- Copyright 2016-2019 TeX Users Group
--[[
|<TeX4ht license text|>
--]]
local M = {}

local glyph_id = node.id "glyph"
local whatsit_id = node.id "whatsit"
local special_subtype = node.subtype "special"
local dir_id = node.id "dir"
local glue_id = node.id "glue"

local escape = function(char)
  -- prepare tex4ht special for entity with unicode value
  return string.format("t4ht@+&{35}x%x{59}", char)
end

local make_node = function(data)
  -- make special whathsit
  local n = node.new(whatsit_id,special_subtype)
  n.data = data
  return n
end

local function first_node(head)
  local head = head
  while head.prev do
    head = head.prev
  end
  return head
end

-- this should be table with patterns for allowed fonts
local allowed_names = {"^cmr", "^cmb","^cmt", "^cmb", "^cmcs", "^rm%-l", "^cmi", "^ec%-lm", "none"}

local testfont = function(name)
  -- test font name for all allowed names, when it is found, return true
  for _, x in ipairs(allowed_names) do
    local r = name:match(x)
    if r then 
      return true 
    end
  end
  return false
end

local fonttypes = {}
local get_font_type = function(id)
  if fonttypes[id]~=nil then return fonttypes[id] end
  local f = font.getfont(id) or {name = "none"} -- font object can be nil sometimes
  local name = f.name
  local type = testfont(string.lower(name))
  if not type then
    print("Unsupported font",  name)
  end
  fonttypes[id] = type
  return type
end

local xchar = string.byte("x")

local utfchar = unicode.utf8.char
function M.char_to_entity(head)
  -- traverse characters
  for n in node.traverse(head) do
    if n.id == glyph_id then
      -- we need to process only default text font, ie cmr, because user may request special mathematical fonts,
      -- which should be processed via htf files as usual
      local t = get_font_type(n.font)
      if t == true then
        local char = n.char
        if char > 127 then
          local new = escape(char)
          local x = make_node(new)
          -- insert tex4ht special before char, it will replace the char
          node.insert_before(head, n, x)
          -- in standard tex4ht accented characters are replaced with "x" char. they are later removed anyway
          -- maybe we don't need to do that, but we can, so why not?
          n.char = xchar
        end
      end
    elseif n.id == dir_id then
      -- when text direction is TRT, the spaces in the DVI file have negative width and they are not recognized by tex4ht
      -- so we just change the direction to normal TLT
      n.dir = "+TLT"
    end
  end
  return first_node(head)
end

M.allowed = allowed_names

return M
>>>

We must declare support for used unicode characters when XeTeX is used. Support
for Latin script is loaded automatically, for other scripts Script option for
font family declaration must be used:

\Verbatim
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{czech}
\setotherlanguages{greek}
\newfontfamily\greekfont{Linux Libertine O}[Script=Greek]
\begin{document}
Latin text
\begin{greek} 
  greek unicode text. this file is in latin1 encoding, so we 
  can't show it 
\end{greek}
\end{document}
\EndVerbatim

Alternatively, you can eiter directly declare unicode range using
\`|\xeuniregisterblock{start charcode}{end charcode}|, or load ranges for
given Script using \`|\xeuniuseblock{Script name}|. 

\<fontspec-xetex.4ht\><<<
% fontspec-xetex.4ht, generated from |jobname.tex
% Copyright 2016-2017 TeX Users Group
|<TeX4ht license text|>

\ExplSyntaxOn
\seq_map_inline:Nn \fontspec_ht_scripts {\typeout{use block #1}\xeuniuseblock{#1}}
\ExplSyntaxOff
\Hinput{fontspec-xetex}
\endinput
>>> \AddFile{9}{fontspec-xetex}

\<fontspec-luatex.4ht\><<<
% fontspec-luatex.4ht, generated from |jobname.tex
% Copyright 2016-2017 TeX Users Group
|<TeX4ht license text|>
\Hinput{fontspec-luatex}
\endinput
>>> \AddFile{9}{fontspec-luatex}


%%%%%%%%%%%%%%%%%%
\Section{TikZ}
%%%%%%%%%%%%%%%%%


There is a support for TikZ externalization. TikZ has been instucted to don't
externalize pictures when tex4ht is used. It is necessary to  create the PDF
images for TikZ pictures first, by compiling the document using a PDF producing
engine. 

The tex4ht configuration for PDF graphics is used for PDF inclusion, it will be
converted to SVG by default.

\<add to usepackage\><<<
\Configure{PackageHooks}{tikz.sty}{tikz-hooks.4ht}
>>>

\<tikz-hooks.4ht\><<<
% tikz-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020-2024 TeX Users Group
|<TeX4ht license text|>
\ifdefined\pgfsysdriver\else%
  \typeout{*****************************}
  \typeout{TeX4ht info: Using dvisvgm4ht TikZ driver. Put \detokenize{\def\pgfsysdriver{driver-name}} to your 
  document before use of TikZ if you want to another driver. Use tikz+ option if your TikZ pictures use patterns.}%
  \def\pgfsysdriver{pgfsys-dvisvgm4ht.def}%
\fi%
\ifdefined\find:externalize\else
\:AtEndOfPackage{%
\let\use:tikzlibrary\usetikzlibrary
\def\find:externalize#1external#2\@nil{%
  \ifdefined\tikzexternalize
    \let\tikz:externalize\tikzexternalize
    \renewcommand\tikzexternalize[1][]{\tikz:externalize[##1,mode=only graphics]}
    \tikzset{%
      tex4ht inc/.style={%
        /pgf/images/include external/.code={%
          \includegraphics[]{####1.pdf}%
        }%
      }%
    }%
    \tikzset{tex4ht inc}%
  \fi%
}
\append:defI\use@@tikzlibrary{\find:externalize##1external\@nil}%
}
\fi
>>> \AddFile{9}{tikz-hooks}

%%%%%%%%%%%%%%%%%%%
\Section{pgf.sty}
%%%%%%%%%%%%%%%%%%%

\<pgf.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% pgf.4ht                                |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{pgf}
\endinput
>>>        \AddFile{9}{pgf}

\<add to usepackage\><<<
\Configure{PackageHooks}{pgf.sty}{pgf-hooks.4ht}
>>>

The following code loads the dvisvgm driver for TeX4ht. The default
TeX4ht driver provided by TikZ doesn't work well.

\<pgf-hooks.4ht\><<<
% pgf-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
\ifdefined\pgfsysdriver\else%
  \typeout{*****************************}
  \typeout{TeX4ht info: Using dvisvgm4ht TikZ driver. Put \detokenize{\def\pgfsysdriver{driver-name}} to your 
  document before use of TikZ if you want to another driver. Use tikz+ option if your TikZ pictures use patterns.}%
  \def\pgfsysdriver{pgfsys-dvisvgm4ht.def}%
\fi%
>>>        \AddFile{9}{pgf-hooks}

%%%%%%%%%%%%%%%%%%
\Section{tikz-cd.sty}
%%%%%%%%%%%%%%%%%%

\<tikz-cd.4ht\><<<
% tikz-cd.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
|<tikzcd-picture|>
\Hinput{tikz-cd}
\endinput
>>> \AddFile{9}{tikz-cd}

Convert the tikzcd environment to pictures by default.

\<tikzcd-picture\><<<
\ConfigureEnv{tikzcd}{\Picture+{}}{\EndPicture}{}{}
>>>

%%%%%%%%%%%%%%%%%%
\Section{pdfbase.sty}
%%%%%%%%%%%%%%%%%%

The pdfbase package redefines \`|\@outputpage| macro, which causes tex4ht patches to fail.

\<add to usepackage\><<<
\Configure{PackageHooks}{pdfbase.sty}{pdfbase-hooks.4ht}
>>>

\<pdfbase-hooks.4ht\><<<
% pdfbase-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020-2022 TeX Users Group
|<TeX4ht license text|>
\:AtEndOfPackage{%
  \expandafter\let\expandafter\@outputpage\csname pbs_outputpage_orig:\endcsname
}
>>> \AddFile{9}{pdfbase-hooks}

%%%%%%%%%%%%%%%%%
\Section{pdfx.sty}
%%%%%%%%%%%%%%%%%

The pdfx package causes fatal error for TeX4ht. As it's features make sense only in the
PDF mode, it is safest thing to do to just disable the package.

\<add to usepackage\><<<
\Configure{PackageHooks}{pdfx.sty}{pdfx-hooks.4ht}
>>>

\<pdfx-hooks.4ht\><<<
% pdfx-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{pdfx}
\endinput
>>> \AddFile{9}{pdfx-hooks}


%%%%%%%%%%%%%%%%%
\Section{lua-widow-control}
%%%%%%%%%%%%%%%%%

The lua-widow-control package uses LuaTeX hooks to remove windows and orphans
on pages. We need to disable it, as it interferes with TeX4ht and produces 
a fatal error.

\<add to usepackage\><<<
\Configure{PackageHooks}{lua-widow-control.sty}{lua-widow-control-hooks.4ht}
>>>

\<lua-widow-control-hooks.4ht\><<<
% lua-widow-control-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{lua-widow-control}
% provide dummy definition of package's commands
\NewDocumentCommand \lwcsetup {m} {}
\NewDocumentCommand \lwcemergencystretch { } {}
\def\lwcenable{}
\def\lwcdisable{}
\endinput
>>> \AddFile{9}{lua-widow-control-hooks}

%%%%%%%%%%%%%%%%%%%%%
\Section{tagpdf}
%%%%%%%%%%%%%%%%%%%%%

This package adds support for tagged PDF to LaTeX. We need to suppress it in TeX4ht,
as it leads to a fatal error.
\<add to usepackage\><<<
\Configure{PackageHooks}{tagpdf.sty}{tagpdf-hooks.4ht}
>>>

% This is no longer useful, it was fixed in tagpdf code
% \cs_set_protected:Npn \__tag_whatsits: {}

\<tagpdf-hooks.4ht\><<<
% tagpdf-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>
\ExplSyntaxOn
\ExplSyntaxOff
\:AtEndOfPackage{%
  \RenewDocumentCommand \tagpdfsetup { m }{}
}
\endinput
>>> \AddFile{9}{tagpdf-hooks}

\<add to usepackage\><<<
\Configure{PackageHooks}{tagpdf-base.sty}{tagpdf-base-hooks.4ht}
>>>

This file can be used explicitly, we used to provide the whatsits command
here as well, but it is no longer neeeded.

% ignore tagpdf's specials
% we use csname, because \ExplSyntaxOn .. Off caused catcode issues
% \expandafter\def\csname __tag_whatsits:\endcsname{}

\<tagpdf-base-hooks.4ht\><<<
% tagpd-base-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
\endinput
>>> \AddFile{9}{tagpdf-base-hooks}

%%%%%%%%%%%%%%%%%%%%%
\Section{accessibility}
%%%%%%%%%%%%%%%%%%%%%

The accessibility package is deprecated, but it leads to a fatal error 
when it is used. So we will block it from loading, and provide our own
version of commands provided by the package.

\<add to usepackage\><<<
\Configure{PackageHooks}{accessibility.sty}{accessibility-hooks.4ht}
>>>

\<accessibility-hooks.4ht\><<<
% accessibility-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2023 TeX Users Group
|<TeX4ht license text|>
% redefine commands that would cause fatal error when the package is being processed
\let\:origpdfobj\pdfobj
\let\:origpdfoutput\pdfoutput
\let\pdfoutput\@undefined
\def\pdfobj reserveobjnum{}
\:AtEndOfPackage{
  \let\pdfobj\:origpdfobj
  \let\pdfoutput\:origpdfoutput
  \def\PDFStructObj#1#2{}%
}
\endinput

>>> \AddFile{9}{accessibility-hooks}

\<accessibility.4ht\><<<
% accessibility.4ht (|version), generated from |jobname.tex
% Copyright 2023 TeX Users Group
|<TeX4ht license text|>
|<accessibility alt|>
\Hinput{accessibility}
\endinput
>>>\AddFile{9}{accessibility}

The alt command does nothing in the picture mode,
but it outputs its argument in the normal output. 

\<accessibility alt\><<<
\NewConfigure{accessibilityalt}{2}
\def\:tempa#1{\a:accessibilityalt #1\b:accessibilityalt}
\def\alt#1{}
\HLet\alt\:tempa
>>>

%%%%%%%%%%%%%%%%%
\Section{animate.sty}
%%%%%%%%%%%%%%%%%

\<animate.4ht\><<<
% animate.4ht (|version), generated from |jobname.tex
% Copyright 2017 TeX Users Group
|<TeX4ht license text|>
\NewConfigure{animinline}{2}
\let\:anim:xinline\@anim@xinline
\def\@anim@xinline#1#2#3#4{\a:animinline\:anim:xinline{#1}{#2}{#3}{#4}\b:animinline}

\Hinput{animate}
>>> \AddFile{9}{animate}

%%%%%%%%%%%%%%%%%%
\Section{sectionbreak.sty}
%%%%%%%%%%%%%%%%%%

\<sectionbreak.4ht\><<<
% sectionbreak.4ht (|version), generated from |jobname.tex
% Copyright 2017 TeX Users Group
|<TeX4ht license text|>
\NewConfigure{sectionbreak}{2}
\NewConfigure{asterism}{1}

\renewcommand\sectionbreak[1][\sectionbreak@mark]{%
  \a:sectionbreak\bgroup\sectionbreak@style #1\egroup\b:sectionbreak%
}

\renewcommand\asterism{\a:asterism}

\Hinput{sectionbreak}
>>> \AddFile{9}{sectionbreak}


\<subfiles.4ht\><<< 
% subfiles.4ht (|version), generated from |jobname.tex 
% Copyright 2022 TeX Users Group 
|<TeX4ht license text|> 
|<subfiles enddocument|>
\Hinput{subfiles}
\endinput
>>> \AddFile{9}{subfiles}

The Subfiles package redefines handling of LaTeX environments.
Because the included TeX files contain \Verb|\end{document}|,
it causes immediate stop of the main file processing. 

We must test for environment names in the included document,
and set \Verb|\choose:begin| to grab the second argument,
which will prevent the stop of the processing.


\<subfiles enddocument\><<<
\def\subfiles:end{%
  \def\:temp{document}
  \ifx\@currenvir\:temp
    \let\choose:begin\@secondoftwo%
    \subfiles@restoreEndFrom\:gobble
  \fi%
}

\def\:tempa#1{%
  \ifcsname subfiles@end\endcsname
\else
  \subfiles@saveEndTo\subfiles@end
\fi
\pend:defI\end\subfiles:end
}

\HLet\subfiles@renewEndDocument\:tempa

>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{embedfile.sty}
%%%%%%%%%%%%%%%%%%%%%%%

\<embedfile.4ht\><<< 
% embedfile.4ht (|version), generated from |jobname.tex 
% Copyright 2023 TeX Users Group 
|<TeX4ht license text|> 
|<embedfile file|>
|<embedfile dummy commands|>
\Hinput{embedfile}
\endinput

>>> \AddFile{9}{embedfile}

The embedfile command included a file to PDF. We cannot do that in the
HTML output, but we can at least register the file, so it will be for 
example copied to the output directory.

\<embedfile file\><<<
\NewConfigure{embedfile}{1}
\Configure{embedfile}{{\Configure{Needs}{File: \embed:file}\Needs{}}}
\newcommand\embedfile[2][]{
  \edef\embed:file{#2}%
  \a:embedfile%
}
>>>

These commands are defined just that we don't get error messages that
they don't exist. We don't try to emulate them.

\<embedfile dummy commands\><<<
% dummy commands that can be used in the document
\newcommand\embedfilefinish{}
\newcommand\embedfilesetup[1]{}
\newcommand\embedfilesort[1]{}
\newcommand\embedfilefield[2]{}
\newcommand\embedfileifobjectexists[4]{}
\newcommand\embedfilegetobject[2]{}
>>>

The embedfile stops it's loading once it finds that we use engine that
doesn't output PDF. We need to declare a command that prints an error
message before the package quits.

\<add to usepackage\><<<
\Configure{PackageHooks}{embedfile.sty}{embedfile-hooks.4ht}
>>>

\<embedfile-hooks.4ht\><<< 
% embedfile-hooks.4ht (|version), generated from |jobname.tex 
% Copyright 2023 TeX Users Group 
|<TeX4ht license text|> 
\def\EmFi@Error#1#2{}
>>> \AddFile{9}{embedfile-hooks}


\Section{url.sty}
%%%%%%%%%%%%%%%%%%

\<url.4ht\><<<
% url.4ht (|version), generated from |jobname.tex 
% Copyright 1997-2023 TeX Users Group 
|<TeX4ht copywrite|>
   |<fix url|>
\expandafter\ifx\csname Url@OT1encSpecials\endcsname\relax
   |<pre-2004 url.sty|>  
\else
   |<url-2004.sty|>  
\fi
|<shared url|>
\Hinput{url}
\endinput
>>>        \AddFile{7}{url}

\<pre-2004 url.sty\><<<

>>>

\<fix url\><<<
\protected\def\:temp{\leavevmode \begingroup\ht:special{t4ht@(}%
  \def\UrlLeft##1\UrlRight{\ifmmode \else \UrlFont\fi \Url:use{##1}}%
  \def\Url@use##1 ##2{\ifmmode \else \UrlFont\fi
  \Url:use{##1}}\let\,\empty \Configure{$}{}{}{}\ht:special{t4ht@)}\Url}
\HLet\url\:temp
>>>

Old url.sty files employ \''\Url@use', new ones employ \''Url@Left'.

\<url-2004.sty\><<<
\pend:defI\Url@z{%
   \ht:special{t4ht@[}%
   \Configure{$}{}{}{}%
   \let\,\empty
   \let\Url:HyperHook=\Url@HyperHook
   \def\Url@HyperHook{\ifmmode \else \UrlFont\fi
       \ht:special{t4ht@]}%
       \Url:HyperHook}%
}
\pend:def\Url{\Configure{obeylines}{}{}{}}
>>>

\<shared url\><<<
\def\c:url:{\def\Url:use##1}
\Configure{url}{#1}
>>>

\<url-2004.sty\><<<
\def\:temp{\begingroup \urlstyle {tt}\Url}
\ifx \:temp\path
   \def\:tempc{\a:path\begingroup\aftergroup\b:path
      \Configure{url}{\ifmmode \else \UrlFont\fi ##1}\urlstyle {tt}\Url}
   \HLet\path\:tempc
\else
   \def\:temp{\leavevmode \begingroup \urlstyle {tt}\Url}
   \ifx \:temp\path
      \def\:tempc{\leavevmode\a:path\begingroup\aftergroup\b:path
         \Configure{url}{\ifmmode \else \UrlFont\fi ##1}\urlstyle {tt}\Url}
      \HLet\path\:tempc
   \fi
\fi
>>>

\<shared url\><<<
\NewConfigure{path}{2}

\def\set@mathnolig#1{\ifnum\mathcode`#1<32768
   \begingroup\lccode`\~`#1\lowercase{\endgroup
     \edef~}{\mathchar\number\mathcode`#1_{\/}}%
   \mathcode`#1=32768 \fi}
>>>

[\HPage{test data}\Verbatim
\documentclass{book}  
\usepackage{url}  
\begin{document}  
  
\urldef{\PSPpath}{\path}{E:\MP_ROOT\100MNV01}  
\urldef{\psppath}{\url}{E:\MP_ROOT\100MNV01}  
 
First I use an explicit call: \path{E:\MP_ROOT\100MNV01}, then I use    
the command: \PSPpath.  
 
First I use an explicit call: \url{E:\MP_ROOT\100MNV01}, then I use    
the command: \psppath.  
  
\end{document}  
\EndVerbatim\EndHPage{}]

%%%%%%%%%%%%%%%%%%
\Section{breakurl.sty}
%%%%%%%%%%%%%%%%%%

The Breakurl package adds some PostScript code to the
DVI output and TeX4ht doesn't like it. We disable the 
AtBeginDvi command temporarily as a work around.

\<add to usepackage\><<<
\Configure{PackageHooks}{breakurl.sty}{breakurl-hooks.4ht}
>>>

\<breakurl-hooks.4ht\><<<
% breakurl-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
\let\orig:AtBeginDvi\AtBeginDvi
\def\AtBeginDvi#1{}
\:AtEndOfPackage{%
    \let\AtBeginDvi\orig:AtBeginDvi
}
\endinput
>>>        \AddFile{7}{breakurl-hooks}

%%%%%%%%%%%%%%%%%%
\Section{path.sty}
%%%%%%%%%%%%%%%%%%

\<path.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% path.4ht                              |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<path config|>
\Hinput{path}
\endinput
>>>        \AddFile{9}{path}

\<path config\><<<
\pend:def\path{\a:path 
   \let\sv:begingroup\begingroup 
   \def\begingroup{% 
      \let\begingroup\sv:begingroup 
      \begingroup \aftergroup\b:path}% 
} 
\NewConfigure{path}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{hyperref}
%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%
\SubSection{Outline}
%%%%%%%%%%%%%

\Link[http://ftp.gwdg.de/pub/dante/macros/latex/contrib/supported/hyperref/]{}{}%
hyperref\EndLink

Ask hyperref to load 
\List{1}
\item
A cut-down version of hyperref.sty in which the modifications
to LaTeX commands are removed.
\item The
\`'hypertex.def' file with the \`'\special{htm:...}' commands 
being replaced by TeX4ht-oriented commands of the form
\`'\special{t4ht=...}'. 

This will not work for documents broken into pages!!  The
\''\Link' command should be used for the specials.  

\EndList

\Link[http://tug.org/applications/hyperref/manual.html]{}{}manual\EndLink,
\Link[http://www.tug.org/ListsArchives/pdftex/msg02358.html]{}{}msg02358\EndLink,
\Link[http://www.tug.org/ListsArchives/pdftex/msg02400.html]{}{}msg02400\EndLink

\<hyperref.4ht\><<<
% hyperref.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari 
|<TeX4ht copywrite|>
\csname end:hyperref\endcsname
|<nameref.sty|>
|<ifHy@texht undefined?|>
|<post 2001 late hyperrref|>
|<autoref 2008|>
|<tex4ht option on hyperrref|>
|<hyperref utils|>
|<hyperref 2011-01-30|>
|<config hyperref|>
|<htex4ht.def|>
\expandafter\ifx\csname ifHy@hyperindex\endcsname\relax
\else \Hy@hyperindexfalse
\fi
\Hinput{hyperref} 
\endinput
>>>        \AddFile{7}{hyperref}

% CVR 2011-01-30

The following modification became necessary consequent to the bug
report filed by Alex Ball <a.ball@ukoln.ac.uk>. The bug was that
hyperref.4ht failed consequent to the combination of memoir + hyperref
deal with section headings that are below the numbering threshold as
set by secnumdepth. Alex vouched that the fix worked fine with his
documents. 

\<hyperref 2011-01-30\><<<
\def\Hy@MakeCurrentHref#1{%
  \edef\HyperLocalCurrentHref{#1}%
  \@onelevel@sanitize\HyperLocalCurrentHref
  \global\let\HyperGlobalCurrentHref\HyperLocalCurrentHref
  \let\HyperLocalCurrentHref\HyperGlobalCurrentHref
  \ifHy@localanchorname
    \let\@currentHref\HyperLocalCurrentHref
  \else
    \global\let\@currentHref\HyperGlobalCurrentHref
  \fi
}

\let\Hy@SectionAnchorHref\@gobble
\newlength\Hy@SectionHShift

\def\Hy@MakeCurrentHrefAuto#1{%
  \Hy@GlobalStepCount\Hy@linkcounter
  \Hy@MakeCurrentHref{#1.\the\Hy@linkcounter}%
}
>>>

This code comes from hyperref-hooks.4ht. As hyperref-hooks.4ht is not used in .cls files
it needs to be executed also here. I've left this code in hyperef-hooks, but it probably can 
be removed safely.

\<config hyperref\><<<
\@ifpackageloaded{nameref}{}
{%
   \let\sv:label\label
   \RequirePackage{nameref}%
   \let\label\sv:label
}
>>>

\<config hyperref\><<<
\def\hyper@makecurrent#1{% 
  \begingroup 
    \edef\Hy@param{#1}% 
    \ifx\Hy@param\Hy@chapterstring 
      \let\Hy@param\Hy@chapapp 
    \fi 
    \ifHy@hypertexnames 
      \let\@number\@firstofone 
      \@ifundefined{latin@Alph}{}{% 
        \ifx\@Alph\greek@Alph 
          \def\@Alph{Alph\@arabic}% 
        \fi 
      }% 
      \ifHy@naturalnames 
        \let\textlatin\@firstofone 
        \xdef\@currentHlabel{\csname the#1\endcsname}% 
      \else 
        \xdef\@currentHlabel{\csname theH#1\endcsname}% 
      \fi 
      \xdef\@currentHref{% 
        \Hy@param.\expandafter\strip@prefix\meaning\@currentHlabel 
      }% 
    \else 
      \Hy@GlobalStepCount\Hy@linkcounter 
      \xdef\@currentHref{\Hy@param.\the\Hy@linkcounter}% 
    \fi 
  \endgroup 
} 
>>>

\<hyperref utils\><<<
\ifx \@@wrindex\:UnDef \else
   \def\@@wrindex#1||#2||#3\\{%
     \protected@write\@indexfile{}{\string\indexentry{#1}{\thepage}}%
     \endgroup \@esphack
   }
\fi
\ifx \HyInd@@wrindex\:UnDef \else
   \def\HyInd@@wrindex#1#2||#3||#4\\{\HyInd@org@wrindex{#1}{#2}}%
\fi
\ifx \Hy@RestoreLastskip\:UnDef
   \let\Hy@RestoreLastskip\relax
\fi
>>>

\<config hyperref\><<<
\def\hyper@natlinkend{%
  \hyper@linkend
}
>>>

\<htex4ht.def\><<<
\def\hyper@linkstart#1#2{%
  \expandafter\Hy@colorlink\expandafter{\csname @#1color\endcsname}%
  \def\Hy@tempa{#1}%
  \ifx\Hy@tempa\@urltype
    \Link[#2]{}{}%
  \else
    {\hyper@chars\ifx\rel:hyper\def\Link{#2}{}\else\Link[\##2]{}{}\fi}%
  \fi  \global\let\rel:hyper=\:UnDef
}
\def\hyper@linkend{%
  \EndLink
  \Hy@endcolorlink
}
>>>

\<htex4ht.def\><<<
\def\hyper@anchorstart#1{%
  \Hy@SaveLastskip
  \begingroup
    \hyper@chars\Link{}{#1}%
  \endgroup
  \Hy@activeanchortrue
}
\def\hyper@anchorend{%
  \EndLink
  \Hy@activeanchorfalse
  \Hy@RestoreLastskip
}
\def\hyper@anchor#1{\hyper@anchorstart{#1}\hyper@anchorend}
>>>


\<config hyperref\><<<
\def\hyper@linkurl#1#2{%
  \leavevmode  \begingroup    \hyper@chars
   \ifx \hyper:normalise\:UnDef
      \expandafter\pend:defI\expandafter\:autoref
                            \expandafter{\HyRef@currentHtag}%
      \let\HyRef@currentHtag\empty
      \Hy@colorlink{\@urlcolor}#1\Hy@endcolorlink
    \else      
      % we use this trick to hide possible ] characters in the URL
      % https://tex.stackexchange.com/a/707193/2891
      \def\:currentlink{#2}
      \Link[\noexpand\:currentlink]{}{}\Hy@colorlink{\@urlcolor}#1\Hy@endcolorlink\EndLink
      \global\let\hyper:normalise|=\:UnDef
    \fi
  \endgroup }
\AtBeginDocument{%
%  \pend:defI\hyper@normalise{\let\hyper:normalise|=\def}%
  \expandafter\pend:def\csname hyperref
                     \endcsname{\let\hyper:normalise\def}%
  \expandafter\pend:def\csname href \endcsname{\let\hyper:normalise\def}%
  \pend:defI\T@ref{\edef\RefArg{##1}}}
>>>

When \`'\pend:defI\hyper@normalise{\let\hyper:normalise|=\def}%' is needed?
It breaks code like the following one.

\Verbatim
\documentclass{article}  
  \usepackage{hyperref} 
\begin{document} 
  \url{http://thisdomain.org} 
\end{document} 
\EndVerbatim

\''\XR@ext' get its value from the \`'\usepackage' option:
dvi---default;
html---tex4ht;
pdf---hpdftex, dvipdfm, pdfmark, dvips, vtex, dvipsone, textures;
htm---vtex.

\<tex4ht option on hyperrref\><<<
\expandafter\ifx \csname H@item\endcsname\relax 
   \def\:temp{dvi}\ifx \XR@ext\:temp \else
     \def\:temp{html}\ifx \XR@ext\:temp \else
         \:warning{\string\usepackage[...]{hyperref} assumes `\XR@ext'
              option, not `tex4ht'}      
   \fi\fi
\else
      \:warning{\string\usepackage[...]{hyperref} assumes `\XR@ext'
           option, not `tex4ht'}
\fi
>>>

Check  \`'\zap@space#2 \@empty' for removing spaces

\''ifHy@texht' might be undefined, or defined with lowercase
character (in earlier versions).

\<ifHy@texht undefined?\><<<
\expandafter\ifx \csname ifHy@texht\endcsname\relax
   \expand:after{\expandafter
      \let \csname ifHy@texht\endcsname|=}\csname ifhy@texht\endcsname
\fi
\expandafter\ifx \csname ifHy@texht\endcsname\relax
   \expand:after{\expandafter
      \let \csname ifHy@texht\endcsname|=}\csname iffalse\endcsname
\fi
\ifHy@texht \else
    \:warning{tex4ht loaded after hyperref}
    \csname Hy@texhttrue\endcsname
\fi
>>>

The following is to take care of \''\newlabel' of hyperef,
which requires 5 fields instead of 2.

\<hyperref label\><<<
\ifx \prf:label\:UnDef \else \prf:label\fi
>>>

% \<hyperref utils\><<<
% \def\prf:label{{}{}{}}%
% >>>

%\def\@hyperref{\ref}
%\def\label@hyperref[#1]#2{{%
%  \def\@firstoffive##1##2##3{##1}%   |%can we remove this line?|%
%  \Configure{ref}{}{}{}\ref{#1}}}

\<config hyperref\><<<
|<label@@hyperref|>
|<autoref references|>
|<restore pre hyperref|>
|<nameref.sty NOT HERE|>
\csname ReadBookmarks\endcsname
>>>

% We don't use this code anymore
% \def\label@hyperref[#1]#2{{%
%    \def\hyperrefLabel{#2}%
%    \Configure{ref}
%      {\Link}{\EndLink}{\Configure{ref}{}{}{}#2}\ref{#1}}}

The  \Verb+\hyperref[label]{title}+ command should print the 
title when label is undefined. The older configuration printed
?? instead. This should fix this issue. 
\Link{https://tex.stackexchange.com/a/649552/2891}{}More info\EndLink.

\<label@@hyperref\><<<
\def\label@@hyperref#1#2#3{%
  \ifx#1\relax
    \protect\G@refundefinedtrue
    \@latex@warning{%
      Hyper reference `#2' on page \thepage \space undefined%
    }%
    \begingroup
      \hyperrefundefinedlink{#3}%
    \endgroup
  \else%
    \def\hyperrefLabel{#3}%
    \Configure{ref}%
      {\Link}{\EndLink}{\Configure{ref}{}{}{}#3}\ref{#2}%
  \fi
}
>>>

A \Verb+\def\@@hyperref#1#2#3{\Link[#2]{}{}#1\EndLink}+
got removed since it fails the second case below.

\Verbatim
   \href{test2.xml}{link made with href} 
   \hyperref{test2.xml}{a}{b}{link made with hyperref}
\EndVerbatim

The nameref offers \`'\def\strip@period#1.\relax#2\@@@{#1}' to subfigure.

\<restore pre hyperref\><<<
\ifx \H@equation\:UnDef \else
   \let\o:equation:\H@equation
\fi
\ifx \H@endequation\:UnDef \else
   \let\o:endequation:\H@endequation
\fi
\ifx \H@eqnarray\:UnDef \else
   \let\o:eqnarray:\H@eqnarray
\fi
\ifx \H@endsubeqnarray\:UnDef \else
   \let\o:endsubeqnarray:\H@endsubeqnarray
\fi
\ifx \H@subeqnarray\:UnDef \else
   \let\o:subeqnarray:\H@subeqnarray
\fi
\ifx \H@endsubeqnarray\:UnDef \else
   \let\o:endsubeqnarray:\H@endsubeqnarray
\fi
>>>

The following code breaks with current LaTeX.
We must requi
\<nameref.sty not used anymore\><<<
\@ifpackageloaded{nameref}{}
{
   \let\sv:label\label
   \RequirePackage{nameref}%
   \let\label\sv:label
   \input nameref.4ht
}
>>>

We can load nameref from the early hook file

\<add to usepackage\><<<
\Configure{PackageHooks}{hyperref.sty}{hyperref-hooks.4ht}
>>>

\<hyperref-hooks.4ht\><<<
% hyperref-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022-2023 TeX Users Group
|<TeX4ht license text|>
\:AtEndOfPackage{%
|<load nameref in hyperref hooks|>
|<define autoref captions|>
|<define Hy@numberline|>
}
>>> \AddFile{9}{hyperref-hooks}

We need to load Nameref here, otherwise lot of documents
that use Hyperref fails. This caused issues with BibLaTeX,
as both Nameref, BibLaTeX and TeX4ht redefine ifthenelse command.

So we load explicitly the Ifthen package, let Nameref redefine it,
and then revert to it's original definition before applying of
TeX4ht hooks.

\<load nameref in hyperref hooks\><<<
\@ifpackageloaded{nameref}{}
{%
   \RequirePackage{ifthen}% 
   \let\sv:label\label
   \RequirePackage{nameref}%
   \let\label\sv:label
   %\input nameref.4ht
}
% Nameref defines the \@chapter command unconditionally, 
% but this breaks the page cutting functionality
% of TeX4ht, so we need to undefine it. 
% See this post for more details https://tex.stackexchange.com/q/695624/2891
\ifdefined\chapter\else
  \global\let\@chapter\@relax
\fi
>>>

Hyperref defines following captions at the end of the package. 
The problem is that Hyperref detects TeX4ht, and stops its
loading too early, before the captions are declared. 
They are available in the document, but not in the preamble.
This can result in compilation errors if user tries to redefine 
one of these captions in the preamble.

\<define autoref captions\><<<
\providecommand*\AMSautorefname{\equationautorefname}
\providecommand*\Hfootnoteautorefname{\footnoteautorefname}
\providecommand*\Itemautorefname{\itemautorefname}
\providecommand*\itemautorefname{item}
\providecommand*\equationautorefname{Equation}
\providecommand*\footnoteautorefname{footnote}
\providecommand*\itemautorefname{item}
\providecommand*\figureautorefname{Figure}
\providecommand*\tableautorefname{Table}
\providecommand*\partautorefname{Part}
\providecommand*\appendixautorefname{Appendix}
\providecommand*\chapterautorefname{chapter}
\providecommand*\sectionautorefname{section}
\providecommand*\subsectionautorefname{subsection}
\providecommand*\subsubsectionautorefname{subsubsection}
\providecommand*\paragraphautorefname{paragraph}
\providecommand*\subparagraphautorefname{subparagraph}
\providecommand*\FancyVerbLineautorefname{line}
\providecommand*\theoremautorefname{Theorem}
\providecommand*\pageautorefname{page}
>>>

Some packages redefine the following command, which is declared in various Hyperref drivers,
but not with TeX4ht. User will then get an error:

\<define Hy@numberline\><<<
\def\Hy@numberline#1{#1 }
>>>

\<nameref moved from old hyperref\><<<
\def\tht:label#1{%
  \@bsphack
  \begingroup
    \@onelevel@sanitize\@currentlabelname
    \edef\@currentlabelname{%
      \expandafter\strip@period\@currentlabelname.\relax\@@@%
    }%
%   \typeout{::::::::::::[\@currentlabelname]::::::::::::}%
    \protected@write\@auxout{}{%
      \string\newlabel{#1}{%
        {\string\rEfLiNK{\cur:th\:currentlabel}
           {\string\csname\space :autoref\string\endcsname
             {\@@currentlabelname}\@currentlabel}%
        }%    
        {\thepage}%
        {\a:newlabel\@currentlabelname}%
        {\@@currentlabelname.\@currentlabel}{}%
      }%
    }%
  \endgroup
  \@esphack
}%

\HLet\label\tht:label

\Configure{newlabel}
   {\cur:th \:currentlabel}
   {\string\csname\space%\string\string\space
    :autoref\string\endcsname {\@currentlabelname}#1}

\ifx \@@currentlabelname\:UnDef 
   \let\@@currentlabelname\empty
\fi
\append:defI\refstepcounter{\def\@@currentlabelname{#1}}
\pend:def\eqnarray{\edef\@@currentlabelname{equation}}
\pend:def\equation{\edef\@@currentlabelname{equation}}
\pend:defI\section{\edef\@@currentlabelname{section}}
\pend:defI\subsection{\edef\@@currentlabelname{section}}
\pend:defI\subsubsection{\edef\@@currentlabelname{section}}

\ifx \figure\:UnDef \else  
  \pend:def\figure{\edef\@@currentlabelname{figure}}
  \expandafter\pend:def\csname
     figure*\endcsname{\edef\@@currentlabelname{figure}}
\fi
\ifx \table\:UnDef \else
  \pend:def\table{\edef\@@currentlabelname{table}}
  \expandafter\pend:def\csname
     table*\endcsname{\edef\@@currentlabelname{table}}
\fi
\pend:defII\:thm{\edef\@@currentlabelname{##1}}
>>>

The following should be offered in nameref.4ht.

\<\><<<
\ifx \part\:UnDef \else
   \def\:temp#1->#2//{#1}
   \def\:tempc#1{}
   \edef\:tempc{\expandafter\:temp\meaning\:tempc//}
   \edef\:temp{\expandafter\:temp\meaning\part//}
   \ifx \:temp\:tempc  
      \pend:defI\part{\def\@currentlabelname{part}}
\fi\fi
\ifx \chapter\:UnDef \else
   \let\NR:chapter\@chapter
   \def\@chapter[#1]#2{%
     |<adjust minipageNum for setcounter footnote 0|>%
     \def\@currentlabelname{\ch:autorefname}%
     \NR:chapter[{#1}]{#2}%
   }
   \let\NR:schapter\@schapter
   \def\@schapter#1{%
     \gdef\@currentlabelname{}%
     \NR:schapter{#1}%
   }
   \def\ch:autorefname{chapter}
   \let\hy:appendix\appendix
   \def\appendix{\def\ch:autorefname{appendix}\hy:appendix}
\fi   
\let\NR:sect\no@sect
\def\no@sect#1#2#3#4#5#6[#7]#8{%
  \xdef\@currentlabelname{\ifnum #2>\c@secnumdepth\else #1\fi}%
  \NR:sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}%
}
\let\NR:ssect\no@ssect
\def\no@ssect#1#2#3#4#5{%
  \gdef\@currentlabelname{}%
  \NR:ssect{#1}{#2}{#3}{#4}{#5}%
}
>>>

\Verbatim
\documentclass{article}  
 \usepackage{hyperref}  
\begin{document} 
 \section{abc} 
 \label{foo} 
 
 autoref:  \csname autoref\endcsname{foo}  
 
 nameref:  \csname nameref\endcsname{foo}  
 
 ref: \ref{foo} 
\end{document} 
\EndVerbatim

% \let\:rdef:sec|=\rdef:sec
% \def\rdef:sec#1{\def\@currentlabelname{#1}\:rdef:sec{#1}}

% \let\hy:@footnotetext|=\@footnotetext
% \def\@footnotetext#1{\hy:@footnotetext{\def\@currentlabelname{footnote}#1}} 

% \pend:def\table{\def\@currentlabelname{table}}
% \expandafter\pend:def\csname
%   table*\endcsname{\def\@currentlabelname{table}}

% \let\hy:item|=\item
% \def\item{\def\@currentlabelname{item}\hy:item} 

%  \let\:rEfLiNK|=\rEfLiNK
%  \def\rEfLiNK##1##2{\:rEfLiNK{##1}{{\let\rEfLiNK=\:gobble#2}}}%

\<late hyperref\><<<
\let\:temp|=\real@setref
\let\real@setref|=\ref
\let\ref|=\o:ref
\let\o:ref|=\:temp
>>>

The second parameter of hypertarget is outside of the link because
it can often contain block elements such as headers and it would
produce invalid HTML

\<hyperref utils\><<<
\def\hyperlink#1#2{\Link{#1}{}#2\EndLink}
\def\hypertarget#1#2{\Link{}{#1}\EndLink#2}
\ifx \hyperpage\:UnDef  \let\hyperpage=\empty  \fi
>>>

\<config hyperref\><<<
\ifx \Hy@linkfileprefix\empty\else
   \:warning{\noexpand\href of hyperref.sty introduces the prefix
             `\Hy@linkfileprefix' to prefix-free references. 
             The command \string\hyperlinkfileprefix{...}
             may be used for changing the prefix (probably 
             \string\hyperlinkfileprefix{}).}
\fi
>>>

\<config hyperref\><<<
\def\hyper@linkfile#1#2#3{\Link[#2]{#3}{}#1\EndLink}
>>>

\<config hyperref\><<<
\def\phantomsection{%
 \Hy@GlobalStepCount\Hy@linkcounter
 \xdef\@currentHref{likesection.\the\Hy@linkcounter}%
 \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
 \edef\@currentlabel{\the\Hy@linkcounter}%
 \AnchorLabel%
}
>>>

The following fix is to hold hypertex from modifying the links in
\Verbatim
\documentclass{article}  
  \usepackage{hyperref}  \hyperlinkfileprefix{}  
\begin{document}  
  \href{/somewhere/foo/}{look here}  
\end{document}  
\EndVerbatim

\<config hyperref\><<<
\catcode`\:=12
\def\@hyper@readexternallink#1#2#3#4:#5:#6\\#7{%
      \hyper@linkurl{#3}{#7\ifx\\#2\\\else\##2\fi}}
\catcode`\:=11
>>>

The following code was originally placed directly in hyperref.sty.
We moved it here, so Hyperref don't need to contain specific
TeX4ht code.

\<config hyperref\><<<
\def\T@pageref#1{%
  \Hy@safe@activestrue%
  \expandafter\@setref\csname r@#1\endcsname\@secondoffive{#1}%
  \Hy@safe@activesfalse%
}%
\def\T@Ref#1{%
  \Hy@safe@activestrue%
  \let\olda:rEfLiNK\rEfLiNK%%
  \def\rEfLiNK##1##2{\Link{##1}{}\edef\:ref:currentlabel{##2}\expandafter\MakeUppercase\:ref:currentlabel\EndLink}%
  \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}%
  \let\rEfLiNK\olda:rEfLiNK%
  \Hy@safe@activesfalse%
}%
\def\@Refstar#1{%
  \Hy@safe@activestrue
  \let\olda:rEfLiNK\rEfLiNK%%
  \def\rEfLiNK##1##2{\Link{##1}{}\edef\:ref:currentlabel{##2}\expandafter\MakeUppercase\:ref:currentlabel\EndLink}%
  \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}%
  \let\rEfLiNK\olda:rEfLiNK%
  \Hy@safe@activesfalse
}%

>>>

Some other commands that are not defined when Hyperref detects TeX4ht. 
They are used by some packages, for example Lastpage, so we need to declare them to prevent errors.

\<config hyperref\><<<
\def\Hy@PageAnchorSlidesPlain{}%
\def\Hy@PageAnchorSlide{}%           
\def\Hy@appendixstring{appendix}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Forms}
%%%%%%%%%%%%%%%%%%%%%%

\<config hyperref\><<<
\def\@Form[#1]{%
   \def\default:textarea{Form}%
   \scan:args{}#1,//\a:Form }  
                                        \def\@endForm{\b:Form}
                                         \NewConfigure{Form}{2}
\def\@TextField[#1]#2{%
   \def\default:textarea{TextField}%
   \scan:args{Field}#1,//%
   \csname a:TextField::\:textarea\endcsname  \leavevmode#2%
   \csname b:TextField::\:textarea\endcsname  }
\def\@PushButton[#1]#2{%
   \def\default:textarea{PushButton}%
   \scan:args{}#1,value=#2,//%
   \csname a:PushButton::\:textarea\endcsname }
\def\@Reset[#1]#2{%
   \def\default:textarea{Reset}%
   \scan:args{}#1,value=#2,//%
   \csname a:Reset::\:textarea\endcsname }
\def\@Submit[#1]#2{%
   \def\default:textarea{Submit}%
   \scan:args{}#1,value=#2,//%
   \csname a:Submit::\:textarea\endcsname }
\def\@CheckBox[#1]#2{%
   \def\default:textarea{CheckBox}%
   \scan:args{}#1,//%
   \csname a:CheckBox::\:textarea\endcsname
   #2\csname b:CheckBox::\:textarea\endcsname}
\def\@ChoiceMenu[#1]#2#3{% 
   \def\default:textarea{ChoiceMenu}%
   \scan:args{}#1,//%
   \csname a:ChoiceMenu::\:textarea\endcsname  \leavevmode#2%
   \csname b:ChoiceMenu::\:textarea\endcsname
   \:choices  #3,//{\csname d:ChoiceMenu::\:textarea\endcsname}%
         {\csname e:ChoiceMenu::\:textarea\endcsname}%
   \csname c:ChoiceMenu::\:textarea\endcsname }
>>>

The following \`'\setkeys' is aasumed to come from keyval.sty. Another
definition is provided in xkeyval.tex.

\<hyperref utils\><<<
\def\:temp#12->#2//{\def\:temp{#2}}
\expandafter\:temp\meaning\setkeys2->//
\ifx\:temp\empty \else
   \pend:defII\setkeys{%
      \expandafter\ifx \csname ##1:keys\endcsname\relax
             \expandafter\def\csname ##1:keys\endcsname{##2}%
      \else  \expandafter\append:def\csname ##1:keys\endcsname{##2}%
      \fi  }
\fi
>>>

\<hyperref utils\><<<
\def\:choices#1,#2//#3#4{%
   \def\AttributeVal{#1}#3\AttributeVal#4%
   \def\:temp{#2}\ifx \:temp\empty \else
   \def\:temp{\:choices#2//{#3}{#4}}\expandafter\:temp\fi}
\def\check:args#1=#2//{\def\:temp{#2}}
\def\arg:quote#1=#2//{%
   \del:sp#1//%
   \expandafter\ifx \csname a:\:form:attr ::\nosp:arg\endcsname\relax
      \expandafter\ifx \csname a:::\nosp:arg\endcsname\relax
            \:warning{No configuration for \:form:attr ::\nosp:arg}%
      \else \def\AttributeVal{#2}\csname a:::\nosp:arg\endcsname
      \fi
   \else
      \def\AttributeVal{#2}\csname a:\:form:attr ::\nosp:arg\endcsname
   \fi
   }
\def\del:sp#1#2//{\def\nosp:arg{#1#2}}
\def\:form:attr{\ifx\:textarea\empty 
   \default:textarea\else \:textarea\fi}
\def\scan:args#1{\let\Attributes=\empty \let\:textarea=\empty
   \expandafter\ifx \csname #1:keys\endcsname\relax
      \expandafter\scan:arg
   \else  \expand:after{\expand:after
      {\expandafter\scan:arg}\csname #1:keys\endcsname,}\fi
}
\def\scan:arg#1,#2//{%
   \def\:temp{#1}\ifx \:temp\empty\else \ifx \:temp\space\else
      \check:args#1=//%
      \ifx \:temp\empty
         \edef\:textarea{\ifx \:textarea\empty\else ,\fi #1}%
      \else
         \arg:quote#1//%
   \fi\fi\fi
   \def\:temp{#2}\ifx \:temp\empty \else
   \def\:temp{\scan:arg#2//}\expandafter\:temp\fi
}        
\def\check:type#1{\:Optionfalse
   \def\:temp{#1}\expandafter\check:t\:textarea,//}%
\def\check:t#1,#2//{\def\:tempa{#1}\ifx \:temp\:tempa \:Optiontrue
   \else
       \def\:tempa{#2}\ifx\:tempa\empty\else \def\:tempa{\check:t#2//}\fi 
       \expandafter\:tempa
   \fi} 
>>>

The \''\nosp:arg' removes leading spaces from attribute names.
Why \`'\def\del:sp#1//{\def\nosp:arg{#1}}' doesn't work?

\Verbatim
\documentclass{article} 
\usepackage[tex4ht,bookmarks=false]{hyperref} 
\begin{document} 
 
 
\begin{Form}[action=mailto:foo,encoding=html,method=post] 
 
\TextField[width=7cm,name=somename,value={default value}] 
    {TextFields--input--text:  } 
 
\TextField[password,name=anymade]{TextFields--input--password: } 
 
\TextField[multiline,width=1in,height=0.6in,name=address,borderstyle=D, 
    color=1 1 1,backgroundcolor=0 0 .5, 
    value={first,second,third}]{TextFields--textarea: } 
 
 
 
\ChoiceMenu[combo,default=two,name=any, 
     ]{Choice menus--select:} 
     {one,two,three} 
 
\ChoiceMenu[default=Home,menulength=3,width=2in,name=xyz,default=two] 
     {Choice menus--select:} 
     {one,two,three} 
 
 
\ChoiceMenu[radio,default=second,name=next,borderwidth=3,bordercolor=0 1 0] 
     {Choice menus--radio:} 
     {one=first, 
      two=second, 
      and three=third} 
 
\CheckBox[]{checkbox 1} 
\CheckBox[name=namea]{checkbox 2} 
\CheckBox[name=nameb,checked]{checkbox 3} 
 
\PushButton[name=xxx,onclick={callsome.foo}]{pushbotton} 
\Submit{Submit}  
\Reset{Reset} 
 
\end{Form} 
\end{document} 

\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Autoref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<autoref references\><<<
\Configure{@newlabel}{\@onelevel@sanitize\@currentlabelname}
\append:def\protect:wrtoc{\def\ref{\protect\o:ref}}
>>>

%  \long\expandafter\def\csname autoref \endcsname#1{\expandafter
%      \auto@setref \csname r@#1\endcsname \@firstoffive {#1}}

\<yes autoref name\><<<
\let\:autoref\::autoref
>>>

\<no autoref name\><<<
\let\:autoref\:gobble
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
[\HPage{old, unused}
%%%%%%%%%%%%%%%%%%%%%%%%
\`'\csname Hy@captionsenglish\endcsname' not defined in old
versions

\<pre 2008\><<<
\expandafter\ifx \csname sectionautorefname\endcsname\relax
   \let\:temp=\def
   \def\def#1{\expandafter
     \ifx \csname \expandafter\:gobble\string#1\endcsname\relax
         \expandafter\:temp\expandafter#1\else
      \expandafter\:gobble\fi }
   \csname Hy@captionsenglish\endcsname 
   \let\def=\:temp
\fi
\def\::autoref#1{{%
  \bgroup
    \a:@newlabel
    \def\:tempa{#1}% 
    \@onelevel@sanitize\:tempa
    \expandafter\global \expandafter\let 
        \expandafter\:temp  \csname \:tempa autorefname\endcsname
    \expandafter\global \expandafter\let 
        \expandafter\:tempa \csname \:tempa name\endcsname 
  \egroup
  \ifx \:temp\relax
     \ifx  \:tempa \relax #1%
     \else \:tempa  \fi
  \else  \:temp  \fi ~}}
\let\:autoref|=\:gobble
>>>
>>>

\<post 2001 late hyperrref-pre 2008\><<<
\AtBeginDocument{%
   \edef\autoref{\noexpand\protect\expandafter\noexpand
   \csname autoref \endcsname}}
\expandafter\def\csname autoref \endcsname{%
    \@ifstar {\HyRef@autoref \@gobbletwo }{\HyRef@autoref \hyper@@link}}
\def\HyRef@autoref#1#2{% 
  \begingroup 
    \Hy@safe@activestrue 
    \expandafter\auto@setref \csname r@#2\endcsname \@firstoffive {#2}%
  \endgroup 
} 
>>>
%%%%%%%%%%%%%%%%%%%%%%%%
\EndHPage{}]
%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%
\SubSection{Definitions fron hyperref.sty}
%%%%%%%%%%%%%

The following definitions are from hyperref.sty,
but they are not accessible there in tex4ht mode.

\<autoref 2008\><<<
|<auto ref|>
|<auto page ref|>
|<auto set ref|>
|<test ref type|>
\def\HyRef@StripStar#1*\\#2\@nil#3{% 
  \def\HyRef@name{#2}% 
  \ifx\HyRef@name\HyRef@CaseStar 
    \def\HyRef@name{#1}% 
  \else 
    \def\HyRef@name{#3}% 
  \fi 
} 
\def\HyRef@CaseStar{*\\} 
\def\HyRef@currentHtag{} 
\let\HyRef@ShowKeysRef\@gobble 
>>>

\<auto ref\><<<
\DeclareRobustCommand*{\autoref}{% 
  \@ifstar{\HyRef@autoref\@gobbletwo}{\HyRef@autoref\hyper@@link}% 
} 
\def\HyRef@autoref#1#2{% 
  \begingroup 
    \Hy@safe@activestrue 
    \expandafter\HyRef@autosetref\csname r@#2\endcsname{#2}{#1}% 
  \endgroup 
} 
>>>

\<test ref type\><<<
\def\HyRef@testreftype#1.#2\\{% 
  \@ifundefined{#1autorefname}{% 
    \@ifundefined{#1name}{% 
      \HyRef@StripStar#1\\*\\\@nil{#1}% 
      \@ifundefined{\HyRef@name autorefname}{% 
        \@ifundefined{\HyRef@name name}{% 
          \def\HyRef@currentHtag{}% 
          \Hy@Warning{No autoref name for `#1'}% 
        }{% 
          \edef\HyRef@currentHtag{% 
            \expandafter\noexpand\csname\HyRef@name name\endcsname 
            \noexpand~% 
          }% 
        }% 
      }{% 
        \edef\HyRef@currentHtag{% 
          \expandafter\noexpand\csname\HyRef@name autorefname\endcsname 
          \noexpand~% 
        }% 
      }% 
    }{% 
      \edef\HyRef@currentHtag{% 
        \expandafter\noexpand\csname#1name\endcsname 
        \noexpand~% 
      }% 
    }% 
  }{% 
    \edef\HyRef@currentHtag{% 
      \expandafter\noexpand\csname#1autorefname\endcsname 
      \noexpand~% 
    }% 
  }% 
} 
>>>

\<auto page ref\><<<
\DeclareRobustCommand*{\autopageref}{% 
  \@ifstar{% 
    \HyRef@autopagerefname\pageref*% 
  }\HyRef@autopageref 
} 
\def\HyRef@autopageref#1{% 
  \hyperref[{#1}]{\HyRef@autopagerefname\pageref*{#1}}% 
} 
\def\HyRef@autopagerefname{% 
  \@ifundefined{pageautorefname}{% 
    \@ifundefined{pagename}{% 
      \Hy@Warning{No autoref name for `page'}% 
    }{% 
      \pagename\nobreakspace 
    }% 
  }{% 
    \pageautorefname\nobreakspace 
  }% 
} 
>>>

\<auto set ref\><<<
\def\HyRef@autosetref#1#2#3{% link command, csname, refname 
  \HyRef@ShowKeysRef{#2}% 
  \ifcase 0\ifx#1\relax 1\fi\ifx#1\Hy@varioref@undefined 1\fi\relax 
    \edef\HyRef@thisref{% 
      \expandafter\@fourthoffive#1\@empty\@empty\@empty 
    }% 
    \expandafter\HyRef@testreftype\HyRef@thisref.\\% 
    \Hy@safe@activesfalse 
    #3{% 
      \expandafter\@fifthoffive#1\@empty\@empty\@empty 
    }{% 
      \expandafter\@fourthoffive#1\@empty\@empty\@empty 
    }{% 
      \HyRef@currentHtag 
      \expandafter\@firstoffive#1\@empty\@empty\@empty 
      \null 
    }% 
  \else 
    \protect\G@refundefinedtrue 
    \nfss@text{\reset@font\bfseries ??}% 
    \@latex@warning{% 
      Reference `#2' on page \thepage\space undefined% 
    }% 
  \fi 
} 
>>>

\<autoref 2008\><<<
\providecommand*\AMSautorefname{\equationautorefname} 
\providecommand*\Hfootnoteautorefname{\footnoteautorefname} 
\providecommand*\Itemautorefname{\itemautorefname} 
\providecommand*\itemautorefname{item} 
\providecommand*\equationautorefname{Equation} 
\providecommand*\footnoteautorefname{footnote} 
\providecommand*\itemautorefname{item} 
\providecommand*\figureautorefname{Figure} 
\providecommand*\tableautorefname{Table} 
\providecommand*\partautorefname{Part} 
\providecommand*\appendixautorefname{Appendix} 
\providecommand*\chapterautorefname{chapter} 
\providecommand*\sectionautorefname{section} 
\providecommand*\subsectionautorefname{subsection} 
\providecommand*\subsubsectionautorefname{subsubsection} 
\providecommand*\paragraphautorefname{paragraph} 
\providecommand*\subparagraphautorefname{subparagraph} 
\providecommand*\FancyVerbLineautorefname{line} 
\providecommand*\theoremautorefname{Theorem} 
\providecommand*\pageautorefname{page}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Ref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\<post 2001 late hyperrref\><<<

\<nameref moved from old hyperref\><<<
\pend:defIII\@setref{\edef\RefArg{##3}}
\append:defIII\@setref{\let\:autoref\:gobble}
|<no autoref name|>
>>>

\<post 2001 late hyperrref\><<<
\def\auto@setref#1#2#3{\@safe@activestrue
   |<yes autoref name|>\T@ref{#3}\@safe@activesfalse}
\ifx\@refstar\:UnDef
  \def\@refstar{|<no autoref name|>\T@ref} 
\fi
|<ref star|>

>>>

%%%%%%%%%%%%%
\SubSection{Ref Star}
%%%%%%%%%%%%%

\<ref star\><<<
\def\:temp{\protect \T@ref}
\ifx \::ref\:temp
   \edef\::ref{\noexpand\protect \expandafter\noexpand \csname ::ref \endcsname}
   \expandafter\def\csname ::ref \endcsname{\@ifstar \@refstar \T@ref}
\fi
|<ref star for babl|>
>>>

\<ref star for babl\><<<
\def\:temp#1{\@safe@activestrue\org@:ref{#1}\@safe@activesfalse}
\expandafter\ifx \csname :ref \endcsname\:temp
   \expandafter\def\csname :ref \endcsname{\@ifnextchar*{\:refstar}{\r:ref}}
   \def\r:ref#1{\@safe@activestrue\org@:ref{#1}\@safe@activesfalse}
   \def\:refstar#1{\r:ref}
\fi
>>>

\<ref star\><<<
\expandafter\ifx \csname real@setref\endcsname\relax 
   \def\@pagerefstar#1{%  
      \HyRef@StarSetRef{#1}\@secondoffive  
   }
   \def\@namerefstar#1{%
       \HyRef@StarSetRef{#1}\@thirdoffive
     }
   \def\HyRef@StarSetRef#1{%  
     \begingroup  
       \Hy@safe@activestrue  
       \edef\x{#1}%  
       \@onelevel@sanitize\x  
       \edef\x{\endgroup  
         \noexpand\HyRef@@StarSetRef  
           \expandafter\noexpand\csname r@\x\endcsname{\x}%  
       }%  
     \x  
   }  
    
   \def\HyRef@@StarSetRef#1#2#3{%  
     \ifx#1\@undefined  
       \let#1\relax  
     \fi  
     \real@setref#1#3{#2}%  
   }  
\fi 
\expandafter\ifx \csname real@setref\endcsname\relax 
   \let\real@setref\@setref 
\fi 
>>>

\HPage{test data}
\Verbatim
\documentclass{article}  
   \usepackage{hyperref}  
  
\begin{document}  
 
\section{foobar}  
\label{sec:foobar}  
 
Ref: \ref*{sec:foobar}  
 
Auto: \autoref*{sec:foobar}  
 
Page: \pageref*{sec:foobar}  
  
Hype: \hyperref[sec:foobar]{Link to Section \ref*{sec:foobar}}  
  
\end{document}

\documentclass{article}  
   \usepackage[english]{babel}  
   \usepackage{hyperref}  
\begin{document}  
\tableofcontents  
  
\begin{equation}  
  \label{eq:foo}  
  a+b=c  
\end{equation}  
 
\ref*{eq:foo}  
 
\ref{eq:foo}  
  
\end{document}

\documentclass[a4paper]{article}  
\usepackage{amsmath}  
\usepackage{hyperref}  
 \begin{document}  
\begin{equation}  
  \label{eq:foo}a+b=c  
\end{equation}  
  
 \hyperref[eq:foo]{Foobar \ref*{eq:foo}}  
  
\end{document}      
\EndVerbatim
\EndHPage{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{hypcap.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<hypcap.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% hypcap.4ht                            |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<hypcap configs|>
\Hinput{hypcap}
\endinput
>>>        \AddFile{9}{hypcap}

\<hypcap configs\><<<
\pend:def\endfigure{\@capstartfalse}
\expandafter\pend:def\csname endfigure*\endcsname{\@capstartfalse}
\pend:def\endtable{\@capstartfalse}
\expandafter\pend:def\csname endtable*\endcsname{\@capstartfalse}
>>>

% was \let\capstart=\empty 

[\HPage{example}
\Verbatim
\documentclass{article}  
\usepackage{caption}  
\usepackage{hyperref}  
\usepackage[all]{hypcap}  
  
\begin{document}  
\begin{figure}\caption{foobar}\end{figure}  
\begin{figure}\caption{foobar}\end{figure}  
\begin{figure*}\caption{foobar}\end{figure*}  
  
\begin{table}\caption{tab}\end{table}  
\begin{table}\caption{tab}\end{table}  
\begin{table*}\caption{tab}\end{table*}  
\end{document}  

\EndVerbatim
\EndHPage{}]

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{bookmark.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%

\<add to usepackage\><<<
\Configure{PackageHooks}{bookmark.sty}{bookmark-hooks.4ht}
>>>

\<bookmark-hooks.4ht\><<<
% bookmark-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
|<pass draft mode to bookmark|>
\endinput
>>>        \AddFile{9}{bookmark-hooks}

The bookmark package redefines sectioning commands, biliography, etc., which we don't
want, as it clashes with TeX4ht. It is useful only in the PDF mode anayway.

\<pass draft mode to bookmark\><<<
\PassOptionsToPackage{draft}{bookmark}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{draftwatermark.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%

\<draftwatermark.4ht\><<<
% draftwatermark.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
% disable the watermark printing command
\HLet\draftwatermark@printwm\@gobble
\Hinput{draftwatermark}
\endinput
>>>        \AddFile{9}{draftwatermark}

\<add to usepackage\><<<
\Configure{PackageHooks}{draftwatermark.sty}{draftwatermark-hooks.4ht}
>>>

\<draftwatermark-hooks.4ht\><<<
% draftwatermark-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
|<disable draft watermark|>
\endinput
>>>        \AddFile{9}{draftwatermark-hooks}

We don't want to print watermarks, they cause unnecessary pictures and 
slow compilation.

\<disable draft watermark\><<<
\:AtEndOfPackage{
  \draftwatermark@stampfalse
}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\Chapter{Miscellaneous Environments}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltmiscen.dtx]{}{}ltmiscen.dtx\EndLink

\<latex ltmiscen\><<<
|<html latex env|>
|<html latex local env|>
>>>

%%%%%%%%%%%%%%%%%%
\Section{document...enddocument}
%%%%%%%%%%%%%%%%%%

\<html latex hook on end\><<<
\let\end|=\o:end
\let\o:end|=\:UnDef
\let\o:enddocumenthook|=\@enddocumenthook
\def\:enddocumenthook{\HtmlEnv
   \Configure{newpage}{}%
   \o:enddocumenthook
   \at:docend  \csname export:hook\endcsname  }
>>>

LaTeX in 2020 introduced new hoooks in the development version, so we need to
adapt for it. The following code uses either the old code, or the new hooks. We
should remove the legacy code once the hooks are introduced in the stable LaTeX
core

\<html latex hook on end\><<<
\ifdefined\AddToHook%
 \AddToHook{enddocument} {\HtmlEnv\Configure{newpage}{}\at:docend  \csname export:hook\endcsname}
\else%
  \let\@enddocumenthook\:enddocumenthook
\fi
>>>


\<html latex start\><<<
\def\:startdoc{%
   \pageno=1
   \let\no@document|=\document
   \def\document{%
      \let\document|=\no@document 
      \let\no@document|=\:UnDef
      \document \at:startdoc }%
}
>>>

\Section{Output Encoding}

Connector punctuation (the default is probably not the right one for
unicode):

\<latex ltoutenc\><<<
\NewConfigure{textundescore}[1]{\expandafter
   \def\csname ?\string\textunderscore\endcsname{\leavevmode#1}}
\Configure{textundescore}{\HChar{95}}
\DeclareRobustCommand{\_}{%
\ifmmode\mathunderscore\else\textunderscore\fi}
>>>

The math underscore below is represented by a ruler drawing.

\Verbatim
\documentclass{article}  
\begin{document}  
   $\_$ (\_)  
\end{document}
\EndVerbatim

\<latex ltoutenc\><<<
\expandafter\let\expandafter\OMS:textcircled\csname
                               OMS\string\textcircled\endcsname
\expandafter\def\csname OMS\string\textcircled\endcsname#1{%
   \def\:next{\OMS:textcircled{#1}}%
   \def\:temp{#1}\expandafter\scan:textcircled\a:textcircled{}|<par del|>%
   \:next  }
\def\scan:textcircled#1{\def\:tempa{#1}\ifx \:tempa\empty
      \expandafter\gob:textcircled
   \else
     \ifx \:tempa\:temp
          \expandafter\expandafter\expandafter\found:textcircled
     \else\expandafter\expandafter\expandafter\cont:textcircled \fi
   \fi}
\def\found:textcircled#1#2|<par del|>{\def\:next{#1}}
\def\gob:textcircled#1|<par del|>{}
\def\cont:textcircled#1{\scan:textcircled}

\NewConfigure{textcircled}[1]{%
   \def\:temp{#1}\ifx \:temp\empty \let\a:textcircled\empty \fi
   \get:textcircled{#1}}
\def\get:textcircled#1{\def\:temp{#1}\ifx \:temp\empty
  \else
     \append:def\a:textcircled{{#1}}\expandafter\more:textcircled
   \fi }
\def\more:textcircled#1{%
   \append:def\a:textcircled{{#1}}\get:textcircled}
\Configure{textcircled}{}
>>>

January 2017 (Michal): LaTeX core started to use new font encoding with
Unicode engines, TU. This encoding loads OpenType fonts by default.
It breaks tex4ht compilation due to a bug in tex4ht command.

We need to check for TU encoding and switch back to the old default one, OT1. 

LuaLaTeX and XeLaTeX also started to support basic Latin Unicode diacritics, 
so the following example should output all characters to the PDF:

\Verbatim
\documentclass{article}
\begin{document}
We can't use diacritics in the \Verbatim unfortunately, 
so just imagine that it is here.
\end{document}
\EndVerbatim

We should support that as well. For LuaLaTeX, we can use a callback which is used 
for Fontspec support. For XeLaTeX, we need to make Unicode characters active and
define them to output te4ht character code. Again, we can use the code which was
used for Fontspec support.

\<latex ltoutenc\><<<
\edef\test:f:encoding{\f@encoding}
\edef\test:tu:encoding{TU}
\ifx\test:f:encoding\test:tu:encoding
  \RequirePackage[T1]{fontenc}
  %  load tuenc definitions for commands like \quotedblbase 
  \ifdefined\old:DeclareTextSymbol\else
    \input binhex
    \def\DeclareTextSymbol#1#2#3{\gdef#1{\ht:special{t4ht@+&{35}x\hex{#3}{59}}\a:HChar}}
    \input tuenc.def
    % this command is defined by tuenc, but doesn't work out of the box with TeX4ht
    \let\DeclareTextSymbol\old:DeclareTextSymbol
  \fi

  \ifdefined\directlua%
    \input tuenc-luatex.4ht
  \fi
  \ifdefined\XeTeXcharclass 
    \input tuenc-xetex.4ht
  \fi
\fi
>>>


\<tuenc-xetex.4ht\><<<
% tuenc-xetex.4ht, generated from |jobname.tex
% Copyright 2018 TeX Users Group
|<TeX4ht license text|>
\ifdefined\xeuniuseblock\else
\input tuenc-xetex-input.4ht
\fi
\Hinput{tuenc-xetex}
\endinput
>>> \AddFile{9}{tuenc-xetex}

\<tuenc-xetex-input.4ht\><<<
% tuenc-xetex-input.4ht, generated from |jobname.tex
% Copyright 2019-2021 TeX Users Group
|<TeX4ht license text|>
\input binhex

% the code is inspited with newunicodechar.sty
% call with character's numeric value
\newcommand\xeuniregisterchar[1]{%
  \catcode#1=\active% make the character active
  \begingroup\lccode`\~=#1 % trick to define the character as a command
  % the code inside \special will be converted back to utf8 by tex4ht
  \lowercase{\endgroup\protected\def~}{\ht:special{t4ht@+&{35}x\hex{#1}{59}}\a:HChar}
}

% remove character definition
\newcommand\xeuniunregisterchar[1]{%
  \global\catcode#1=11%
}

\newcount\xeuniblock

% register unicode range #1 - #2
\newcommand\xeuniregisterblock[2]{%
  \xeuniblock=#1%
  \loop%
  \expandafter\xeuniregisterchar\expandafter{\the\xeuniblock}%
  \advance\xeuniblock by 1\relax%
  \ifnum\xeuniblock<\the\numexpr #2+1\relax%
  \repeat%
}

% register unicode range given in hex format
\newcommand\xeuniregisterblockhex[2]{%
  \xeuniregisterblock{"#1}{"#2}%
}

% Define unicode blocks for script name
\newcommand\xeuniblockdef[2]{%
  \@namedef{block:#1}{#2}
}

% delete block definition after use, we don't want to execute the unicode
% declarations multiple times
\newcommand\xeuniuseblock[1]{\@nameuse{block:#1}\@namedef{block:#1}{\relax}}

% disable active characters of given block
\newcommand\xenunidelblock[1]{\bgroup\let\xeuniregisterchar\xeuniunregisterchar\@nameuse{block:#1}\egroup}

% Unicode blocks definitions
\xeuniblockdef{Latin}{%
  % \xeuniregisterblockhex{0000}{007F}%
  \xeuniregisterblockhex{0080}{00FF}%
  \xeuniregisterblockhex{0100}{017F}%
  \xeuniregisterblockhex{0180}{024F}%
  \xeuniregisterblockhex{0250}{02AF}%
  \xeuniregisterblockhex{02B0}{02FF}%
  \xeuniregisterblockhex{0300}{036F}%
  \xeuniregisterblockhex{1E00}{1EFF}%
  \xeuniregisterblockhex{2C60}{2C7F}%
  \xeuniregisterblockhex{A720}{A7FF}%
  \xeuniregisterblockhex{AB30}{AB6F}%
  \xeuniregisterblockhex{1D00}{1D7F}%
  \xeuniregisterblockhex{1D80}{1DBF}%
  \xeuniregisterblockhex{1DC0}{1DFF}%
  \xeuniregisterblockhex{2000}{206F}%
  \xeuniregisterblockhex{2070}{209F}%
  \xeuniregisterblockhex{20A0}{20CF}%
  \xeuniregisterblockhex{20D0}{20FF}%
  \xeuniregisterblockhex{2100}{214F}%
  \xeuniregisterblockhex{2150}{218F}%
  \xeuniregisterblockhex{2190}{21FF}%
  \xeuniregisterblockhex{2200}{22FF}%
  \xeuniregisterblockhex{2300}{23FF}%
  \xeuniregisterblockhex{2400}{243F}%
  \xeuniregisterblockhex{2440}{245F}%
  \xeuniregisterblockhex{2460}{24FF}%
  \xeuniregisterblockhex{2500}{257F}%
  \xeuniregisterblockhex{2580}{259F}%
  \xeuniregisterblockhex{25A0}{25FF}%
  \xeuniregisterblockhex{2600}{26FF}%
  \xeuniregisterblockhex{2700}{27BF}%
  \xeuniregisterblockhex{27C0}{27EF}%
  \xeuniregisterblockhex{27F0}{27FF}%
  \xeuniregisterblockhex{2800}{28FF}%
  \xeuniregisterblockhex{2900}{297F}%
  \xeuniregisterblockhex{2980}{29FF}%
  \xeuniregisterblockhex{2A00}{2AFF}%
  \xeuniregisterblockhex{2B00}{2BFF}%
}
% this block is used for temporarily disabling some characters
% which are made active by expl3
\xeuniblockdef{Latin-expl3}{
  \xeuniregisterchar{"00CB}
  \xeuniregisterchar{"00CC}
  \xeuniregisterchar{"00CD}
  \xeuniregisterchar{"0126}
  \xeuniregisterchar{"0128}
  \xeuniregisterchar{"012E}
  \xeuniregisterchar{"012F}
  \xeuniregisterchar{"0120}
  \xeuniregisterchar{"0130}
  \xeuniregisterchar{"0131}
  \xeuniregisterchar{"0300}
  \xeuniregisterchar{"0301}
  \xeuniregisterchar{"0303}
  \xeuniregisterchar{"0307}
  \xeuniregisterchar{"1E9C}
  \xeuniregisterchar{"1E9E}
  \xeuniregisterchar{"1EA0}
  \xeuniregisterchar{"01F2}
  \xeuniregisterchar{"01C0}
  \xeuniregisterchar{"01C5}
  \xeuniregisterchar{"01C8}
  \xeuniregisterchar{"01CB}
  \xeuniregisterchar{"01CE}
  \xeuniregisterchar{"02BC}
  \xeuniregisterchar{"02BE}
  \xeuniregisterchar{"0342}
  \xeuniregisterchar{"0345}
  \xeuniregisterchar{"0308}
  \xeuniregisterchar{"030A}
  \xeuniregisterchar{"030C}
  \xeuniregisterchar{"0313}
  \xeuniregisterchar{"0331}
  \xeuniregisterchar{"1E61}
}
\xeuniblockdef{Greek}{
  \xeuniregisterblockhex{0370}{03FF}
  \xeuniregisterblockhex{1F00}{1FFF}
  \xeuniregisterblockhex{10140}{1018F}
  \xeuniregisterblockhex{1D200}{1D24F}
}
\xeuniblockdef{Coptic}{
  \xeuniregisterblockhex{0370}{03FF}
  \xeuniregisterblockhex{2C80}{2CFF}
  \xeuniregisterblockhex{102E0}{102FF}
}
\xeuniblockdef{Cyrillic}{
  \xeuniregisterblockhex{0400}{04FF}
  \xeuniregisterblockhex{0500}{052F}
  \xeuniregisterblockhex{1C80}{1C8F}
  \xeuniregisterblockhex{2DE0}{2DFF}
  \xeuniregisterblockhex{A640}{A69F}
}
\xeuniblockdef{Armenian}{\xeuniregisterblockhex{0530}{058F}}
\xeuniblockdef{Hebrew}{\xeuniregisterblockhex{0590}{05FF}}
\xeuniblockdef{Arabic}{
  \xeuniregisterblockhex{0600}{06FF}
  \xeuniregisterblockhex{0750}{077F}
  \xeuniregisterblockhex{08A0}{08FF}
  \xeuniregisterblockhex{FB50}{FDFF}
  \xeuniregisterblockhex{FE70}{FEFF}
  \xeuniregisterblockhex{1EE00}{1EEFF}
}
\xeuniblockdef{Syriac}{\xeuniregisterblockhex{0700}{074F}}
\xeuniblockdef{Thaana}{\xeuniregisterblockhex{0780}{07BF}}
\xeuniblockdef{NKo}{\xeuniregisterblockhex{07C0}{07FF}}
\xeuniblockdef{Samaritan}{\xeuniregisterblockhex{0800}{083F}}
\xeuniblockdef{Mandaic}{\xeuniregisterblockhex{0840}{085F}}
\xeuniblockdef{Devanagari}{
  \xeuniregisterblockhex{0900}{097F}
  \xeuniregisterblockhex{A8E0}{A8FF}

}
\xeuniblockdef{Bengali}{\xeuniregisterblockhex{0980}{09FF}}
\xeuniblockdef{Gurmukhi}{\xeuniregisterblockhex{0A00}{0A7F}}
\xeuniblockdef{Gujarati}{\xeuniregisterblockhex{0A80}{0AFF}}
\xeuniblockdef{Oriya}{\xeuniregisterblockhex{0B00}{0B7F}}
\xeuniblockdef{Tamil}{\xeuniregisterblockhex{0B80}{0BFF}}
\xeuniblockdef{Telugu}{\xeuniregisterblockhex{0C00}{0C7F}}
\xeuniblockdef{Kannada}{\xeuniregisterblockhex{0C80}{0CFF}}
\xeuniblockdef{Malayalam}{\xeuniregisterblockhex{0D00}{0D7F}}
\xeuniblockdef{Sinhala}{\xeuniregisterblockhex{0D80}{0DFF}}
\xeuniblockdef{Thai}{\xeuniregisterblockhex{0E00}{0E7F}}
\xeuniblockdef{Lao}{\xeuniregisterblockhex{0E80}{0EFF}}
\xeuniblockdef{Tibetan}{\xeuniregisterblockhex{0F00}{0FFF}}
\xeuniblockdef{Myanmar}{
  \xeuniregisterblockhex{1000}{109F}
  \xeuniregisterblockhex{A9E0}{A9FF}
  \xeuniregisterblockhex{AA60}{AA7F}
}
\xeuniblockdef{Georgian}{\xeuniregisterblockhex{10A0}{10FF}}
\xeuniblockdef{Hangul}{
  \xeuniregisterblockhex{1100}{11FF}
  \xeuniregisterblockhex{3130}{318F}
  \xeuniregisterblockhex{A960}{A97F}
  \xeuniregisterblockhex{AC00}{D7AF}
  \xeuniregisterblockhex{D7B0}{D7FF}
  \xeuniuseblock{CJK}
}
\xeuniblockdef{Ethiopic}{
  \xeuniregisterblockhex{1200}{137F}
  \xeuniregisterblockhex{1380}{139F}
}
\xeuniblockdef{Cherokee}{\xeuniregisterblockhex{13A0}{13FF}}
\xeuniblockdef{Unified Canadian Aboriginal Syllabics}{
  \xeuniregisterblockhex{1400}{167F}
  \xeuniregisterblockhex{18B0}{18FF}
}
\xeuniblockdef{Ogham}{\xeuniregisterblockhex{1680}{169F}}
\xeuniblockdef{Runic}{\xeuniregisterblockhex{16A0}{16FF}}
\xeuniblockdef{Tagalog}{\xeuniregisterblockhex{1700}{171F}}
\xeuniblockdef{Hanunoo}{\xeuniregisterblockhex{1720}{173F}}
\xeuniblockdef{Buhid}{\xeuniregisterblockhex{1740}{175F}}
\xeuniblockdef{Tagbanwa}{\xeuniregisterblockhex{1760}{177F}}
\xeuniblockdef{Khmer}{
  \xeuniregisterblockhex{1780}{17FF}
  \xeuniregisterblockhex{19E0}{19FF}
}
\xeuniblockdef{Mongolian}{\xeuniregisterblockhex{1800}{18AF}}
\xeuniblockdef{Limbu}{\xeuniregisterblockhex{1900}{194F}}
\xeuniblockdef{Tai Le}{
  \xeuniregisterblockhex{1950}{197F}
  \xeuniregisterblockhex{1980}{19DF}
}
\xeuniblockdef{Buginese}{\xeuniregisterblockhex{1A00}{1A1F}}
\xeuniblockdef{Tai Tham}{\xeuniregisterblockhex{1A20}{1AAF}}
\xeuniblockdef{Combining Diacritical Marks Extended}{\xeuniregisterblockhex{1AB0}{1AFF}}
\xeuniblockdef{Balinese}{\xeuniregisterblockhex{1B00}{1B7F}}
\xeuniblockdef{Sundanese}{\xeuniregisterblockhex{1B80}{1BBF}}
\xeuniblockdef{Batak}{\xeuniregisterblockhex{1BC0}{1BFF}}
\xeuniblockdef{Lepcha}{\xeuniregisterblockhex{1C00}{1C4F}}
\xeuniblockdef{Ol Chiki}{\xeuniregisterblockhex{1C50}{1C7F}}
\xeuniblockdef{Sundanese Supplement}{\xeuniregisterblockhex{1CC0}{1CCF}}
\xeuniblockdef{Vedic Extensions}{\xeuniregisterblockhex{1CD0}{1CFF}}
\xeuniblockdef{Glagolitic}{\xeuniregisterblockhex{2C00}{2C5F}}
\xeuniblockdef{Georgian Supplement}{\xeuniregisterblockhex{2D00}{2D2F}}
\xeuniblockdef{Tifinagh}{\xeuniregisterblockhex{2D30}{2D7F}}
\xeuniblockdef{Ethiopic Extended}{\xeuniregisterblockhex{2D80}{2DDF}}
\xeuniblockdef{Supplemental Punctuation}{\xeuniregisterblockhex{2E00}{2E7F}}
\xeuniblockdef{CJK}{%
  \xeuniregisterblockhex{2E80}{2EFF}
  \xeuniregisterblockhex{2F00}{2FDF}
  \xeuniregisterblockhex{2FF0}{2FFF}
  \xeuniregisterblockhex{3000}{303F}
  \xeuniregisterblockhex{3040}{309F}
  \xeuniregisterblockhex{30A0}{30FF}
  \xeuniregisterblockhex{31C0}{31EF}
  \xeuniregisterblockhex{31F0}{31FF}
  \xeuniregisterblockhex{3200}{32FF}
  \xeuniregisterblockhex{3100}{312F}
  \xeuniregisterblockhex{3190}{319F}
  \xeuniregisterblockhex{31A0}{31BF}
  \xeuniregisterblockhex{3300}{33FF}
  \xeuniregisterblockhex{3400}{4DBF}
  \xeuniregisterblockhex{4DC0}{4DFF}
  \xeuniregisterblockhex{4E00}{9FFF}
  \xeuniuseblock{Modifier Tone Letters}
}

\xeuniblockdef{Hiragana}{\xeuniuseblock{CJK}}
\xeuniblockdef{Katakana}{\xeuniuseblock{CJK}}
\xeuniblockdef{Yi Syllables}{\xeuniregisterblockhex{A000}{A48F}}
\xeuniblockdef{Yi Radicals}{\xeuniregisterblockhex{A490}{A4CF}}
\xeuniblockdef{Lisu}{\xeuniregisterblockhex{A4D0}{A4FF}}
\xeuniblockdef{Vai}{\xeuniregisterblockhex{A500}{A63F}}
\xeuniblockdef{Bamum}{\xeuniregisterblockhex{A6A0}{A6FF}}
\xeuniblockdef{Modifier Tone Letters}{\xeuniregisterblockhex{A700}{A71F}}
\xeuniblockdef{Syloti Nagri}{\xeuniregisterblockhex{A800}{A82F}}
\xeuniblockdef{Common Indic Number Forms}{\xeuniregisterblockhex{A830}{A83F}}
\xeuniblockdef{Phags-pa}{\xeuniregisterblockhex{A840}{A87F}}
\xeuniblockdef{Saurashtra}{\xeuniregisterblockhex{A880}{A8DF}}
\xeuniblockdef{Kayah Li}{\xeuniregisterblockhex{A900}{A92F}}
\xeuniblockdef{Rejang}{\xeuniregisterblockhex{A930}{A95F}}
\xeuniblockdef{Javanese}{\xeuniregisterblockhex{A980}{A9DF}}
\xeuniblockdef{Cham}{\xeuniregisterblockhex{AA00}{AA5F}}
\xeuniblockdef{Tai Viet}{\xeuniregisterblockhex{AA80}{AADF}}
\xeuniblockdef{Meetei Mayek Extensions}{\xeuniregisterblockhex{AAE0}{AAFF}}
\xeuniblockdef{Ethiopic Extended-A}{\xeuniregisterblockhex{AB00}{AB2F}}
\xeuniblockdef{Cherokee Supplement}{\xeuniregisterblockhex{AB70}{ABBF}}
\xeuniblockdef{Meetei Mayek}{\xeuniregisterblockhex{ABC0}{ABFF}}
\xeuniblockdef{High Surrogates}{\xeuniregisterblockhex{D800}{DB7F}}
\xeuniblockdef{High Private Use Surrogates}{\xeuniregisterblockhex{DB80}{DBFF}}
\xeuniblockdef{Low Surrogates}{\xeuniregisterblockhex{DC00}{DFFF}}
\xeuniblockdef{Private Use Area}{\xeuniregisterblockhex{E000}{F8FF}}
\xeuniblockdef{CJK Compatibility Ideographs}{\xeuniregisterblockhex{F900}{FAFF}}
\xeuniblockdef{Alphabetic Presentation Forms}{\xeuniregisterblockhex{FB00}{FB4F}}
\xeuniblockdef{Variation Selectors}{\xeuniregisterblockhex{FE00}{FE0F}}
\xeuniblockdef{Vertical Forms}{\xeuniregisterblockhex{FE10}{FE1F}}
\xeuniblockdef{Combining Half Marks}{\xeuniregisterblockhex{FE20}{FE2F}}
\xeuniblockdef{CJK Compatibility Forms}{\xeuniregisterblockhex{FE30}{FE4F}}
\xeuniblockdef{Small Form Variants}{\xeuniregisterblockhex{FE50}{FE6F}}
\xeuniblockdef{Halfwidth and Fullwidth Forms}{\xeuniregisterblockhex{FF00}{FFEF}}
\xeuniblockdef{Specials}{\xeuniregisterblockhex{FFF0}{FFFF}}
\xeuniblockdef{Linear B Syllabary}{\xeuniregisterblockhex{10000}{1007F}}
\xeuniblockdef{Linear B Ideograms}{\xeuniregisterblockhex{10080}{100FF}}
\xeuniblockdef{Aegean Numbers}{\xeuniregisterblockhex{10100}{1013F}}
\xeuniblockdef{Ancient Symbols}{\xeuniregisterblockhex{10190}{101CF}}
\xeuniblockdef{Phaistos Disc}{\xeuniregisterblockhex{101D0}{101FF}}
\xeuniblockdef{Lycian}{\xeuniregisterblockhex{10280}{1029F}}
\xeuniblockdef{Carian}{\xeuniregisterblockhex{102A0}{102DF}}
\xeuniblockdef{Old Italic}{\xeuniregisterblockhex{10300}{1032F}}
\xeuniblockdef{Gothic}{\xeuniregisterblockhex{10330}{1034F}}
\xeuniblockdef{Old Permic}{\xeuniregisterblockhex{10350}{1037F}}
\xeuniblockdef{Ugaritic}{\xeuniregisterblockhex{10380}{1039F}}
\xeuniblockdef{Old Persian}{\xeuniregisterblockhex{103A0}{103DF}}
\xeuniblockdef{Deseret}{\xeuniregisterblockhex{10400}{1044F}}
\xeuniblockdef{Shavian}{\xeuniregisterblockhex{10450}{1047F}}
\xeuniblockdef{Osmanya}{\xeuniregisterblockhex{10480}{104AF}}
\xeuniblockdef{Osage}{\xeuniregisterblockhex{104B0}{104FF}}
\xeuniblockdef{Elbasan}{\xeuniregisterblockhex{10500}{1052F}}
\xeuniblockdef{Caucasian Albanian}{\xeuniregisterblockhex{10530}{1056F}}
\xeuniblockdef{Linear A}{\xeuniregisterblockhex{10600}{1077F}}
\xeuniblockdef{Cypriot Syllabary}{\xeuniregisterblockhex{10800}{1083F}}
\xeuniblockdef{Imperial Aramaic}{\xeuniregisterblockhex{10840}{1085F}}
\xeuniblockdef{Palmyrene}{\xeuniregisterblockhex{10860}{1087F}}
\xeuniblockdef{Nabataean}{\xeuniregisterblockhex{10880}{108AF}}
\xeuniblockdef{Hatran}{\xeuniregisterblockhex{108E0}{108FF}}
\xeuniblockdef{Phoenician}{\xeuniregisterblockhex{10900}{1091F}}
\xeuniblockdef{Lydian}{\xeuniregisterblockhex{10920}{1093F}}
\xeuniblockdef{Meroitic Hieroglyphs}{\xeuniregisterblockhex{10980}{1099F}}
\xeuniblockdef{Meroitic Cursive}{\xeuniregisterblockhex{109A0}{109FF}}
\xeuniblockdef{Kharoshthi}{\xeuniregisterblockhex{10A00}{10A5F}}
\xeuniblockdef{Old South Arabian}{\xeuniregisterblockhex{10A60}{10A7F}}
\xeuniblockdef{Old North Arabian}{\xeuniregisterblockhex{10A80}{10A9F}}
\xeuniblockdef{Manichaean}{\xeuniregisterblockhex{10AC0}{10AFF}}
\xeuniblockdef{Avestan}{\xeuniregisterblockhex{10B00}{10B3F}}
\xeuniblockdef{Inscriptional Parthian}{\xeuniregisterblockhex{10B40}{10B5F}}
\xeuniblockdef{Inscriptional Pahlavi}{\xeuniregisterblockhex{10B60}{10B7F}}
\xeuniblockdef{Psalter Pahlavi}{\xeuniregisterblockhex{10B80}{10BAF}}
\xeuniblockdef{Old Turkic}{\xeuniregisterblockhex{10C00}{10C4F}}
\xeuniblockdef{Old Hungarian}{\xeuniregisterblockhex{10C80}{10CFF}}
\xeuniblockdef{Rumi Numeral Symbols}{\xeuniregisterblockhex{10E60}{10E7F}}
\xeuniblockdef{Brahmi}{\xeuniregisterblockhex{11000}{1107F}}
\xeuniblockdef{Kaithi}{\xeuniregisterblockhex{11080}{110CF}}
\xeuniblockdef{Sora Sompeng}{\xeuniregisterblockhex{110D0}{110FF}}
\xeuniblockdef{Chakma}{\xeuniregisterblockhex{11100}{1114F}}
\xeuniblockdef{Mahajani}{\xeuniregisterblockhex{11150}{1117F}}
\xeuniblockdef{Sharada}{\xeuniregisterblockhex{11180}{111DF}}
\xeuniblockdef{Sinhala Archaic Numbers}{\xeuniregisterblockhex{111E0}{111FF}}
\xeuniblockdef{Khojki}{\xeuniregisterblockhex{11200}{1124F}}
\xeuniblockdef{Multani}{\xeuniregisterblockhex{11280}{112AF}}
\xeuniblockdef{Khudawadi}{\xeuniregisterblockhex{112B0}{112FF}}
\xeuniblockdef{Grantha}{\xeuniregisterblockhex{11300}{1137F}}
\xeuniblockdef{Newa}{\xeuniregisterblockhex{11400}{1147F}}
\xeuniblockdef{Tirhuta}{\xeuniregisterblockhex{11480}{114DF}}
\xeuniblockdef{Siddham}{\xeuniregisterblockhex{11580}{115FF}}
\xeuniblockdef{Modi}{\xeuniregisterblockhex{11600}{1165F}}
\xeuniblockdef{Mongolian Supplement}{\xeuniregisterblockhex{11660}{1167F}}
\xeuniblockdef{Takri}{\xeuniregisterblockhex{11680}{116CF}}
\xeuniblockdef{Ahom}{\xeuniregisterblockhex{11700}{1173F}}
\xeuniblockdef{Warang Citi}{\xeuniregisterblockhex{118A0}{118FF}}
\xeuniblockdef{Pau Cin Hau}{\xeuniregisterblockhex{11AC0}{11AFF}}
\xeuniblockdef{Bhaiksuki}{\xeuniregisterblockhex{11C00}{11C6F}}
\xeuniblockdef{Marchen}{\xeuniregisterblockhex{11C70}{11CBF}}
\xeuniblockdef{Cuneiform}{\xeuniregisterblockhex{12000}{123FF}}
\xeuniblockdef{Cuneiform Numbers and Punctuation}{\xeuniregisterblockhex{12400}{1247F}}
\xeuniblockdef{Early Dynastic Cuneiform}{\xeuniregisterblockhex{12480}{1254F}}
\xeuniblockdef{Egyptian Hieroglyphs}{\xeuniregisterblockhex{13000}{1342F}}
\xeuniblockdef{Anatolian Hieroglyphs}{\xeuniregisterblockhex{14400}{1467F}}
\xeuniblockdef{Bamum Supplement}{\xeuniregisterblockhex{16800}{16A3F}}
\xeuniblockdef{Mro}{\xeuniregisterblockhex{16A40}{16A6F}}
\xeuniblockdef{Bassa Vah}{\xeuniregisterblockhex{16AD0}{16AFF}}
\xeuniblockdef{Pahawh Hmong}{\xeuniregisterblockhex{16B00}{16B8F}}
\xeuniblockdef{Miao}{\xeuniregisterblockhex{16F00}{16F9F}}
\xeuniblockdef{Ideographic Symbols and Punctuation}{\xeuniregisterblockhex{16FE0}{16FFF}}
\xeuniblockdef{Tangut}{\xeuniregisterblockhex{17000}{187FF}}
\xeuniblockdef{Tangut Components}{\xeuniregisterblockhex{18800}{18AFF}}
\xeuniblockdef{Kana Supplement}{\xeuniregisterblockhex{1B000}{1B0FF}}
\xeuniblockdef{Duployan}{\xeuniregisterblockhex{1BC00}{1BC9F}}
\xeuniblockdef{Shorthand Format Controls}{\xeuniregisterblockhex{1BCA0}{1BCAF}}
\xeuniblockdef{Byzantine Musical Symbols}{\xeuniregisterblockhex{1D000}{1D0FF}}
\xeuniblockdef{Musical Symbols}{\xeuniregisterblockhex{1D100}{1D1FF}}
\xeuniblockdef{Tai Xuan Jing Symbols}{\xeuniregisterblockhex{1D300}{1D35F}}
\xeuniblockdef{Counting Rod Numerals}{\xeuniregisterblockhex{1D360}{1D37F}}
\xeuniblockdef{Mathematical Alphanumeric Symbols}{\xeuniregisterblockhex{1D400}{1D7FF}}
\xeuniblockdef{Sutton SignWriting}{\xeuniregisterblockhex{1D800}{1DAAF}}
\xeuniblockdef{Glagolitic Supplement}{\xeuniregisterblockhex{1E000}{1E02F}}
\xeuniblockdef{Mende Kikakui}{\xeuniregisterblockhex{1E800}{1E8DF}}
\xeuniblockdef{Adlam}{\xeuniregisterblockhex{1E900}{1E95F}}
\xeuniblockdef{Arabic Mathematical Alphabetic Symbols}{}
\xeuniblockdef{Mahjong Tiles}{\xeuniregisterblockhex{1F000}{1F02F}}
\xeuniblockdef{Domino Tiles}{\xeuniregisterblockhex{1F030}{1F09F}}
\xeuniblockdef{Playing Cards}{\xeuniregisterblockhex{1F0A0}{1F0FF}}
\xeuniblockdef{Enclosed Alphanumeric Supplement}{\xeuniregisterblockhex{1F100}{1F1FF}}
\xeuniblockdef{Enclosed Ideographic Supplement}{\xeuniregisterblockhex{1F200}{1F2FF}}
\xeuniblockdef{Miscellaneous Symbols and Pictographs}{\xeuniregisterblockhex{1F300}{1F5FF}}
\xeuniblockdef{Emoticons}{\xeuniregisterblockhex{1F600}{1F64F}}
\xeuniblockdef{Ornamental Dingbats}{\xeuniregisterblockhex{1F650}{1F67F}}
\xeuniblockdef{Transport and Map Symbols}{\xeuniregisterblockhex{1F680}{1F6FF}}
\xeuniblockdef{Alchemical Symbols}{\xeuniregisterblockhex{1F700}{1F77F}}
\xeuniblockdef{Geometric Shapes Extended}{\xeuniregisterblockhex{1F780}{1F7FF}}
\xeuniblockdef{Supplemental Arrows-C}{\xeuniregisterblockhex{1F800}{1F8FF}}
\xeuniblockdef{Supplemental Symbols and Pictographs}{\xeuniregisterblockhex{1F900}{1F9FF}}
\xeuniblockdef{CJK Unified Ideographs Extension B}{\xeuniregisterblockhex{20000}{2A6DF}}
\xeuniblockdef{CJK Unified Ideographs Extension C}{\xeuniregisterblockhex{2A700}{2B73F}}
\xeuniblockdef{CJK Unified Ideographs Extension D}{\xeuniregisterblockhex{2B740}{2B81F}}
\xeuniblockdef{CJK Unified Ideographs Extension E}{\xeuniregisterblockhex{2B820}{2CEAF}}
\xeuniblockdef{CJK Compatibility Ideographs Supplement}{\xeuniregisterblockhex{2F800}{2FA1F}}
% load default latin block and blocks requested through Script option in fontspec's font 
% selection commands
\xeuniuseblock{Latin}
\endinput
>>> \AddFile{9}{tuenc-xetex-input}


\<tuenc-luatex.4ht\><<<
% tuenc-luatex.4ht, generated from |jobname.tex
% Copyright 2017-2018 TeX Users Group
|<TeX4ht license text|>
\RequirePackage{luatexbase}
\RequirePackage{luacode}

\begin{luacode*}
  local fontspec = require "fontspec-4ht"
  luatexbase.add_to_callback("pre_linebreak_filter", fontspec.char_to_entity, "Char to entity")
  luatexbase.add_to_callback("hpack_filter", fontspec.char_to_entity, "hpack-char-to-entity")
  luatexbase.add_to_callback("vpack_filter", fontspec.char_to_entity, "hpack-char-to-entity")
\end{luacode*}
\Hinput{tuenc-luatex}
\endinput
>>> \AddFile{9}{tuenc-luatex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Blocks: The /begin.../end Delimiters}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%
\SubSection{Begin}
%%%%%%%%%%%%%

The command \`'\begin{xxx}' referes to the meaning of \`'\xxx',
and the command \`'\end{xxx}' referes to the meaning of \`'\endxxx'.

\<latex ltmiscen\><<<
      \pend:defI\begin{\let\chk:pic|=\EndPicture }
      \let\o:begin:|=\begin
      \expandafter\let \csname o:begin :\expandafter\endcsname\csname begin \endcsname
      \let\choose:begin\@firstoftwo
\DeclareRobustCommand\begin[1]{\csname @begin:#1\endcsname 
  \choose:begin
    {\let\choose:begin\@firstoftwo |<revised begin|>}%
    {\o:begin:{#1}}}
>>>

\<latex ltmiscen\><<<
\def\recall:afterend{\ifx \chk:pic\:UnDef
        |<recall after /end|>\fi}
|<hooks+ for ConfigureEnv|>
\NewConfigure{@begin}[2]{% 
   \expandafter\ifx\csname @begin:#1\endcsname\relax\fi
   \expandafter\concat:config\csname @begin:#1\endcsname{#2}}
>>>

\<revised begin\><<<
\ifx \EndPicture\:Undef 
   \PushStack\envn:list\n:list  \SaveEverypar
\fi
|<before begin(...)|>%
\UseHook{env/#1/before}%
\@ifundefined{#1}%
  {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}%
  {\def\reserved@a{%
          \def\@currenvir{#1}%
          \edef\@currenvline{\on@line}%
          |<LoopOf before begin(...)|>%
          \@execute@begin@hook{#1}%
          \csname #1\endcsname 
          |<after begin(...)|>%
  }}%
\global\@ignorefalse 
\begingroup
  \@endpefalse 
  \reserved@a
>>>

The `endpe' stands for `end par environment'.

\<before begin(...)\><<<
\let\chk:pic|=\EndPicture 
\ifx \EndPicture\:UnDef  \list:save   
\let\after:end|=\empty   \csname before:begin#1\endcsname   \fi
>>>

\<LoopOf before begin(...)\><<<
\ifx \EndPicture\:UnDef
   \ifx \this:listConfigure\empty  
       \null:listConfigure  \csname on#1:list\endcsname \fi
\fi
>>>

The \''\before:begin' ensures that only the outer most 
\''\before:begin...' will be activated.  

\<after begin(...)\><<<
|%                 % can't put anything after \csname #1\endcsname
\let\before:begin|=\:UnDef
|%               %
>>>

The \`'\ifx \EndPicture\:UnDef...\fi' should be inside
\''\recall:afterend', and not on top of it, because we want the conditions 
that exited before entering the group. It is expressed indirectly theough
\`'\chk:pic'.

A definition \''\HLet\end\...' would not work for cases that pictures
are initiated within  \''\begin{...}'. For instance, in eqnarray there
  is an embedded \`'$$' that can start a picture environment.

%%%%%%%%%%%%%
\SubSection{End}
%%%%%%%%%%%%%

\<latex ltmiscen\><<<
\expandafter\let \csname o:end :\expandafter\endcsname\csname end \endcsname
\DeclareRobustCommand\end[1]{\choose:begin
  {|<revised end|>}%
  {\o:end:{#1}}}
>>>

\<revised end\><<<
%\IgnoreIndent
  \ifvmode |<ignore par before hline in end|>\fi
\UseHook{env/#1/end}%
\csname end#1\endcsname%
\@checkend{#1}%
  \aftergroup\recall:afterend
\expandafter\endgroup\if@endpe\@doendpe\fi
\UseHook{env/#1/after}%
  \ifx \chk:pic\:UnDef  
     |<after end of /end|>%
     |<check Everypar at end|>%
     \list:recall
  \else 
     \let\chk:pic\:UnDef
  \fi
\if@ignore\global\@ignorefalse\ignorespaces\fi
>>>

A \`'\def\::temp{...}\HLet\end=\:temp' is no good in cases like
\Verbatim
xxxxxxx
\begin{equation}
g(E) = 
\fff{....\meaning\end}
\end{equation}
yyyyyyyy
\EndVerbatim
because the \`'\end' is within picture which brings
the false part in \`'\ifx \EndPicture\:UnDef \n:end:\else \o:end:\fi'.

The \''\csname before:begin#1\endcsname' sends \''\csname
after:end#1\endcsname' to the end with \''\csname
after:end\endcsname'.  Hence, allowing to change or interrupt the
delivery by redefining \''\csname after:end\endcsname' on the way.

        
\<after end of /end\><<<
\csname after:end\endcsname   
\expandafter\let\csname after:end\endcsname|=\:UnDef
>>>

\<check Everypar at end\><<<
\PopStack\envn:list\:tempb
\ifnum \:tempb=\n:list \else
   \def\:temp{#1}\def\:tempa{thebibliography}\ifx \:temp\:tempa
   \else\:warning{\string\SaveEverypar's: \:tempb\space at
          \string\begin{#1} and \n:list\space \string\end{#1}}%
\fi \fi
>>>

The  \''\thebibliography' contains a \`'chapter*'  which is
a problem here in case of cutoff because we get
\`'\SaveEverypar....\HPage...\RecallEverypar....\EndHPage', 
where the hypertext also saves and recalls the status. Hence, a partial 
overlap that would have forced a warning.

The \''\RecallEverypar' must appear first because it sets the
counter \''\n:list', the appropriate \''\ht:everypar' contents,
and \''\ShowIndent' or \''\IgnoreIndent'.

The \''\@doendpe' deals with piles of \''\end's.     The 
\`'\Protect\HtmlPar' goes to the first paragraph outside the
pile.

\<recall after /end\><<<
% \ifhmode \hfill\break\fi <- this added spurious space after inline environments
\RecallEverypar
>>>

\<latex ltmiscen\><<<
\def\:tempc{\@endpetrue
   \def\par{\@restorepar\ht:everypar{\HtmlPar}\par\@endpefalse}%
   \ht:everypar{{\setbox\z@\lastbox}\IgnoreIndent\HtmlPar
                \ht:everypar{\HtmlPar}\@endpefalse}}
\HLet\@doendpe\:tempc
>>>

The \''\hfill\break' is to help prevent losses of space separators. But it seems to
insert spurious space when an environment is used inside paragraph, so I've removed
it. I hope that it will not break anything.

We might get here leading empty paragrphs after an \`'\end'. Is there
a way to remove them without a post processor.

We can't add grouping of the  form
\`'\append:defI\begin{\bgroup}.......\pend:defI\end{\egroup}'
 for catching enclosed fonts because \''\begin{...}' commands might
include parametric subcommands like in
\`'\begin{list}{default-label}{definitions}...\end{list}'.

La\TeX{} changes the meaning of \`'\ht:everypar' upon reaching
\`'\end'.  Hence, the \`'\ht:everypar{}\begin{...}...\end{...}' does
not let the effect of \`'\ht:everypar' through.

%%%%%%%%%%%%%
\SubSection{Examples}
%%%%%%%%%%%%%

\HPage{Yes!}
\Verbatim

\newenvironment{toto}%
    {\begin{list}{\textbullet}{}}%
    {\end{list}\addvspace{4ex}}
\begin{document}

xxx

\begin{toto}
\item Bla bla bla...
\end{toto}
xxxx

\begin{toto}
\item Bla bla bla...
\end{toto}

xxxx
\EndVerbatim

\EndHPage{}

\ifHtml[\HPage{test data}\Verbatim

\documentclass[12pt]{report}   
    \usepackage{amsmath}   
\begin{document}   
 
 
\begin{align}  
a & = a \\  
f & =  
\begin{cases}  
a \\  
b  
\end{cases}  
\end{align}  
 
\newenvironment{foo}{}{} 
\newenvironment{textequation}  {$$\begin{foo}}   {\end{foo}$$}  
 
   \Picture*{} \begin{textequation} a \end{textequation} \EndPicture 
 
   \begin{textequation} a \end{textequation} 
 
\renewenvironment{textequation}  {$$} {$$} 
 
   \Picture*{} \begin{textequation} a \end{textequation} \EndPicture 
 
   \begin{textequation} a \end{textequation} 
 
\renewenvironment{textequation}  {\begin{foo}\begin{foo}}   {\end{foo}\end{foo}}  
 
   \Picture*{} \begin{textequation} a \end{textequation} \EndPicture 
 
   \begin{textequation} a \end{textequation} 
 
\renewenvironment{textequation}  {\begin{foo}}   {\end{foo}}  
 
   \Picture*{} \begin{textequation} a \end{textequation} \EndPicture 
 
   \begin{textequation} a \end{textequation} 
 
\ConfigureEnv{textequation}   {\Picture*{}}   {\EndPicture}   {}{} 
  
   \Picture*{} \begin{textequation} a \end{textequation} \EndPicture 
 
   \begin{textequation} a \end{textequation} 
 
    xxxxxxx 
   \begin{equation} 
      g(E) = 
   \end{equation} 
   yyyyyyyy  
 
\end{document} 

\EndVerbatim\EndHPage{}]\fi

\ifHtml[\HPage{test data}\Verbatim

\begin{eqnarray}
  x &=& y \\
  z &=& ww
\end{eqnarray}

\EndVerbatim\EndHPage{}]\fi

\ifHtml[\HPage{test data}\Verbatim

\documentstyle{report}

\input tex4ht.sty \Preamble{html} 
     \begin{document}  
  \EndPreamble

a pair of these characters as ``argument delimiters''.  I usually use the 
\verb"@" or \verb@"@ charachters, as I rarely have any other uses for them.
Thus

\result{%
\noindent use \verb"\%" to obtain a \% sign
}
\noindent
 is typed as

\moveright0.1\textwidth\vbox{
\footnotesize\begin{verbatim}
use \verb"\%" to obtain a \% sign
\end{verbatim}
}

YES-NO for `{\tt <P>}'

The section of program in NO
\begin{verbatim}
{ this finds %a & %b }

for i := 1 to 27 do
\end{verbatim}
NO xxxxxxxxxxxxxxxxxxxxxxxxxxxxx{x1}

The section of program in YES

\begin{verbatim}
{ this finds %a & %b }

for i := 1 to 27 do
\end{verbatim}
YES xxxxxxxxxxxxxxxxxxxxxxxxxxxxx{x2}

The section of program inNO
\begin{quote}\begin{verbatim}
{ this finds %a & %b }

for i := 1 to 27 do
\end{verbatim}\end{quote}
NOxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{x3}

The section of program inNO

\begin{quote}\begin{verbatim}
{ this finds %a & %b }

for i := 1 to 27 do
\end{verbatim}\end{quote}

NOxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{x4}

aaaaaaaaaaaaaaaaaaaaaaaa

\end{document}

\EndVerbatim\EndHPage{}]\fi

Commands \''\setbox...= box{...}' might produce extra spaces because
of the \''\par\leavevmode', an undesirable phenomena for framed
pictures.  Since boxes are in any case a problem for us for standard
text, we are probably better-off deal properly at least with pictures.

\<html latex env\><<<
|<initial env configurations|>
>>>

The above had \`'}{\csname after:listend\endcsname' earlier.

The following are needed for cases like

\Verbatim
\newenvironment{syntax}{\begin{center}
                        \begin{tabular}{|p{0.9\linewidth}|} \hline}%
                       {\hline
                        \end{tabular}
                        \end{center}}
\begin{syntax} aa \\  \end{syntax}
\EndVerbatim

\<ignore par before hline in end\><<<
\ifx \EndPicture\:UnDef
   \def\:temp{|<end row before hline|>%
      \expandafter\expandafter\expandafter\:temp}%
   \expandafter\:temp 
\fi
>>>

\<end row before hline\><<<
\def\:temp{%
   \def\:temp{\IgnorePar 
     \ifx \:tempa\hline \expandafter\\\else\fi
   }%
   \futurelet\:tempa\:temp
}%
>>>

[\HPage{test data}\Verbatim
\Picture*{} 
   \begin{tabular}{|c|c|} 
     A & B \\ 
     0 & \x \\ 
   \end{tabular} 
\EndPicture 
\EndVerbatim\EndHPage{}]

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{ConfigureEnv}

In the following, a list configuration is requested only if either
the third or the fourth parameter is not empty.

\<config latex.ltx utilities\><<<
\long\def\ConfigureEnv#1#2#3#4#5{%
   \def\:temp{#2#3#4#5}\ifx \:temp\empty \let\:temp|=\null
   \else   \def\:temp{#2#3}\fi
   \ifx \:temp\empty \else 
      \expandafter\def\csname before:begin#1\endcsname
         {#2\def\after:end{#3}}%
   \fi
   \def\:temp{#2#3#4#5}\ifx \:temp\empty \let\:temp|=\null
   \else   \def\:temp{#4#5}\fi
   \ifx \:temp\empty 
                   \else \ConfigureList{#1}{#4}{#5}{}{}\fi}
>>>

\<config latex.ltx utilitiesNO\><<<
\NewConfigure{TraceEnv}[4]{\def\trc:Bg{#1}\def\trc:eBg{#2}%
   \def\trc:Nd{#3}\def\trc:eNd{#4}}
\NewConfigure{TraceList}[8]{\def\trc:Ls{#1}\def\trc:eLs{#2}%
   \def\trc:El{#3}\def\trc:eEl{#4}\def\trc:It{#5}\def\trc:eIt{#6}%
   \def\trc:iT{#7}\def\trc:eiT{#8}}
>>>

\<latex trace configurations\><<<
\:CheckOption{hooks+}  \if:Option
    \def\trc:wrt{\writesixteen}
\else \:CheckOption{hooks}  \if:Option
    \let\trc:wrt|=\:gobble
\fi\fi

>>>

XML as a backend for LaTeX

\<latex.ltx latex trace configurations\><<<
|<latex.ltx non trace configurations|>
\:CheckOption{hooks++} \if:Option
   |<latex.ltx latex edit+ commands|>
\else \:CheckOption{hooks+}  \if:Option
       \def\trc:wrt{\writesixteen}
    \else \:CheckOption{hooks}  \if:Option
       \let\trc:wrt|=\:gobble
    \fi\fi
 \if:Option
   \if:latex |<latex.ltx latex edit commands|>\fi
\fi\fi
>>>

\<latex.ltx latex edit+ commands\><<<
\long\def\ConfigureEnv#1#2#3#4#5{%
      \expandafter\def\csname before:begin#1\endcsname{%
           \ifx \EndPicture\:Undef\a:trc Env(#1)1\b:trc\fi 
           #2\ifx \EndPicture\:Undef\c:trc Env(#1)1\d:trc\fi
          \def\after:end{%
                \ifx \EndPicture\:Undef\a:trc END(#1)2\b:trc\fi
                #3\ifx \EndPicture\:Undef\c:trc END(#1)2\d:trc\fi
          }}%
       \ConfigureList{#1}{#4}{#5}{}{}}
>>>

\<latex.ltx latex edit commands\><<<
\long\def\ConfigureEnv#1#2#3#4#5{%
      \expandafter\def\csname before:begin#1\endcsname{%
         \def\:temp{#2}\ifx \:temp\empty
           \ifx \EndPicture\:Undef\a:trc Env(#1)1\b:trc\fi 
           #2\ifx \EndPicture\:Undef\c:trc Env(#1)1\d:trc\fi
         \else #2\fi
          \def\after:end{%
              \def\:temp{#3}\ifx \:temp\empty
                \ifx \EndPicture\:Undef\a:trc Env(#1)2\b:trc\fi
                #3\ifx \EndPicture\:Undef\c:trc Env(#1)2\d:trc\fi
              \else #3\fi
          }}%
       \ConfigureList{#1}{#4}{#5}{}{}}
>>>

\<hooks+ for ConfigureEnv\><<<
\:CheckOption{hooks+}  \if:Option
   \pend:defI\begin{\expandafter
      \ifx\csname before:begin##1\endcsname\relax
      \expandafter\ifx\csname bfr:begin##1\endcsname\relax
         \writesixteen{....\string\ConfigureEnv{##1}{}{}{}{}}%
         \expandafter\let\csname bfr:begin##1\endcsname=\empty
      \fi\fi}
\fi
>>>

\Section{CR-based Line Breaks}

Line breaks \''\\' in , for instance, the \`'verse' environment 
are requested indirectly through the following.

\<html latex env\><<<
\def\@centercr{\ifhmode \unskip\else \@nolnerr\fi 
   \ifx \EndPicture\:UnDef \a:centercr \b:centercr
   \fi    \par   \@ifstar{\nobreak\@xcentercr}\@xcentercr}
>>>

\<html latex env\><<<
\def\@icentercr[#1]{%
   \ifx \EndPicture\:UnDef
      \ifdim #1>0.5\baselineskip \a:centercr\fi
   \fi  \vskip #1\ignorespaces}
>>>

\<config latex.ltx utilities\><<<
\NewConfigure{centercr}{2}
>>>

Where \`'<P>' comes from???

\ifHtml[\HPage{test data}\Verbatim

\documentstyle{article}

 \input tex4ht.sty \Preamble{html,fonts}
        \begin{document}
     \EndPreamble

\begin{verse}
Gertjan Klein\\
Postbus 23656
\end{verse}

\end{document}

\EndVerbatim\EndHPage{}]\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Verbatim}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<html latex local env\><<<
\bgroup
\gdef\:scriptenv:breakhyphen{\hbox{}}
  \catcode`\-=13
  \catcode`\(=1   \catcode`\)=2  \catcode`\/=0
  \catcode`\{=12   \catcode`\}=12  \catcode`\\=12
/gdef/ScriptEnv#1(%
   /expandafter/let/csname :#1:/endcsname=/empty
   /edef/:temp(/def/expandafter/noexpand/csname a:#1/endcsname
      ####1/expandafter/noexpand/csname end/endcsname{#1}%
      (####1/noexpand/:EndVerbatim/noexpand/end(#1)))/:temp
%   /expandafter/def/csname 
%      b:#1/endcsname##1\end{#1}(##1/:EndVerbatim/end(#1))%
   /expandafter/def/csname
      b:#1/endcsname(/bgroup /catcode`/-=13 
     /def/:temp####1\end{#1}(/egroup 
         /def-(/string-/:scriptenv:breakhyphen/relax)%
         ####1/:EndVerbatim%
         /expandafter/def/csname end#1/endcsname()%
         /end(#1))%
     /:temp)%
   /edef/:temp(/noexpand/DefScript:
      /expandafter/noexpand/csname #1/endcsname
      (/expandafter/noexpand/csname a:#1/endcsname)%
      (/expandafter/noexpand/csname b:#1/endcsname))/:temp
)
/egroup
>>>

The following is for \`'\verb'.

\<html latex local env\><<<
\let\:sverb|=\@sverb
\def\@sverb#1{\a:verb \pend:def\verb@egroup{\b:verb}%
   \:sverb#1}
>>>

A \`'\aftergroup\b:verb' is no good above because it is preceded by 
a \''\aftergroup' for an embedded \''\obeylines' commands which can produce, for instance, 
\`'<NOBR><CODE>strong</NOBR></CODE>'.

The \`'\HChar{160}=\:nbsp' is required in empty lines by Netscape. Tex4ht
also loses empty lines, byt it can survive with the weaker
insertion of \`'\special{t4ht=<!---->}'.

\<html latex local env\><<<
\let\:temp|=\@verbatim
\HLet\@verbatim|=\:temp
\pend:def\@verbatim{%
  \Configure{obeylines}{\let\ |=\v:ch}{}{\v:par}}
>>>

\<config latex.ltx utilities\><<<
\NewConfigure{verbatim}[2]{\c:def\v:par{#1}\c:def\v:ch{#2}}
\def\c:verb:#1#2{\c:def\a:verb{#1}\c:def\b:verb{#2}}
>>>

The \''\SaveEverypar...\RecallEverypar' needs to be well parenthesized
here with those in the embeded lists.  The indirection through
\''\end:saveeverypar' is because the \''\endverbatim' can be for
a start of a \''\verbatim' from another lib (e.g., verbatim.sty).

The configuration of the verbatim environment is on the loop, not
the begin-end, to eliminate extra lines in the content.

\`'\ConfigureEnv{verbatim}{}{}{\env:verb}{\endenv:verb}' fails in
\Link[/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/tools/verbatim.sty]{}{}%
verbatim.sty\EndLink. The same is true whn nested within another
\`'\begin{..}...\end{..}' block.  This is so because only the external-most
list entries are \ifHtml[\HPage{recognized}\Verbatim

\ConfigureEnv{verbatim}{AA}{BB}{11}{22}

\ConfigureEnv{foo}{}{}{}{}

\begin{foo}
\begin{verbatim}
XXXX
\end{verbatim}
\end{foo}

\ConfigureEnv{foo}{}{}{}{ }

\begin{foo}
\begin{verbatim}
XXXX
\end{verbatim}
\end{foo}
\EndVerbatim\EndHPage{}]\fi.

\ifHtml[\HPage{test data}\Verbatim
\documentstyle{article}

\input tex4ht.sty \Preamble{html,fonts}
        \begin{document}
     \EndPreamble

ati

\begin{enumerate}    \item All

\begin{verbatim}  $x$  \end{verbatim}

\end{enumerate}   The

s document was

\moveright0.1\textwidth\vbox{%
\begin{verbatim}
\subsection{Sectioning commands}
\end{verbatim}
}
\noindent and that was all that was required to get the numbered
sectio

YES-NO for `{\tt <P>}'

The section of program in NO
\begin{verbatim}
{ this finds %a & %b }

for i := 1 to 27 do
\end{verbatim}
NO xxxxxxxxxxxxxxxxxxxxxxxxxxxxx{x1}

The section of program in YES

\begin{verbatim}
{ this finds %a & %b }

for i := 1 to 27 do
\end{verbatim}
YES xxxxxxxxxxxxxxxxxxxxxxxxxxxxx{x2}

The section of program inNO
\begin{quote}\begin{verbatim}
{ this finds %a & %b }

for i := 1 to 27 do
\end{verbatim}\end{quote}
NOxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{x3}

YESThe section of pr

YESogram inNO

\begin{quote}\begin{verbatim}
{ this finds %a & %b }

for i := 1 to 27 do
\end{verbatim}\end{quote}

NOxxxxxxxxxxxxxxxxxxxxxxxxxxxxx{x4}

aaaaaaaaaaaaaaaaaaaaaaaa

\end{document}

\EndVerbatim\EndHPage{}]\fi

The verbatim environmrnt is typeset in \''\trivlist' environment
that intreduces paragraph break in the first line through
\''\def\:D:T{<P>}'.  To eliminate the spaces that precede we introduce
the parindent=0.

\<leading line in /verbatim\><<<
\parindent|=\z@ 
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Math Setup}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltmath.dtx]{}{}ltmath.dtx\EndLink

\<latex ltmath\><<<
|<plain,latex bordermatrix|>
|<displaylines|>
|<plain,latex math symbols|>        
|<latex math symbols|>        
|<plain,latex math|>
|<latex math|>
|<html eqnarray|>
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Big, BIG, ....}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

We could have taken the following into using \''<BIG>', but this
wouldn't probably make much sense because the other stuf would
probably not fit.

\<fontmath + plain classes\><<<
\def\:tempc#1{{\hbox{\pic:gobble\a:big$\pic:gobble\c:big\left#1\vbox
    to8.5\p@{}\right.\n@space\pic:gobble\d:big$\pic:gobble\b:big}}}
\HLet\big=\:tempc
\def\:tempc#1{{\hbox{\pic:gobble\a:Big$\pic:gobble\c:Big\left#1\vbox
    to11.5\p@{}\right.\n@space\pic:gobble\d:Big$\pic:gobble\b:Big}}}
\HLet\Big\:tempc
\def\:tempc#1{{\hbox{\pic:gobble\a:bigg$\pic:gobble\c:bigg\left#1\vbox
    to14.5\p@{}\right.\n@space\pic:gobble\d:bigg$\pic:gobble\b:bigg}}}
\HLet\bigg\:tempc
\def\:tempc#1{{\hbox{\pic:gobble\a:Bigg$\pic:gobble\c:Bigg\left#1\vbox
    to17.5\p@{}\right.\n@space\pic:gobble\d:Bigg$\pic:gobble\b:Bigg}}}
\HLet\Bigg\:tempc
\HLet\Bigg=\:tempc
\NewConfigure{big}{4}    
\NewConfigure{Big}{4}    
\NewConfigure{bigg}{4}    
\NewConfigure{Bigg}{4}    
>>>

Need the following revisions for mathopen etc. Originally, we had
parameterless definitions. 

\<plain,latex math\><<<
\def\bigl#1{\mathopen{\big{#1}}}
\def\bigm#1{\mathrel{\big{#1}}}
\def\bigr#1{\mathclose{\big{#1}}}
\def\Bigl#1{\mathopen{\Big{#1}}}
\def\Bigm#1{\mathrel{\Big{#1}}}
\def\Bigr#1{\mathclose{\Big{#1}}}
\def\biggl#1{\mathopen{\bigg{#1}}}
\def\biggm#1{\mathrel{\bigg{#1}}}
\def\biggr#1{\mathclose{\bigg{#1}}}
\def\Biggl#1{\mathopen{\Bigg{#1}}}
\def\Biggm#1{\mathrel{\Bigg{#1}}}
\def\Biggr#1{\mathclose{\Bigg{#1}}}
>>>

\<plain,latex math\><<<
\def\:tempc{\a:quad}   \HLet\quad|=\:tempc
\def\:tempc{\a:qquad}  \HLet\qquad|=\:tempc
\NewConfigure{quad}{1}        \Configure{quad}{\o:quad:}
\NewConfigure{qquad}{1}       \Configure{qquad}{\o:qquad:}
>>>


% \def\,{\mskip\thinmuskip}
% \def\>{\mskip\medmuskip}
% \def\;{\mskip\thickmuskip}
% \def\!{\mskip-\thinmuskip}
% 
% \DeclareRobustCommand{\,}{%
%    \relax\ifmmode\mskip\thinmuskip\else\thinspace\fi
% }

LaTeX release from October 2020 made spacing commands originally available only in the math
mode available also in the text mode. The following configurations are based on the LaTeX kernel
of this release. The configurable hooks are used only in the math mode, as they were used in 
this way originally. These configurations are used in the MathML mode.

\<latex math\><<<
\NewConfigure{;}{1}
\NewConfigure{!}{1}
\NewConfigure{:}{1}
\NewConfigure{,}{1}
\NewConfigure{>}{1}
\DeclareRobustCommand\:tmspace[2]{%
  \ifmmode\expandafter\csname a:#1\endcsname%
  \else\leavevmode@ifvmode\kern#2\fi\relax%
}
\DeclareRobustCommand\,{\:tmspace{,}{.16667em}}
\DeclareRobustCommand\;{\:tmspace;{.2777em}}
\DeclareRobustCommand\!{\:tmspace!{-.16667em}}
\DeclareRobustCommand\:{\:tmspace{:}{.2222em}}
\DeclareRobustCommand\>{\:tmspace;{.2222em}}
\let\thinspace\,
\let\medspace\:
\let\negthinspace\!
\let\thickspace\;
\Configure{,}{\mskip\thinmuskip}
\Configure{;}{\mskip\thickmuskip}
\Configure{!}{\mskip-\thinmuskip}
\Configure{:}{\mskip\medmuskip}
\Configure{>}{\mskip\medmuskip}
>>>

We need to make some commands robust, using the ProvideDocumentCommand. 
This should prevent fatal errors when such commands are used in sections
or captions.

\<latex math\><<<
\ProvideDocumentCommand\left:temp{m}{\a:left{#1}\o:left:#1\b:left{#1}}
\HLet\left\left:temp
\ProvideDocumentCommand\right:temp{m}{\a:right{#1}\o:right:#1\b:right{#1}}
\HLet\right\right:temp
>>>

\<plain math\><<<
 \def\:tempc{\relax\csname a:,\endcsname}
\HLet\,=\:tempc
\NewConfigure{,}{1} 
\NewConfigure{;}{1}
\NewConfigure{!}{1}
\NewConfigure{:}{1}
\NewConfigure{>}{1}
\Configure{,}{\relax \ifmmode \mskip \thinmuskip \else \thinspace \fi}
>>>

\ifHtml[\HPage{more}\Verbatim

>  - The user.tex document does some tricks with square hooks that cause
> them:
>   + to be written as GIF files

A \big? is internally defined as a construct `\left?\right.', where
normally costructs of the form `\left?...\right?' are used for larger
formulas (that TeX4ht converts to formulas}.  I changed, at least for
the time being, the definition of \big to avoid creating pictures for
its arguments.

>   + to not be recognised as equal (i.e., two ['s in two places will be
>     written as two GIF files).

This is a problem that I don't have a satisfying solution for it
(except of providing some tools that allow with minimal user
intervention to eliminate duplications).  At some point I toyed with
the idea of using a perl script to reduce duplications, but I shelved
it as a low priority task.

> This is unpleasant, and I wonder if TeX4ht can do something about it (I
> do realize that it is weird trickery in the source that causes the
> problems to begin with).

The code is fine in this case.  TeX4ht should take the full blame.

> The following document demonstrates:
> 
>   \documentstyle[fullpage]{article}
>   \input tex4ht.sty
> 
>   \def\unit#1{\hbox{\tt #1}} % ... \unit{-x foo} ...
>   \def\meta#1{{\it #1\/}}    % ... <blah> ...
> 
>   \newenvironment{command}{\def\[{$\bigl[$}\def\]{$\bigr]$}\def\|{$\big\vert$}%
>     \parindent=-2em\advance\leftskip by -\parindent\vskip -\parskip~\par
>     \begingroup\tt\textfont0=\font}{%
>     ~\endgroup\par\advance\hoffset by \parindent}
> 
>   \Preamble{html}
>   \begin{document}
>   \EndPreamble
> 
>   \begin{command}
>     /sbin/lilo
>       \unit{\[ -C \meta{config\_file} \]}
>       \unit{-q}
>       \unit{\[ -m \meta{map\_file} \]}
>       \unit{\[ -v $\ldots$ \]}
>   \end{command}
> 
>   \end{document}
> 

\EndVerbatim\EndHPage{}]\fi

The following is to handle math primes like in \'+$A'$+, \'+$A''$+,
 \'+$A'_5$+, and \'+$A_5'$+.  Latex converts such primes to \'+^{\prime}+

\<latex math\><<<
\def\:temp{\csname a:'\endcsname
   \bgroup |<b: '|>\prim@s}
\HLet\active@math@prime|=\:temp
{\catcode`\'=\active \global\let'\active@math@prime}
|<plain,latex math prime|>
>>>

\<plain,latex math prime\><<<
\let\:tempc|=\prim@s
\pend:def\:tempc{\csname c:'\endcsname\:gobble}
\HLet\prim@s|=\:tempc
\NewConfigure{'}{3}
\Configure{'}{}{}{\prime}
>>>

We want to expose the closing configuration out the \''\egrop' abd \''\fi', 
to be able to check for successive subscripts in caes of subsup.

\<b: '\><<<
\aftergroup\:pr@m@s
>>>

\<latex math\><<<
\def\:pr@m@s{\futurelet\:temp\pr@m:s}
\def\pr@m:s{%
  \ifx\:temp\fi \expandafter\expandafter\expandafter\:pr@m@s
  \else \expandafter\expandafter\csname b:'\endcsname\fi}
>>>

\<plain math\><<<
\def\:temp{\csname a:'\endcsname
   \bgroup |<b: '|>\prim@s}
{\catcode`\'=\active \HLet'=\:temp \global\let'=`}
|<plain,latex math prime|>
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{Choose}
%%%%%%%%%%%%%%%%%%%%%%%

\<plain,latex math\><<<
\def\atop:choose#1#2#3{\a:choose}
\def\:temp{%
   \expandafter \ifx\csname a:choose\endcsname\relax \else
   \ifx\a:choose\empty \else
      \Configure{atopwithdelims}{\atop:choose}{}%
   \fi\fi
   \o:choose:}
\HLet\choose=\:temp
\NewConfigure{choose}{1}
>>>

\<body of amsmath.sty\><<<
\def\above:tbinom#1#2#3#4{\a:tbinom}
\def\:temp{%
   \expandafter \ifx\csname a:tbinom\endcsname\relax \else
   \ifx\a:tbinom\empty \else
      \Configure{abovewithdelims}{\above:tbinom}{}%
   \fi\fi
   \o:tbinom:}
\HLet\tbinom\:temp
\NewConfigure{tbinom}{1}
>>>

\<body of amsmath.sty\><<<
\def\above:dbinom#1#2#3#4{\a:dbinom}
\def\:temp{%
   \expandafter \ifx\csname a:dbinom\endcsname\relax \else
   \ifx\a:dbinom\empty \else
      \Configure{abovewithdelims}{\above:dbinom}{}%
   \fi\fi
   \o:dbinom:}
\HLet\dbinom\:temp
\NewConfigure{dbinom}{1}
>>>

\<body of amsmath.sty\><<<
\def\above:binom#1#2#3#4{\a:binom}
\def\:temp#1{%
   \def\:temp{%
      \expandafter \ifx\csname a:binom\endcsname\relax \else
      \ifx\a:binom\empty \else   
         \Configure{abovewithdelims}{\above:binom}{}%
      \fi\fi
      #1}}
\expandafter\:temp\expandafter{\csname o:binom :\endcsname}
\expandafter\HLet\csname binom \endcsname\:temp
\NewConfigure{binom}{1}
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{Mathpalette}
%%%%%%%%%%%%%%%%%%%%%%%

\<plain,latex math\><<<
\def\:temp#1#2{\a:mthpl\o:mathpalette:{#1}{#2}\b:mthpl}  
\HLet\mathpalette|=\:temp
\NewConfigure{mathpalette}[2]{\c:def\a:mthpl{#1}\c:def\b:mthpl{#2}}
\Configure{mathpalette}{}{}
|<phantom and smash|>
>>>

The following is to avoid empty pictures.

\<phantom and smash\><<<
\def\:temp{\relax
  \ifmmode \expandafter\o:mathpalette:\expandafter\mathph@nt
  \else  \expandafter\makeph@nt  \fi}
\HLet\ph@nt|=\:temp
\def\:temp{\relax 
  \ifmmode  \expandafter\o:mathpalette:\expandafter\mathsm@sh
  \else     \expandafter\makesm@sh  \fi}
\HLet\smash|=\:temp
>>>

Before we hade for non-pic 
\Verbatim
\expandafter\ifx \csname\string#1:\endcsname\relax
      \ifx \a:mthpl\empty\else
         \a:mthpl\expandafter\:gobble\string#1\b:mthpl
      \fi
   \else \expandafter\expandafter\expandafter
      \csname\string#1:\endcsname\fi
   \o:mathpalette:{#1}}
\EndVerbatim
However, the first parameter need not be a singlton macro, so we had
failures with that code.

\Section{roots}

\<plain,latex math\><<<
\def\:temp #1\of #2{%
    {\a:root #1\b:root#2\c:root}}
\HLet\root|=\:temp
\NewConfigure{root}{3}  
>>>

\Section{Matrices}

\SubSection{Cases}

% \def\cases#1{\left\{\,\vcenter{\normalbaselines\m@th
%     \ialign{$##\hfil$&\quad{##}\hfil\crcr#1\crcr}}\right.}

Under pic math the \''\cases' becomes a picture due to the \''\left' 
and \''\right' operations.

\<plain,latex math\><<<
\NewConfigure{cases}[8]{\c:def\a:cases{#1}\c:def\b:cases{#2}%
    \c:def\c:cases{#5}\c:def\d:cases{#6}\c:def\e:cases{#7}%
    \c:def\f:cases{#8}\c:def\g:cases{#3}\c:def\h:cases{#4}}
\Configure{cases}{}{}{}{}{}{}{}{}
>>>

\<plain,latex math\><<<
\def\:tempc#1{\tx:halign{cases}{#1}}
\HLet\cases|=\:tempc
                                    \catcode`\#13 \catcode`\!6
\def\reg:cases!1{\left\{\vcenter{\normalbaselines\m@th  \g:cases
   \SaveMkHalignConf:g{cases}\RecallTeXcr
   \MkHalign#{$#$&{#}}!1\crcr
   \EndMkHalign\RecallMkHalignConfig   \h:cases}\right.}
                                    \catcode`\#=6 \catcode`\!=12
>>>

%%%%%%%%%%%%%%%%%%%
\SubSection{matrix}
%%%%%%%%%%%%%%%%%%%

% \def\matrix#1{\null\,\vcenter{\normalbaselines\m@th
%     \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
%       \mathstrut\crcr\noalign{\kern-\baselineskip}
%       #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,}

The last four parameters of pictorial configurations must be empty.

\<plain,latex math\><<<
\def\:tempc#1{\tx:halign{matrix}{#1}}
\HLet\matrix|=\:tempc
                                    \catcode`\#13 \catcode`\!6
\def\reg:matrix!1{\null\,\vcenter{\normalbaselines\m@th
   \SaveMkHalignConf:g{matrix}\RecallTeXcr
   \MkHalign#{$#$&&$#$}!1\crcr
   \EndMkHalign\RecallMkHalignConfig}}
                                    \catcode`\#=6 \catcode`\!=12
\NewConfigure{matrix}{6}
>>>

%%%%%%%%%%%%%%%%%%%%%
\SubSection{pmatrix}
%%%%%%%%%%%%%%%%%%%%

\<plain,latex math\><<<
\:CheckOption{no-pmatrix} \if:Option \else
   |<shared plain/latex pmatrix|>
\fi
>>>

\<shared plain/latex pmatrix\><<<
\def\:temp#1{\a:pmatrix\o:pmatrix:{#1}\b:pmatrix}
\HLet\pmatrix|=\:temp
>>>

\<shared plain/latex pmatrix\><<<
\NewConfigure{pmatrix}{2}
>>>

\Section{TeX and LaTex: Bordermatrix}

\<plain,latex bordermatrix\><<<
\def\:temp#1{\a:bordermatrix\o:bordermatrix:{#1}\b:bordermatrix}
\HLet\bordermatrix|=\:temp
\NewConfigure{bordermatrix}{2}
>>>

\Section{Displaylines}

\<displaylines\><<<
\def\tx:halign#1#2{\csname a:#1\endcsname
   \csname  \ifx \EndPicture\:Undef reg:#1\else o:#1:\fi
   \endcsname{#2}\csname b:#1\endcsname}
>>>

\<displaylines\><<<
\def\:tempc#1{\tx:halign{displaylines}{#1}}
\HLet\displaylines|=\:tempc
                                    \catcode`\#13 \catcode`\!6
\def\reg:displaylines!1{\tabskip\z@skip    
   \SaveMkHalignConf:g{displaylines}\RecallTeXcr
   \MkHalign#{\hbox{$\@lign\displaystyle#$}}!1\crcr
   \EndMkHalign\RecallMkHalignConfig}
                                    \catcode`\#=6 \catcode`\!=12
\NewConfigure{displaylines}{4}
>>>

\<displaylinesNO\><<<
\def\:temp#1{\displ@y
   |<html mode for displaylines|>%
   \TeXhalign {\hbox {$\@lign \displaystyle
       \ar:fld \R:dspln ##\r:dspln
       $}\crcr #1\aftergroup\t:dspln\crcr }}
\HLet\displaylines|=\:temp
\NewConfigure{displaylines}[4]{%
   \c:def\T:dspln{#1}\c:def\t:dspln{#2}%
   \c:def\R:dspln{#3}\c:def\r:dspln{#4}}
>>>

\<html mode for displaylinesNO\><<<
\ifx \EndPicture\:UnDef
  \def\ar:fld{\T:dspln\global\let\ar:fld|=\empty}%
\else \let\ar:fld|=\empty
\fi
>>>

When option \`'no-halign' is up, the command \`'\h:noalign' is undefined.

\<restore nohalignNO\><<<
\csname h:noalign\endcsname
>>>

\<plain,latex utilities\><<<
\:CheckOption{no-halign} \if:Option \else
   \def\:temp{\everycr{}}
   \HLet\displ@y|=\:temp
\fi
>>>

%    \pend:def\@lign{\h:noalign}
% \pend:def\displ@y{\HRestore\noalign}

\ifHtml[\HPage{test data}\Verbatim
\input tex4ht.sty  \Preamble{html}   \EndPreamble

$$
\displaylines{
.\cr} 
$$

\csname bye\endcsname

\EndVerbatim\EndHPage{}]\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55
\Section{[] and ()}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%55

\<latex,sty math del\><<<
  \protected\def\({\leavevmode\st:math}
  \protected\def\){\ed:math}
\NewConfigure{()}[2]{\def\st:math{#1}\def\ed:math{#2}}
  \def\[{\st:Math}
  \def\]{\ed:Math}
\NewConfigure{[]}[2]{\def\st:Math{#1}\def\ed:Math{#2}}
\Configure{()}{$}{$}
\Configure{[]}{$$}{$$}
>>>

\<amsmath.sty\><<<
\expandafter\def\csname [ \endcsname{\st:Math}
\expandafter\def\csname ] \endcsname{\ed:Math}
>>>

% Should be \Configure{[]}{\begin{equation*}}{\end{equation*}}

\<more latex math\><<<
|<latex,sty math del|>
\ifx \a:mth\:UnDef 
   \expandafter\pend:defIII\csname c:$:\endcsname{%
      \ifx \a:mth\:UnDef |<protect (...) math|>\fi
      |<fix for tabular|>}
\else
   |<protect (...) math|>
   |<fix for tabular|>%
\fi
\ifx \a:display\:UnDef 
   \expandafter\pend:defIII\csname c:$$:\endcsname{%
      \ifx \a:display\:UnDef |<protect [...] math|>\fi}
\else
   |<protect [...] math|>
\fi

>>>

\<protect (...) math\><<<
\let\orig:smath\(
\let\orig:emath\)
\protected\def\:tempa{\bgroup\let\a:mth\empty
   \let\b:mth\empty  \let\c:mth\empty\orig:smath}
\let\(\:tempa
\protected\def\:tempa{\orig:emath\egroup}
\let\)\:tempa
>>>

\<protect [...] math\><<<
\pend:def\[{\bgroup\let\a:display|=\empty 
   \let\b:display|=\empty  \let\c:display|=\empty }%
\append:def\]{\egroup}%
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \Section{Equation (latex, amsmath, fleqn)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The equation environment is defined in different manners within
the different packages.

\SubSection{in latex.ltx}

\Verbatim
\def\equation{$$\refstepcounter{equation}}
\def\endequation{\eqno \hbox{\@eqnnum}$$\global\@ignoretrue}
\EndVerbatim

\<latex.ltx\><<<
\let\o:equation:|=\equation
\let\o:endequation:|=\endequation
\def\equation{\bgroup
   \ifx \EndPicture\:Undef  
      \def\endequation{%
          \if@eqnsw \expand:after{\o:endequation:\b:equation\equ:no}%
          \else \expand:after{\o:endequation:\egroup}\fi
          \c:equation\egroup}%
      \expandafter\a:equation 
   \else
         \def\endequation{\o:endequation:\egroup}
   \fi
   \o:equation:}
>>>

% \@fleqnfalse
% \let\@fleqnfalse\empty
% \let\@fleqntrue\empty

\<config latex.ltx shared\><<<
\NewConfigure{equation}[3]{%
  \c:def\a:equation{#1\bgroup\let\@eqnnum|=\empty}%
  \c:def\b:equation{\egroup#2}\c:def\c:equation{#3}}
\def\equ:no{\@eqnnum}
\Configure{equation}{}{}{}
>>>

\<equations of amsmath.sty\><<<
\def\equation{\bgroup |<amsmath-fleqn false|>%
  \ifx \EndPicture\:Undef
     \def\endequation{%
       \let\tagform@=\:gobble  
       \if@eqnsw \expand:after{%
          |<remove amsmath-fleqn number|>%
          \o:endequation:\b:equation\equ:no}%
       \else \expand:after{%
          \ifx\df@tag\@empty \expand:after{\o:endequation:\egroup}%
          \else
             \global\let\df:tag=\df@tag
             \expand:after{\o:endequation: \expandafter\b:equation\ifdefined\ams:delete:tag\else\df:tag\fi%
             \global\let\ams:delete:tag\@undefined
             }\fi
        }\fi
        \c:equation\egroup
      }%
      \expandafter\a:equation
   \else
      \def\endequation{\o:endequation:\egroup}%
   \fi
   \o:equation:}
>>>

\<equations of amsmath.sty\><<<
\expandafter\let\csname o:equation*:\expandafter
       \endcsname \csname equation*\endcsname
\expandafter\let\csname o:endequation*:\expandafter
       \endcsname \csname endequation*\endcsname
\expandafter\def\csname equation*\endcsname{\bgroup 
  \ifx \EndPicture\:Undef
     \expandafter\def\csname endequation*\endcsname {%
        \csname o:endequation*:\endcsname\egroup%
        \csname b:equation*\endcsname\egroup
      }%
      \csname a:equation*\endcsname
   \else
      \expandafter\def\csname endequation*\endcsname{\csname
                                 o:endequation*:\endcsname\egroup}%
   \fi
   \csname o:equation*:\endcsname}
\NewConfigure{equation*}[2]{
   \expandafter\c:def \csname a:equation*\endcsname {#1\bgroup \let \@eqnnum \empty }%
   \expandafter\c:def \csname b:equation*\endcsname {#2}%
}
>>>

% \def\equation{\bgroup 
%   \ifx \EndPicture\:Undef
%      \def\endequation{%
%         \o:endequation:\egroup%
%         \csname c:equation*\endcsname\egroup
%       }%
%       \csname a:equation*\endcsname
%    \else
%       \def\endequation{\o:endequation:\egroup}%
%    \fi
%    \o:equation:}
% 
% \expandafter\def\csname a:equation*\endcsname{\a:equation}
% \expandafter\def\csname c:equation*\endcsname{\c:equation}

\<amsmath-fleqn false\><<<
\@fleqnfalse
>>>

\<remove amsmath-fleqn numberNO\><<<
\if@fleqn
  \pend:def\endmathdisplay@fleqn{\global\let\df:tag=\df@tag
                       \gdef\df@tag{\global\let\df@tag=\df:tag}}%
\fi
>>>

\<\><<<
\NewConfigure{equation}[3]{%
  \c:def\a:equation{#1\bgroup \let\tagform@|=\:gobble }%
  \c:def\b:equation{\egroup#2}\c:def\c:equation{#3}}
>>>

Do we need the \`'\Configure{Picture*}{}{}%'?

%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Amsmath}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<config amsmath.sty utilitiesNO\><<<
\NewConfigure{equation}[1]{%
  \c:def\a:equation{#1}%
  \c:def\b:equation{\def\equ:no{}}\c:def\c:equation{}}
\Configure{equation}{}
>>>

%%%%%%%%%%%%%%%%%%
\SubSection{fleqn}
%%%%%%%%%%%%%%%%%%

\<fleqn.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% fleqn.4ht                            |version %
% Copyright (C) |CopyYear.1997.      Eitan M. Gurari         %
|<TeX4ht copyright|>

       |<config fleqn.clo utilities|>
       |<config fleqn.clo shared|>
\Hinput{fleqn}
\endinput
>>>        \AddFile{8}{fleqn}

\Verbatim
\renewenvironment{equation}%
    {\@beginparpenalty\predisplaypenalty
     \@endparpenalty\postdisplaypenalty
     \refstepcounter{equation}%
     \trivlist \item[]\leavevmode
       \hb@xt@\linewidth\bgroup $\m@th% $
         \displaystyle
         \hskip\mathindent}%
        {$\hfil % $
         \displaywidth\linewidth\hbox{\@eqnnum}%
       \egroup
     \endtrivlist}
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{stackrel}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<config latex.ltx utilities\><<<
\def\:temp#1#2{{\a:stackrel {\mathop {#2}\b:stackrel{#1}}\c:stackrel}}
\HLet\stackrel|=\:temp
\NewConfigure{stackrel}{3}
>>>

\SubSection{/frac}

\<latex math\><<<
\def\:temp#1#2{{\a:frac\begingroup
   #1\endgroup\b:frac \over \c:frac #2\d:frac}}
\HLet\frac|=\:temp
\NewConfigure{frac}{4}
>>>

\<amsamth.sty frac\><<<
{\a:frac\begingroup
   #1\endgroup\b:frac \@@over \c:frac #2\d:frac}%
>>>

\SubSection{Sqrt's}

\<latex math\><<<
\def\:temp#1{{\a:sqrtsign{\o:sqrtsign:{#1}}\b:sqrtsign}}
\HLet\sqrtsign|=\:temp
\NewConfigure{sqrtsign}{2}
>>>

\<plain math\><<<
\def\:temp#1{{\a:sqrt{\radical"270370 {#1}}\b:sqrt}}
\HLet\sqrt|=\:temp
\NewConfigure{sqrt}{2}
>>>

%%%%%%%%%%%%%%%%%%
\Section{Eqnarray}
%%%%%%%%%%%%%%%%%%

% \def\reg:eq:narray#1\displaywidth{\afterassignment\reg:eq:narrayA\let\:temp}
\<html eqnarray\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:eq:narray!1\cr{|<halign eqnarray|>}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<halign eqnarray\><<<
\SaveMkHalignConf:g{eq:narray\if@eqnsw\else *\fi}|%\HRestore\noalign|%
\MkHalign#{|<eqnarray pattern|>}%
>>>

\<eqnarray pattern\><<<
\hskip\@centering$\displaystyle\tabskip\z@skip{#}$\@eqnsel
  &\global\@eqcnt\@ne\hskip \tw@\arraycolsep \hfil${#}$\hfil
  &\global\@eqcnt\tw@ \hskip \tw@\arraycolsep
         $\displaystyle{#}$\hfil\tabskip\@centering
  &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss#\egroup \tabskip\z@skip
>>>

\<html eqnarray\><<<
\def\:tempc{
     \@@eqncr
     \EndMkHalign   \RecallMkHalignConfig
     \csname b:eq:narray\if@eqnsw\else *\fi\endcsname
     \global\advance\c@equation\m@ne
   $$\@ignoretrue }
\HLet\endeqnarray|=\:tempc
\def\:tempc{%
   |<def :currentlabel for eqnarray|>%
   \let\sv:halign=\halign \def\halign{\let\halign=\sv:halign 
   \eq:narray\halign}\o:eqnarray:}
\HLet\eqnarray|=\:tempc
\let\eq:narray|=\empty
\def\:tempc{\pic:MkHalign{eq:narray\if@eqnsw\else *\fi}}
\HLet\eq:narray|=\:tempc
\def\c:eqnarray:{\c:eq:narray:}  \NewConfigure{eq:narray}{6}
\expandafter\let\csname reg:eq:narray*\endcsname|=\reg:eq:narray
\expandafter\def\csname c:eqnarray*:\endcsname{\csname 
    c:eq:narray*:\endcsname}  \NewConfigure{eq:narray*}{6}
>>>

\<html eqnarray\><<<
\let\snd:halign|=\empty
\def\:temp[#1]{\ifnum 0=`{\fi }\@@eqncr}
\HLet\@xeqncr|=\:temp
\def\:temp{\let\reserved@a\relax
   \ifcase\@eqcnt \def\reserved@a{& & &}\or
       \def\reserved@a{& &}%
   \or \def\reserved@a{&}\else
     \let\reserved@a\@empty
     \@latex@error{Too many columns in eqnarray environment}\@ehc\fi
   \reserved@a |<fix eqnarray for /label|>%
   \global\@eqnswtrue\global\@eqcnt\z@\cr}
\HLet\@@eqncr|=\:temp
>>>

\`'\append:def\endeqnarray{}' is no good because
the tail of the table falls out of the traced math environment.
\`'
\def\endeqnarray{%
   \@@eqncr \egroup \global\advance\c@equation\m@ne
   \r:eqnar\t:eqnar\rc:roco $$\global\@ignoretrue }' is not good,
   because halign doesn't allow insertion iside the \`'$$'.  There are
   two \`'\snd:halign' out the \`$$': one inseted here, and one
   defined into the math env.  The first one is activated by the
   tracing of the math environment, immediately after the \`'$$'.

The indirection through \''\:temp' is required due to the \''\fi' 
without a visible \''\if'.

\<fix eqnarray for /label\><<<
\if@eqnsw \@eqnnum
  {\let\html:addr|=\empty |<def :currentlabel for eqncr|>}%
  \stepcounter{equation}\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{List Environments}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltlists.dtx]{}{}ltlists.dtx\EndLink

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Configure Description Lists}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The \''\begin#1' command has been expanded to call
\`'\csname on#1:list\endcsname' before calling
\`'\csname #1\endcsname', if \''\this:listConfigure' is empty.

\<latex ltlists\><<<
\long\def\ConfigureList#1#2#3#4#5{\expandafter
   \def\csname on#1:list\endcsname{\def\this:listConfigure{%
      \def\:DLL{#2}\def\:DT{#4}\def\:DD{#5}\def\end:DL{#3}%
      \tmp:cnt|=0  \def\:temp{#2#3#4#5}%
      \g:let\:DLL{#1}\g:let\:DT{#1}\g:let\:DD{#1}\g:let\end:DL{#1}%
      }}}
>>>

\<html lists\><<<
\let\:DL:|=\empty
\let\:OL:|=\empty
>>>

\Section{LaTeX}

\SubSection{The Items}

\Verbatim
        \def\item{\@inmatherr\item
          \@ifnextchar [\@item{\@noitemargtrue \@item[\@itemlabel]}}
        \def\@item[#1]{\if@noparitem ...  
                       \else ...\global\@inlabeltrue \fi
           \ht:everypar{\global\@minipagefalse\global\@newlistfalse
              \if@inlabel
                \global\@inlabelfalse
                \kern -\parindent
                \box\@labels
                \penalty\z@
              \fi
              \ht:everypar{}}%
           ....
           \sbox\@tempboxa{\makelabel{#1}}.... \ignorespaces}
\EndVerbatim

Note that in LaTeX the item starts at the start of the next paragrap, not
where the comamnd itself is present. Moreover, LaTex merges 
lists in \''\@donoparitem' when they are stacked directly on items.

\Verbatim

(P 0)......
\begin{trivlist}
\item[xxxA] 
        \begin{trivlist}
        \item[xxxB] 
                \begin{trivlist}
                \item[xxxC] (xxxAxxxBxxxC).................. 
                \item[xxx] (xxx).................. 
                \end{trivlist}
        \item[xxx] (xxx).................. 
        \end{trivlist}
        (P).........................
\item[xxx] 
\item[yyy](xxxyyy).................. 
\end{trivlist}
.........................

      -----------------------------------------

\begin{verbatim}
               (P 0)......
           xxxAxxxBxxxC ..................
           xxx ..................
           xxx ..................
               (P).........................
           xxx
           yyy ..................
            .........................
\end{verbatim}
\EndVerbatim

\<html latex lists\><<<
\let\:item|=\@item
\def\@item[#1]{\ifx \EndPicture\:Undef  
       |<prepend @item[...]|>\fi
   \if@newlist  \:item[{#1}]\@newlisttrue
   \else        \:item[{#1}]\fi    \global\@inlabeltrue
   \ifx \EndPicture\:Undef  
       |<append @item[...]|>\leavevmode    \ignorespaces
   \fi  }
>>>

We insert the \''\leavevmode' to ensure that all \''\items'
at the beginnig of lists are true. Otherwise,  the lack of them causes 
a lose of html-info  during collapsing effects as is the case, e.g., in
the following code.

\Verbatim
    The ten characters
    \begin{quote}\begin{verbatim}
    #  $  %  &  ~  _  ^  \ {  }
    \end{verbatim}\end{quote}
    should no
\EndVerbatim

In addition, without the \''\leavevmode' we can end up with an
outcome \`'<CODE 
>
      <LI>
      \@</CODE>' instead of \`'<LI><CODE 
>
      \@</CODE>'.

Within \`'|<prepend @item[...]|>', \''\if@noitemarg' indicates
whether we have a non user supplied label.  Within
\`'|<append @item[...]|>', \''\if@inlabel' does the job before
we encounter the first paragraph.

Note that \''X1111
   Y2222
   X1111
   X2222'
is the output of \`'\ht:everypar{X\ht:everypar{Y}}
    \par
1111
    \par
2222
    \par
\ht:everypar{X\ht:everypar{Y}}
    \par
{1111}
    \par
{2222}
'.  That is, the everypars might happen within groups. Hence, 
probably the reason for \''\if@inlabel'

\<append @item[...]\><<<
\ShowRefstepAnchor
\ht:everypar{%
   \if@newlist |<start new list|>\fi
   \global\@minipagefalse\global\@newlistfalse
   \if@inlabel
     \global\@inlabelfalse  
     |<before each item|>\box\@labels
     |<after each item|>%
     \penalty\z@
   \else  |<between list pars|>%
   \fi
   \ht:everypar{|<between list pars|>}}%
>>>

\<before each item\><<<
\global\let\empty:D:T:D|=\empty \:DT \hfill\break   
>>>

The \''\hfill\break' prevents collapsing of spaces.  We want to put
\'' \:DT ' at the end so it will gobble only the item mark.  However,
we can't because of the problem of collapsing spaces. 

\<after each item\><<<
\:DD \ShowPar
>>>

\<between list pars\><<<
\:ListParSkip   
>>>

\<html latex lists\><<<
\def\ListParSkip{\def\:ListParSkip}
\ListParSkip{\HtmlPar}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Boundary Points of Lists}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Because of the merging of into items lists that are 
stacked on them,
we first configure the new lis with

\<prepend @item[...]\><<<
\if@newlist        
   \null:listConfigure  \this:listConfigure
\fi  
\SkipRefstepAnchor
>>>

\<latex ltlists\><<<
\def\null:listConfigure{%
   \global\let\:DLL|=\empty
   \global\let\:DT|=\empty  \global\let\:DD|=\empty
   \global\let\end:DL|=\empty  \global\let\empty:D:T:D|=\empty}
\null:listConfigure   \let\this:listConfigure|=\empty
>>>

then we start it.

\''\:DL' is a variable in DraTeX.

\<start new list\><<<
\:DLL  \global\let\this:listConfigure|=\empty  
\gdef\empty:D:T:D{\:DT\:DD}%
>>>

The \''\ConfigureEnv' is needed for getting paragraph breaks 
after collapsed lists.

Do we need to to globally define \''\:DLL' here to empty,
and  save/resore it at \''\begin' and \''\end' boudaries.

The \''\endlist'  comamnd is defined in turns of \''\endtrivlist'.

\Verbatim
         \def\endtrivlist{%
           \if@inlabel\indent\fi
           \if@newlist\@noitemerr\fi
           \ifhmode\unskip \par\fi
           \if@noparlist \else
             \ifdim\lastskip >\z@
               \@tempskipa\lastskip \vskip -\lastskip
               \advance\@tempskipa\parskip \advance\@tempskipa -\@outerparskip
               \vskip\@tempskipa
             \fi
             \@endparenv
           \fi
         }
\EndVerbatim

\<html latex lists\><<<
\pend:def\endtrivlist{|<prepend end trivlist|>}
>>>

\<prepend end trivlist\><<<
\if@noparlist \else\ifx \EndPicture\:UnDef
   \ifhmode \unskip\else \vskip-\lastskip\fi     
   \empty:D:T:D                \global\let\empty:D:T:D|=\empty  
   \end:DL                     \global\let\end:DL|=\empty  
   \global\let\:DT|=\empty     \global\let\:DD|=\empty      
\fi \fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Boundary Points of Env Blocks}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<html latex lists\><<<
\pend:def\endlist{%
  \if@newlist 
     \:warning{Problem with 'list' environment. Expected syntax:
         \string\begin{list}{label}{spacing}
         \string\item .... \string\end{list}}%
     \global\@newlistfalse
  \fi 
}
>>>

\<html latex lists\><<<
\def\list:save{%
   \let\SVempty:D:T:D|=\empty:D:T:D                
   \let\SVend:DL|=\end:DL                     
   \let\SV:DT|=\:DT
   \let\SV:DD|=\:DD }
\def\list:recall{%
   \global\let\empty:D:T:D|=\SVempty:D:T:D                
   \global\let\end:DL|=\SVend:DL                     
   \global\let\:DT|=\SV:DT
   \global\let\:DD|=\SV:DD }
>>>

The \Verb!\@newlistfalse! inserted for handling the following case:

\Verbatim
    \documentclass{article} 
    \begin{document}  
    \catcode`\@=11 
    \begin{list}{}         %<-- missing argument
    \item  
    \hshow{-----item:NEW------------------------->\if@newlist NEW\else OLD\fi}%  
    a 
    \hshow{-----/item:OLD------------------------>\if@newlist NEW\else OLD\fi}%  
    \end{list}  
     
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Default Configurations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Note also the \''\ConfigureEnv' for the following lists.

\<html latex lists\><<<
\def\AnchorLabel{\anc:lbl x{}}
\def\DeleteMark#1\@labels{\hfill\break   
   \setbox0|=\vbox{\box\@labels}}
>>>

The \''\setbox' is to clear \''\@labels' from being accumulated for
latter on use.

\ifHtml[\HPage{test data for space collapsing}\Verbatim
ferent combinations of the following options:

\begin{description}
\item[The default.] The default partition to boot can be the first
one, the one with the active flag set, or can be configurable, depending
on the MBR. Some MBRs set the active flag in the MBR to the selected
partition, and hence default to it the next boot. This requires
rewriting the MBR, and therefore may conflict with virus protection
present in some BIOSes.

Note that there is another reason for setting the active flag to the
booted partition, and rewriting the MBR: MS-DOS gets horribly confused
if it is booted f

\end{description}

\EndVerbatim\EndHPage{}]\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Comments}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In early version we got a coplain that \''\unpenality' is not allowed
in vertical mode from the following code.

\Verbatim
\begin{trivlist}  \item\relax
    \ht:everypar \expandafter{\the\ht:everypar \unpenalty}
......
\end{trivlist}
\EndVerbatim

When an item is encountered it calls \''\makelabe' to create the label.

Commands \''\setbox...= box{...}' might produce extra spaces because
of the \''\par\leavevmode', an undesirable phenomena for framed
pictures.  Since boxes are in any case a problem for us for standard
text, we are probably better-off deal properly at least with pictures.

%

\ifHtml[\HPage{test data for crosss refs}\Verbatim

 \documentclass{book}
 \input tex4ht.sty  \Preamble{sections-,fonts,html}%,debug}  
                        \begin{document}
 \EndPreamble

\section{AA}                            %       0.1   AA
 
ref{1}-\ref{1}     NO                   %       ref10.1

ref{2}-\ref{2}     NO                   %       ref20.1

ref{3}-\ref{3}     NO                   %       ref30.1

ref{4}-\ref{4}     NO                   %       ref40.1

ref{5}-\ref{5}     YES                  %       ref61

ref{6}-\ref{6}     YES                  %       ref62

ref{5}-\ref{55}    NO                   %       ref50.1

ref{6}-\ref{66}    NO                   %       ref60.1

ref{7}-\ref{7}    NO                    %       ref70.1

ref{8}-\ref{8}    NO                 %          ref80.1

ref{9}-\ref{9}    NO                 %          ref90.1

ref{10}-\ref{10}  NO                 %          ref100.1

ref{11}-\ref{11}  NO                 %          ref110.1

ref{12}-\ref{12}  NO                 %          ref120.1

ref{13}-\ref{13}  NO                 %          ref130.1

ref{14}-\ref{14}  NO                 %          ref140.1

ref{15}-\ref{15}  NO                 %          ref150.1

\trivlist
\item aaaaaaaaaaaa  \label{1}       %       aaaaaaaaaaaa
\item bbbbbbbbbbbb  \label{2}       %       bbbbbbbbbbbb
\endtrivlist

\trivlist
\item[X1] aaaaaaaaaaaa  \label{3}    %      X1 aaaaaaaaaaaa
\item[X2] bbbbbbbbbbbb  \label{4}    %      X2 bbbbbbbbbbbb
\endtrivlist

\begin{enumerate}
\item aaaaaaaaaaaa  \label{5}       %         1. aaaaaaaaaaaa
\item bbbbbbbbbbbb  \label{6}       %         2. bbbbbbbbbbbb
\end{enumerate}

\begin{enumerate}
\item[X1] enum aaaaaaaaaaaa  \label{55}       % X1 enum aaaaaaaaaaaa
\item[X2] enum bbbbbbbbbbbb  \label{66}       % X2 enum bbbbbbbbbbbb

         no html comment here for link!
\end{enumerate}

\begin{description}
\item[X1] aaaaaaaaaaaa  \label{7}    %       X1 aaaaaaaaaaaa
\item[X2] bbbbbbbbbbbb  \label{8}    %       X2 bbbbbbbbbbbb
\end{description}

\begin{description}
\item aaaaaaaaaaaa  \label{9}       %        aaaaaaaaaaaa
\item bbbbbbbbbbbb  \label{10}      %        bbbbbbbbbbbb
\end{description}

\begin{itemize}
\item[X1] aaaaaaaaaaaa  \label{11}   %          X1 aaaaaaaaaaaa
\item[X2] bbbbbbbbbbbb  \label{12}   %          X2 bbbbbbbbbbbb
\end{itemize}

\begin{itemize}
\item aaaaaaaaaaaa  \label{13}      %          * aaaaaaaaaaaa
\item bbbbbbbbbbbb  \label{14}      %          * bbbbbbbbbbbb
\end{itemize}

\label{15}

\end{document}

\EndVerbatim\EndHPage{}]\fi

%%%%%%%%%%%%%%%%%
\Chapter{List-Based Environments}
%%%%%%%%%%%%%%%%

\Section{Verse, Quote, and Quoattion}

The \''\verse' carries the following def.

\Verbatim
               \newenvironment{verse}
               {\let\\\@centercr
                \list{}{\itemsep      \z@
                        \itemindent   -1.5em%
                        \listparindent\itemindent
                        \rightmargin  \leftmargin
                        \advance\leftmargin 1.5em}%
                \item\relax}
               {\endlist}
\EndVerbatim

The verse environment doesn't seem to need the 100\% width but we
include it because it costs nothing and without it there is a slight
deviation in the left margin from the quotation environments The
groups are for enclosed groups.

In LaTeX, these environment mainly enlarge the margins.

\Verbatim
         \newenvironment{quotation}
               {\list{}{\listparindent 1.5em%
                        \itemindent    \listparindent
                        \rightmargin   \leftmargin
                        \parsep        \z@ \@plus\p@}%
                \item\relax}
               {\endlist}
         \newenvironment{quote}
               {\list{}{\rightmargin\leftmargin}%
                \item\relax}
               {\endlist}
\EndVerbatim

The zero margins are in particular important for avoiding 
extra spaces in nested verbatim environments.

\<config book-report-article shared\><<<
\append:def\quotation{\a:quotation\par\@totalleftmargin|=\z@}
\NewConfigure{quotation}{1}
>>>

\<config book-report-article utilities\><<<
\append:def\quote{\par\@totalleftmargin|=\z@}
>>>

\SubSection{The Display}

 The \''<DIV>...</DIV>'   handles a few additional,
but not all, the missing line breaks in lynx.

The quote and quotation environments, at least,  must include 
100\% width of page to allow the flushing left, right, and center of
embedded environments. 

\Section{Centered}

\Verbatim
      \def\center{\trivlist \centering\item\relax}
      \def\endcenter{\endtrivlist}
\EndVerbatim

The \''\par' is for allowing also the last paragraph to be
formatted in the 

The table is uggly in the following.
It is included for the surrounding space, and for grouping
within other environments.

\Verbatim
\documentstyle{article}

 \input tex4ht.sty \Preamble{html,fonts}
        \begin{document}
     \EndPreamble

\begin{center}
.. ... .. .... ...... ......(BR)\\
... ... ........... ......(BR)\\
....... ......

(P)..... .........
\end{center}

\end{document}

\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Flushed Blocks}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Verbatim
      \def\flushleft{\trivlist \raggedright\item\relax}
      \def\endflushleft{\endtrivlist}
      \def\flushright{\trivlist \raggedleft\item\relax}
      \def\endflushright{\endtrivlist}
\EndVerbatim

\<html latex env\><<<
\ifx \flushleft\:UnDef \else 
   \append:def\flushleft{\linepenalty|=10 }
\fi
>>>

\<html latex env\><<<
\append:def\flushright{\linepenalty|=10 \ifx \EndPicture\:UnDef 
     \parfillskip|=\@flushglue 
     \leftskip|=\z@skip \rightskip|=\@flushglue
   \fi}
>>>

The following have a problem of lack of space below and above them,
because  we don't want space on the margins. Above we tried to force
the extra space.

\Verbatim

\documentstyle{article}

 \input tex4ht.sty \Preamble{html,fonts}
        \begin{document}
     \EndPreamble

....................
\begin{flushleft}
(P)(TABLE...).. ... .. .... ...... ......(BR)\\
... ... ........... ......(BR)\\
....... ......

(P)..... .........(/TABLE)
\end{flushleft}
(P).............

(P)................

\end{document}

\EndVerbatim

Users might not be consistent to whether spaces are introduced
at start and end of lines.

\Section{Centering and Fussy}

\SubSection{Centering}

\<html latex env\><<<
\append:def\centering{%
   \linepenalty|=10 \ifx \EndPicture\:UnDef 
     \parfillskip|=\@flushglue 
     \leftskip|=\z@skip \rightskip|=\@flushglue
   \fi}
>>>

\Section{Abstract}

Standard LaTeX classes use centering environment to place abstract title. 
We want to place some configurable tags instead of that centering. For example
header element. To do that, we can use the new LaTeX environment hook mechanism
to redefine configuration of centering at the beginning of abstract.

\<config report / article shared\><<<
\NewConfigure{abstracttitle}{2}
\AtBeginEnvironment[tex4ht]{abstract}{\ConfigureEnv{center}{\a:abstracttitle}{\b:abstracttitle}{\@empty}{\@empty}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Boxes}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltboxes.dtx]{}{}ltboxes.dtx\EndLink

Boxes are occasionally before placing them within pictures. In such cases,
configurations of the form 
`\Verb!\Configure{lrbox}{\noexpand\PictureOff}!'
might be useful.  We don't want such configurations for a default,
because of possible nested pictures such as in 
  `\Verb!\newsavebox{\bx} 
  \begin{lrbox}{\bx}% 
        \( x = \frac{1}{2} \)       
  \end{lrbox}!'

\<latex ltboxes\><<<
\def\lrbox#1{%
  \edef\reserved@a{%
    \endgroup
    \setbox#1\hbox{%
      \a:lrbox
      \begingroup   \aftergroup}% 
        \def\noexpand\@currenvir{\@currenvir}%
        \def\noexpand\@currenvline{\on@line}}%
  \reserved@a
    \@endpefalse  
    \color@setgroup
      \ignorespaces}
\NewConfigure{lrbox}{1}
>>>

We place the third parameter of \''\makebox' in a 
group for avoiding problematic font of the form
\`'</CODE><CODE 
>uparrow' from
\`'\makebox[90pt][l]{\tt uparrow}' instead of
\`'<CODE 
>uparrow</CODE>'.

\<latex ltboxes\><<<
\long\def\:tempc[#1][#2]#3{\o:@imakebox:[#1][#2]{{#3}}}
\HLet\@imakebox|=\:tempc
>>>

Similarly for the following.

\<latex ltboxes\><<<
\DeclareRobustCommand\:sbox[2]{\o:sbox:{#1}{{#2}}}
\HLet\sbox\:sbox
>>>
 

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Mini pageas}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<latex ltboxes\><<<
\HAssign\:mpNum=0
\HAssign\minipageNum=0
\def \@setminipage{%
  \@minipagetrue
  \ht:everypar{\@minipagefalse\HtmlPar\ht:everypar{\HtmlPar}}%
  |<adjust minipageNum for setcounter footnote 0|>%
}
>>>

\<adjust minipageNum for setcounter footnote 0\><<<
\gHAdvance\:mpNum by 1
\HAssign\minipageNum=\:mpNum \relax
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
\SubSection{/mbox}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%5

\<latex math\><<<
\long\def\:temp#1{\leavevmode\hbox{\a:mbox {#1}\b:mbox}} 
\HLet\mbox|=\:temp
\NewConfigure{mbox}{2}  
>>>

\SubSection{/framebox and /fbox}

\<latex ltboxes\><<<
\long\def\:temp#1{\a:fbox\gobble:fbox\o:fbox:{\hbox{{#1}}}\b:fbox}
\HLet\fbox|=\:temp
\let\gobble:fbox=\empty
\def\:tempc#1{}
\HLet\gobble:fbox|=\:tempc
>>>

\<config latex.ltx utilities\><<<
\NewConfigure{fbox}{2}  
>>>

\<latex ltboxes\><<<
\long\def\:temp[#1][#2]#3{%
   \em:dim\frameboxWidth{#1}\def\frameboxAlign{#2}%
   \a:framebox \gobble:frame\o:@iframebox:[#1][#2]{#3}\b:framebox}
\HLet\@iframebox|=\:temp
\NewConfigure{framebox}{2}
\let\gobble:frame=\empty
\def\:tempc#1[#2][#3]{\hbox}
\HLet\gobble:frame|=\:tempc
>>>

We need the \`'[]' above, because the picture contains an mbox that
may include pictorial symbols that will cause nested images in ALT of
xref.

\<latex ltboxes\><<<
\def\em:dim#1#2{%
  \tmp:dim=#2\tmp:cnt=0 \em:int \edef#1{\the\tmp:cnt}%
  \tmp:dim=10\tmp:dim \tmp:cnt=0 \em:int \edef#1{#1.\the\tmp:cnt}%
  \tmp:dim=10\tmp:dim \tmp:cnt=0 \em:int \edef#1{#1\the\tmp:cnt}%
  \edef#1{#1em}%
}
\def\em:int{\relax
  \ifdim \tmp:dim>1em
     \advance\tmp:cnt by 1  \advance\tmp:dim by -1em
     \expandafter\em:int
  \fi
}
>>>

\Section{Centerline, Leftline, Rightline}

\<latex ltboxes\><<<
\NewConfigure{centerline}[2]{\c:def\cnt:a{#1}\c:def\cnt:b{#2}}
\NewConfigure{leftline}[2]{\c:def\lft:a{#1}\c:def\lft:b{#2}}
\NewConfigure{rightline}[2]{\c:def\a:rightline{#1}\c:def\b:rightline{#2}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Tabbing}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/lttab.dtx]{}{}lttab.dtx\EndLink

%%%%%%%%%%%%%%%%%%%%%%%
\Section{Tabbing}
%%%%%%%%%%%%%%%%%%%%%%%

 The original  has been defined as global, probbaly 
because it was in a group hiding \`'\+'. I couldn't locate that 
group. I protectd the problematic parts here from the if-else of the
first pass with \''\expandafter'.

\<latex lttab\><<<
|<TABLE tabbing|>   
|<TABLE tabbing Config util|>   
|<all html latex tabs|>  
\pend:defI\extracolsep{\a:extracolsep{##1}} 
\NewConfigure{extracolsep}[1]{\def\a:extracolsep##1{#1}}
\Configure{extracolsep}{}
>>>

The pic-tabbing' option asks for pictures just for tabbing environments 
that have the {\tt \char92'} tabbing command.

The above order of insertions is important for \''\tab:N'
nd \`'\LikeRef' to be recognized. 

\<all html latex tabs\><<<
\HAssign\tab:N|=0
\pend:def\tabbing{\let\dot:tab|=\empty \gHAdvance\tab:N |by 1}
\append:def\endtabbing{\Tag{|<tabbing tag|>.}{\dot:tab}}
\pend:def\@tablab{\xdef\dot:tab{.}}
>>>

Tabbing enironments can't be nested (latex 181).

Can we get rid of the following pictoral part by using ConfigureEnv?

\<TABLE tabbing\><<<
\let\:tempc|=\tabbing
\pend:def\:tempc{\Configure{HtmlPar}{}{}{}{}%
   \edef\ln:tab{\LikeRef{|<tabbing tag|>} 0 }%
   \let\TABBING|=\ln:tab  \gdef\locs:tab{}}
\HLet\tabbing|=\:tempc
\let\:tempc|=\endtabbing
\append:def\:tempc{%
   \Tag{|<tabbing tag|>}{\locs:tab}%
   \def\:temp{.}\ifx \:temp\dot:tab
      \:warning{\noexpand\' ignored in tabbing}     
   \fi}
\HLet\endtabbing|=\:tempc
>>>

The lengths of the fields are recorded in \''\locs:tab',
send into xref with tag \`'\tab:N', and loaded into
\''\ln:tag' for use.

\<tabbing tag\><<<
|<auto tag|>tb\tab:N >>>

\SubSection{Fields}

\<TABLE tabbing\><<<
\def\:addfield{\global\setbox\@curline\hbox{\unhbox
   \@curline\unhbox\@curfield}}
\def\:temp{%
   \global\setbox\@curline\hbox{\unhbox
      \@curline   \x:tab\D:tab
      \unhbox\@curfield  \y:tab\d:tab
      |<record len of prev field|>%
      \global\let\y:tab|=\empty
}}
\HLet\@addfield|=\:temp
>>>

\<paused addfield\><<<
\:addfield
>>>

\<record len of prev field\><<<
\ifx \y:tab\empty
   \tmp:dim|=\dimen\@curtab
   \advance\tmp:dim |by -\loc:tab
\else
   \tmp:dim|=\last:len\relax
\fi
\ifdim \tmp:dim >\z@
   \tmp:dim|=\m:tab\tmp:dim
   \xdef\locs:tab{\locs:tab\space \pt:int\tmp:dim}%
\fi
\xdef\loc:tab{\the\dimen\@curtab}%
>>>

\SubSection{Start of Line}

\<TABLE tabbing\><<<
\def\:temp{%
   \TRD:tab  \gdef\loc:tab{\z@}%
   \ifnum \@nxttabmar >\@hightab
     \@badtab  \global\@nxttabmar \@hightab
   \fi
   \global\@curtabmar \@nxttabmar
   \global\@curtab \@curtabmar
   \global\setbox\@curline \hbox {}%
   \@startfield  |<indented tabs|>%
   \strut}
\HLet\@startline|=\:temp
>>>

The \''\x:tab' is needed for an extra field at the start
when tabs start in middle of line (due to \''\+').

\<indented tabs\><<<
\ifdim \the\dimen\@curtab > \z@
       \gdef\x:tab{\D:tab  \d:tab\gdef\x:tab{}}%
\else  \gdef\x:tab{}%
\fi
>>>

The \'+\'+ command is ignored here, and the content is pushed to the
next field.

\<TABLE tabbing\><<<
\def\:temp{%
  \@stopfield
  \global\setbox\@curline\hbox{%
    \box\@curline  
    \hskip-\wd\@curfield \hskip-\tabbingsep
    |<move tab backward|>%
    \box\@curfield
    \hskip\tabbingsep}%
  \@startfield
  \ignorespaces}
\HLet\@tablab|=\:temp
>>>

\<move tab backward\><<<
\x:tab \D:tab 
>>>

\<TABLE tabbing\><<<
\def\:temp{%
  \@stopfield |<paused addfield|>%
  \global\advance\@tabpush \@ne 
  \begingroup  \@contfield}
\HLet\pushtabs|=\:temp
\def\:temp{\@stopfield |<paused addfield|>%
  \ifnum \@tabpush >\z@
    \endgroup  \global\advance\@tabpush \m@ne
    \ifnum \@curtab >\@hightab
      \global \@curtab \@hightab
      \@badtab \fi
  \else \@badpoptabs \fi
  \@contfield}
\HLet\poptabs|=\:temp
>>>

\SubSection{End of Line}

Last field width is important if its field is shifted right (with \''\`'
that translates to \''\@tabrj'). Otherwise, a 0 dimension is provided
for a place holder.

\<TABLE tabbing\><<<
\let\:tempc|=\@stopline
\pend:def\:tempc{%
   \unskip \@stopfield
   |<compute width of last field|>%
   \:gobbleII}
\append:def\:tempc{\rt:tab 
   |<width for last field|>\pic:gobble\hfill}
\HLet\@stopline|=\:tempc
>>>

\<TABLE tabbing\><<<
\let\:tempc|=\kill
\pend:def\:tempc{%
  \bgroup\@stopfield%
  |<width for last field of kill|>%
  \:gobble}
\HLet\kill|=\:tempc
>>>

\<compute width of last field\><<<
\tmp:dim\linewidth
\advance\tmp:dim by -\wd\@curline 
\edef\last:len{\if@rjfield \the\tmp:dim \else \z@\fi}%
>>>

\<width for last field\><<<
\tmp:dim \last:len
\tmp:dim\m:tab\tmp:dim
\xdef\locs:tab{\locs:tab\space \pt:int\tmp:dim }%
>>>

\<width for last field of kill\><<<
\tmp:dim |= \if@rjfield \the\wd\@curfield\else \z@\fi
\tmp:dim\m:tab\tmp:dim
\xdef\locs:tab{\locs:tab\space 0 }%
>>>

\<TABLE tabbing\><<<
\def\pt:int#1{\expandafter\pt:nt\the#1//}
\def\pt:nt#1.#2//{#1}
>>>

\SubSection{Flush Right with {\tt\char92}`}

\<TABLE tabbing\><<<
\let\y:tab=\empty
\let\:tempc|=\@tabrj
\pend:def\:tempc{%
  \@stopfield \edef\last:len{\the\wd\@curfield}%
  \gdef\y:tab{\d:tabalgn \let\TabType=\`\relax \c:tabalgn}%  
  \:gobble
}
\HLet\@tabrj=\:tempc 
>>>

\SubSection{The Html Commands}

\<TABLE tabbing\><<<
\def\TRD:tab{\gdef\D:tab{\a:tabalgn \c:tabalgn \gdef\D:tab{}}}
\def\d:tab{\gdef\D:tab{%
   \d:tabalgn \c:tabalgn \gdef\D:tab{}}}
\def\rt:tab{\d:tabalgn\b:tabalgn}
>>>

\<TABLE tabbing\><<<
\def\gt:tab{%
   \afterassignment\gt:tb \tmp:cnt=\ln:tab \space 0//}
\def\gt:tb#1//{\xdef\ln:tab{#1}%
   \edef\TabWidth{\ifnum \tmp:cnt> 0 \the\tmp:cnt\fi }}
>>>

\<plain,latex utilities\><<<
\def\:tblgn{\ifx [\:temp \expandafter\:tbln
   \else  \expandafter\c:tblgn \fi}
\def\:tbln[#1]#2#3#4#5{%
   \def\m:tab{#2#3#4#5}\ifx \m:tab\empty \else
      \Configure{\:tempa}{#2}{#3}{#4}{#5}{}\fi
   \def\m:tab{#1}}
\long\def\c:tblgn#1#2#3#4{%
   \c:def\a:tabalgn{\ifx \EndPicture\:UnDef 
                            \let\TabType|=\relax #1\fi}%
   \d:def\b:tabalgn{\ifx \EndPicture\:UnDef #2\fi}%
   \d:def\c:tabalgn{\ifx \EndPicture\:UnDef \gt:tab #3\fi}%
   \d:def\d:tabalgn{\ifx \EndPicture\:UnDef #4\fi}\E:tabalign}
\c:def\a:tabalgn{}
\d:def\b:tabalgn{}
\d:def\c:tabalgn{}
\d:def\d:tabalgn{}
>>>

HANDLE the above Configure.

\<TABLE tabbing Config util\><<<
\let\E:tabalign|=\empty
\def\c:tabbing:{\def\:tempa{tabbing}\futurelet\:temp\:tblgn}
>>>   

The \''\hfil\break' to force line breaks in TeX. Lines taht
are too long might push pictures outside the boundaries where
dvips/convert may be set to process them.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Tabular and Array Environments}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Array, Tabular}
%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Core}
%%%%%%%%%%%%%%%%%%%%%%%%

The \`'\array' and \`'\tabular' environments are both defined in
terms of \''\@array',

\<latex lttab\><<<
\:CheckOption{no-array}\if:Option \else
   |<shared html latex array/tabular|>
   \:ifpackageloaded{array}{\:Optiontrue}{}
\fi
\if:Option \else
   |<array/tabular of latex|>
\fi
>>>

\<colortbl.sty shared configNO\><<<
\:CheckOption{no-array}\if:Option \else
   \def\HColWidth{\csname @testpach \HCol\endcsname}

       

>>>

Unless a substitution for html array/tabular is provided,
`no-array' also requires `no-halign'.

\<array/tabular of latex\><<<
|<html private array/tabular|>
|<pic array|>
|<pic tabular|>
>>>

\<config latex.ltx utilities\><<<
\:CheckOption{no-array}\if:Option \else
   |<html latex array/tabular Config util|>
\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Non-Pictorial Core}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<html private array/tabular\><<<
\def\:temp[#1]#2{%
  |<init conds for @mkpream|>%
  \setbox\@arstrutbox\hbox{}%
  \@mkpream{#2}%
  \edef\@preamble{%
        |<ialign for html @array|>}%     
  \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox
  \let\tabularnewline\\%
  \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi
  \bgroup \def\v:TBL{#1}%
    \let\par\@empty \let\protect\relax
    \lineskip\z@skip\baselineskip\z@skip
    \ifx \EndPicture\:UnDef
       \SaveMkHalignConfig |<@array configuration for MkHalign|>%
    \else \let\@sharp|=##\fi  |%  \HRestore\noalign|%
    \@preamble}
\HLet\@array|=\:temp
|<set cr for @array|>
|<latex: show paragraphs in array par box|>
>>>

The next example fails under dblatex without the definition of \Verb=\cr=
that follows.

\Verbatim
\documentclass{article}                                                   
\begin{document}  
   \begin{tabular}{l} \relax 
     $\begin{array}{c}4\end{array}$ 
   \end{tabular}  
\end{document} 
\EndVerbatim

\<set cr for @array\><<<
\let\oo:@array\@array
\def\@array{%
   \ifx\EndPicture\:UnDef\else
      \iffalse{\fi
      \expandafter\let\expandafter\cr\csname 0cr\endcsname 
      \expandafter\let\expandafter\crcr\csname 0crcr\endcsname 
      \iffalse}\fi
   \fi
   \oo:@array
}
>>>

% \@arrayparboxrestore

\<latex: show paragraphs in array par box\><<<
\let\:tempc|=\@@startpbox
\append:defI\:tempc{\everypar{\HtmlPar}\a:arrayparbox}%
\HLet\@@startpbox|=\:tempc
>>>

\<latex lttab\><<<
\NewConfigure{arrayparbox}{1}
>>>

\<html private array/tabular\><<<
\def\:tempc{\relax 
   \ifx \HCol\:UnDef \else \ifnum\HCol=1 \a:endarray\fi \fi
   \crcr\ifx \EndPicture\:UnDef \EndMkHalign
   \else \egroup\fi \egroup}
\HLet\endarray\:tempc
\def\:tempc{\relax
   \ifx \HCol\:UnDef \else \ifnum\HCol=1 \a:endarray\fi \fi
   \crcr\ifx \EndPicture\:UnDef
   \EndMkHalign\else \egroup\fi \egroup $\egroup}
\HLet\endtabular\:tempc
\expandafter \let \csname endtabular*\endcsname|=\endtabular
\expandafter\def\csname tabular*\endcsname#1{\tabular}
\expandafter\def\csname before:begintabular*\endcsname{\csname
   before:begintabular\endcsname} 
\expandafter\def\csname ontabular*:list\endcsname{\csname
   ontabular:list\endcsname}
>>>

\<latex lttab\><<<
\NewConfigure{endtabular}{1}
\NewConfigure{endarray}{1}
>>>

\SubSection{Pic Array/Tabular}

The checking of options needs to be at the end.

%%%%%%%%%%%%%%%%%%%%
\SubSection{ialign}
%%%%%%%%%%%%%%%%%%%%

\<ialign for html @array\><<<
\everycr{}\tabskip\z@skip\noexpand\MkHalign\noexpand\@sharp
   {\@arstrut \@preamble \tabskip\z@skip}%
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Testpach}
%%%%%%%%%%%%%%%%%%%%%%%

\<html private array/tabular\><<<
\def\:temp#1{\@chclass \ifnum \@lastchclass=\tw@ 4 \else
    \ifnum \@lastchclass=3 5 
       |<tabular col width|>%
    \else
     \z@ \if #1c\@chnum \z@ \add:ar-\else
                              \if #1l\@chnum \@ne \add:ar<\else
                              \if #1r\@chnum \tw@ \add:ar>\else
          \@chclass \if #1||\@ne \b:VBorder\else
                    \if #1@\tw@ \d:VBorder\else
                    \if #1p3 \add:ar p\else \z@ \@preamerr 0\fi
  \fi  \fi  \fi  \fi  \fi  \fi
\fi}
\HLet\@testpach|=\:temp
|<alignment utilities for VBorder|>%
>>>

\<\><<<
\def\add:ar#1{%
   \Advance:\ar:cnt by 1 
   |<record alignment type|>\c:VBorder
   \edef\HAlign{\HAlign 0 \ar:cnt\space #1 }}
|<access col alignment|>
>>>

\<tabular col width\><<<
\expandafter\let \csname @testpach \ar:cnt\endcsname\@nextchar
>>>

% \<html private array/tabular\><<<

\<shared html latex array/tabular\><<<
\def\HColWidth{\csname @testpach \HCol\endcsname}
>>>

\<globalize HAlign and ar:cnt\><<<
\tmp:cnt=0
\global\let\:tempa\empty
\loop\ifnum \ar:cnt>\tmp:cnt 
   \advance\tmp:cnt by 1
   \expandafter\ifx \csname @testpach \the\tmp:cnt\endcsname\relax 
   \else      
      \xdef\:tempa{%
          \:tempa
          \def \expandafter\noexpand
             \csname @testpach \the\tmp:cnt\endcsname{\csname @testpach
             \the\tmp:cnt\endcsname}}%
      \expandafter\let\csname @testpach \the\tmp:cnt\endcsname\relax
   \fi
\repeat
\aftergroup\:tempa
>>>

\<record alignment type\><<<
\def\ch:class{#1}%
>>>

\<access col alignment\><<<
\def\HColAlign{\expandafter \ifx\csname
   \expandafter\string\ch:class :T:D\endcsname\relax \else \csname
   \expandafter\string\ch:class :T:D\endcsname\fi}
>>>

%\<latex utilities\><<<
%\let\HAlign|=\empty
%>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Multicolumn}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<html private array/tabular\><<<
\long\def\:temp#1#2#3{\multispan{#1}\a:multicolumn \begingroup  
  |<add Row.Col<-> to new:span|>%
  \def\@sharp{\c:multicolumn#3\d:multicolumn}\set@typeset@protect
  \let\@startpbox\@@startpbox\let\@endpbox\@@endpbox
  \@arstrut \@preamble\hbox{}\endgroup \b:multicolumn \ignorespaces}
\HLet\multicolumn|=\:temp
\NewConfigure{multicolumn}{4} 
>>>

\<add Row.Col<-> to new:span\><<<
|<init conds for @mkpream|>%      
\@mkpream{#2}%
\ifx \EndPicture\:UnDef
   \def\:temp##1 ##2 ##3 {##3}%
   \xdef\new:span{\new:span\HRow.\HCol\expandafter\:temp\HAlign;}%
\fi
>>>

We could have inserted automatic \''<PRE>...</PRE>' around tabular,
but this  may unintentionally cause nested PRE environments. The user
may also do it with comamnds of the form:
\`'\def\endPRE{\HCode{</PRE>}}
\let\oldtabular=\tabular
\def\tabular{\HCode{<PRE>}\aftergroup \endPRE\oldtabular}'.

 It is in particular 
problematic for leading lines of some, but not all, kinds.

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Configuration}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<@array configuration for MkHalign\><<<
\ifx \recall:ar\:UnDef
   \pend:def\@array{\recall:ar}%
   \edef\recall:ar{%
      \noexpand\ifx \noexpand\EndPicture\noexpand\:UnDef \noexpand\else
         \arrayrulewidth|=\the\arrayrulewidth
         \doublerulesep|=\the\doublerulesep
         \arraycolsep|=\the\arraycolsep
         \tabcolsep|=\the\tabcolsep
      \noexpand\fi }%
\fi
% why did we set these variables to zero? it leads to wrong spacing 
% in pictures. 
% https://puszcza.gnu.org.ua/bugs/?229
% \arrayrulewidth|=\z@  \doublerulesep|=\z@
% \arraycolsep|=\z@     \tabcolsep|=\z@
\Configure{MkHalign}
   {\@array:a}%
   {\@array:b\ProperTrTrue}%
   {\a:putHBorder\InitHBorder 
    |<cond eliminate pre cline tr|>%
    \ifProperTr{\@array:c}}%
   {\ifProperTr{\@array:d}%
    |<end cond eliminate pre cline tr|>%
    \a:putHBorder\InitHBorder}%
   {\ifProperTr{\@array:e}\RecallMkHalignConfig\recall:ar}%
   {\ifProperTr{\@array:f}}
>>>

\<latex lttab\><<<
\def\ignoreEndTr{\expandafter
   \ifx \csname :AfterHline\endcsname\relax\else 
      \expandafter\ignore:EndTr
   \fi}
\def\ignore:EndTr{%
   \o:noalign:{\global\futurelet\:AfterHline}%
}
\long\def\ifProperTr#1{%
   \ifx \:AfterHline\end
       #1\global\let\:AfterHline\endinput  |%#1 is \@array:f|%
       \global\let\Needs:@array:d\@array:d
   \else \ifx \:AfterHline\endinput
       \ifx \Needs:@array:d\@array:d
          #1\global\let\Needs:@array:d\:UnDef
       \fi
       \global\let\:AfterHline\relax
   \else  #1%
   \fi\fi}
\def\ProperTrTrue{\global\let\:AfterHline=\relax}
\NewConfigure{putHBorder}{1}
>>>

\<shared html latex array/tabular\><<<
\def\:temp{|<set hooks of array|>\o:array:}
\HLet\array|=\:temp
\ifx \:@tabular:\:UnDef \let\:@tabular:|=\empty \fi
>>>

\<set hooks of array\><<<
\let\@array:a|=\a:array \let\@array:b|=\b:array
\let\@array:c|=\c:array \let\@array:d|=\d:array
\let\@array:e|=\e:array \let\@array:f|=\f:array 
>>>

\<latex lttab\><<<
\def\:tempc{|<set hooks of tabular|>\o:tabular:}
\HLet\tabular|=\:tempc
>>>

\<array/tabular of latex\><<<
\def\:tempc{%
   \leavevmode \hbox \bgroup \:@tabular:
   $\let\@acol\@tabacol  \let\@classz\@tabclassz
   \let\@classiv\@tabclassiv \let\\\@tabularcr
   \@tabarray}
\HLet\@tabular|=\:tempc
>>>

\<set hooks of tabular\><<<
\let\@array:a|=\a:tabular \let\@array:b|=\b:tabular
\let\@array:c|=\c:tabular \let\@array:d|=\d:tabular
\let\@array:e|=\e:tabular \let\@array:f|=\f:tabular
>>>

The \`'\@tabular' above to capture both \`'\begin{tabular}'
and  \`'\begin{tabular*}'.

\<html latex array/tabular Config util\><<<
\NewConfigure{array}{6}
\NewConfigure{tabular}{6}
\NewConfigure{VBorder}{4}
\NewConfigure{HBorder}[9]{\c:def\a:HBorder{#1}%
   \c:def\b:HBorder{#2}\c:def\c:HBorder{#3}\c:def\d:HBorder{#4}%
   \c:def\e:HBorder{#5}\c:def\f:HBorder{#6}\c:def\g:HBorder{#7}%
   \c:def\h:HBorder{#8}\c:def\i:HBorder{#9}\c:HBRD}
\def\c:HBRD#1{\c:def\j:HBorder{#1}}
|<configuring @()|>
>>>

\`'\@nextchar' holds the contents of \`'@{...}'

\<configuring @()\><<<
\def\:temp{\@addtopreamble{\@nextchar
   \csname a:@{}\endcsname}}         \HLet\@tabclassiv|=\:temp
\def\:temp{\@addtopreamble{$\@nextchar
   $\csname a:@{}\endcsname}}        \HLet\@arrayclassiv|=\:temp
\NewConfigure{@{}}{1}
\Configure{@{}}{}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Border Lines and Alignments}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The alignments, and whether borders are to be employed,
are decided from the \`'(|c|@{...}l|r|...)' like parameter.
A border is set if the parameter request a drawing of a line.

\<init conds for @mkpream\><<<
\def\Clr{#2}\a:VBorder
\HAssign\ar:cnt|=0
\let\HAlign|=\empty
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{supertabular.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<supertabular.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% supertabular.4ht                      |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>
   |<supertabular code|>
\Hinput{supertabular}
\endinput
>>>        \AddFile{7}{supertabular}

\<supertabular code\><<<
\long\def\tablelasttail#1{%
   \def\:temp{#1}\ifx \:temp\empty
      \gdef \@table@last@tail {}%
   \else 
      \gdef \@table@last@tail {\cr #1}%
   \fi
}
\ifx \@table@last@tail\:UnDef \else
  \gdef\:temp{}
  \ifx \@table@last@tail\:temp\else
    \pend:def\@table@last@tail{\cr}%
\fi \fi
\def\ST@xargarraycr#1{%
  \@tempdima #1\relax  \cr
  \ifdim #1>5pt
    \ifx \ar:cnt \:UnDef \else 
      \o:noalign: {%
        \gdef\SpBorder{#1}%
        \append:def \hline:s {\a:SpBorder }%
        \def\:tempb{\ifnum \tmp:cnt <\ar:cnt 
           \advance \tmp:cnt by 1 
           \append:def\hline:s{\b:SpBorder }\expandafter\:tempb \fi }%
        \tmp:cnt=0 \:tempb
        \append:def\hline:s{\c:SpBorder }%
        \global\let\hline:s=\hline:s }%
  \fi \fi
}
\NewConfigure{SpBorder}{3}
\def\ST@cr{}
\long\def\tabletail#1{\gdef\@tabletail{}}
\tabletail{}
\let\o:ST@caption:=\ST@caption
\def\ST@caption{\gHAdvance\TitleCount by 1 \o:ST@caption:}
>>>

%%%%%%%%%%%%%%%%%%%
\Section{array.sty}
%%%%%%%%%%%%%%%%%%%

Good sample: tabsatz.tex

\<array.4ht\><<<
% array.4ht (|version), generated from |jobname.tex
% Copyright (C) |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
  |<array hooks|>
\Hinput{array}
\endinput
>>>        \AddFile{7}{array}

\Link[file://localhost/n/candy/0/tex/teTeX/texmf/tex/latex/tools/array.sty]{}{}%
array.sty\EndLink

\<array hooks\><<<
|<html private array/tabular array.sty|>
>>>

In array.sty we have

\Verbatim
ol=\relax        \let\@expast=\relax
\let\@arrayclassiv=\relax   \let\@arrayclassz=\relax
\let\@tabclassiv=\relax     \let\@tabclassz=\relax
\let\@arrayacol=\relax      \let\@tabacol=\relax
\let\@tabularcr=\relax      \let\@@endpbox=\relax
\let\@argtabularcr=\relax   \let\@xtabularcr=\relax
\EndVerbatim

so we need diffenent definition than in latex

\<html private array/tabular array.sty\><<<
\def\@tabular{\leavevmode
  \hbox \bgroup \:@tabular:
      $\col@sep\tabcolsep \let\d@llarbegin\begingroup
                                    \let\d@llarend\endgroup
  \@tabarray}
\pend:def\@tabular{|<set hooks of tabular|>}
>>>

The \`'\array' and \`'\tabular' environments are both defined in
terms of \''\@array',

Two definitions of \''\@mkpream' appear in array.sty, with the following
being the second one. What use the first def has?

The checking of options needs to be at the end.

\<html private array/tabular array.sty\><<<
\def\:temp[#1]#2{%
  |<init conds for @mkpream|>%
  \@tempdima \ht \strutbox
  \advance \@tempdima by\extrarowheight
  \setbox \@arstrutbox \hbox{}%
  \begingroup
    \@mkpream{#2}%
    \xdef\@preamble{%
        |<ialign for html @array|>}%     
    |<globalize ar:cnt for array.sty|>%
  \endgroup
  \@arrayleft
  \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi
  \bgroup
    \def\v:TBL{#1}%
    \let \protect \relax  \lineskip \z@  
    \baselineskip \z@ \m@th
    \let\\\@arraycr \let\tabularnewline\\\let\par\@empty
    \ifx \EndPicture\:UnDef
       \SaveMkHalignConfig %%%%%%%%% \let\sv:ALIGN|=\HAlign
       |<@array configuration for MkHalign|>%
       |<modefied @array config|>%
    \else \let\@sharp|=##\fi  |%\HRestore\noalign|%
    \@preamble}
\HLet\@array|=\:temp
\HLet\@@array|=\@array 
|<array.hooks: show paragraphs in array par box|>
>>>

\<array.hooks: show paragraphs in array par box\><<<
\let\:tempc|=\@startpbox
\append:defI\:tempc{\expandafter\everypar
   \expandafter{\the\everypar\everypar{\HtmlPar}\HtmlPar}}
\HLet\@startpbox|=\:tempc
>>>

\<modefied @array config\><<<
\Configure{MkHalign}%
   {\@array:a}%
   {\@array:b\ProperTrTrue}%
   {\a:putHBorder\InitHBorder \ifProperTr{\@array:c}}%
   {\ifProperTr{\@array:d}\a:putHBorder\InitHBorder}%
   {\ifProperTr{\@array:e}%%%%%%%%%%\global \let\HAlign|=\sv:ALIGN
          \RecallMkHalignConfig\recall:ar}%
   {\ifProperTr{\@array:f}}
>>>

\''\endarray' has two defs in array.sty. Where the first one is
in use (it is ignored here).

\<html private array/tabular array.sty\><<<
\def\:tempc{\relax \ifnum\HCol=1 \a:endarray\fi
   \enda:rray}
\HLet\endarray\:tempc
\def\:tempc{\relax \ifnum\HCol=1 \a:endtabular\fi
   \enda:rray $\egroup}
\HLet\endtabular\:tempc
\def\enda:rray{\crcr\ifx \EndPicture\:UnDef \EndMkHalign
   \else \egroup\fi  \egroup \@arrayright \gdef\@preamble{}}
\expandafter \let \csname endtabular*\endcsname|=\endtabular
>>>

We can't put \''\endarray' in \''\endtabular' directly, because
both change dynamically.

\<html private array/tabular array.sty\><<<
\def\:tempc{\@classx 
   \@tempcnta \count@ 
   \prepnext@tok 
   \@addtopreamble{\ifcase \@chnum 
      \hfil 
      \d@llarbegin 
      \insert@column 
      \d@llarend \hfil \or 
      \hskip1sp\d@llarbegin \insert@column \d@llarend \hfil \or 
      \hfil\hskip1sp\d@llarbegin \insert@column \d@llarend \or 
   |%$\vcenter 
   \@startpbox{\@nextchar}\insert@column \@endpbox $\or |% %
   \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or 
   \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or 
   \vbox \@startpbox{\@nextchar}\insert@column \@endpbox 
  \fi}\prepnext@tok} 
\HLet\@classz\:tempc
>>>

THe math environment above serves just for centering a column.
It is problematic for pictorial inline math, when introduced
before \Verb+\end{tabular}+.  See the following example under dblatex.

\Verbatim
\documentclass{article} 
  \usepackage{array} 
\begin{document} 
\begin{tabular}{m{6.5cm}c} 
a&b\\
c&d\\ 
\end{tabular} 
\end{document} 
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%
\SubSection{Options}
%%%%%%%%%%%%%%%%%%%%

The alignments, and whether borders are to be employed,
are decided from the \`'(|c|@{...}l|r|...)' like parameter.
A border is set if the parameter request a drawing of a line.

\<html private array/tabular array.sty\><<<
\def\:tempc{\@chclass
 \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
  \ifnum \@lastchclass=7 5 \else
   \ifnum \@lastchclass=8 \tw@ \else
    \ifnum \@lastchclass=9 \thr@@
   \else \z@
   \ifnum \@lastchclass = 10 
      \global |<tabular col width|>%
   \else
   \edef\@nextchar{\expandafter\string\@nextchar}%
   \@chnum
   \if \@nextchar c\z@ \add:ar-\else
    \if \@nextchar l\@ne \add:ar<\else
     \if \@nextchar r\tw@ \add:ar>\else
   \z@ \@chclass
   \if\@nextchar ||\@ne \b:VBorder\else
    \if \@nextchar !6 \else
     \if \@nextchar @7 \d:VBorder\else
      \if \@nextchar <8 \else
       \if \@nextchar >9 \else
  10
  \@chnum
  \if \@nextchar m\thr@@ \add:ar m\else
   \if \@nextchar p4 \add:ar p\else
    \if \@nextchar b5 \add:ar b\else
   \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
   \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
\HLet\@testpach|=\:tempc
>>>

Note that in latex \''\VBorder' and the internals of \''\add:ar' are defined
as locals and not globals. Make sure that we have no problems with the
new way.  Don't globalize ar:cnt!!!!

\<html private array/tabular array.sty\><<<
|<alignment utilities for VBorder|>%
>>>

\<alignment utilities for VBorder\><<<
\def\add:ar#1{\HAdvance\ar:cnt by 1
   |<record alignment type|>\c:VBorder
   \edef\HAlign{\HAlign 0 \ar:cnt\space #1 }}
|<access col alignment|>
>>>

\<html private array/tabular array.sty\><<<
\long\def\:temp#1#2#3{%
   \multispan{#1}\a:multicolumn \begingroup    
     \def\@addamp{\if@firstamp \@firstampfalse \else
                \@preamerr 5\fi}%
     |<add Row.Col<-> to new:span|>\@addtopreamble\@empty
     \global\let\ch:class|=\ch:class
     |<globalize ar:cnt for array.sty|>%
   \endgroup 
   \def\@sharp{\c:multicolumn#3\d:multicolumn}%
   \@arstrut \@preamble
   \null
   \b:multicolumn
   \ignorespaces}
\HLet\multicolumn|=\:temp
>>>

\<shared html latex array/tabular\><<<
\NewConfigure{multicolumn}{4} 
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Options 8 and 9}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<array hooks\><<<
\def\save@decl{%
  \toks \count@ = \expandafter\expandafter\expandafter {%
     |<open lt/gt array opt|>\expandafter\@nextchar\the\toks
     \expandafter\count@|<close lt/gt array opt|>}}
\NewConfigure{array>}{2}
\NewConfigure{array<}{2}
>>>

\<open lt/gt array opt\><<<
\csname a:array\ifnum\@lastchclass=9 
   >\else <\fi \expandafter\expandafter\expandafter\endcsname
>>>

\<close lt/gt array opt\><<<
\csname b:array\ifnum\@lastchclass=9 
   >\else <\fi\endcsname
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{dcolumn}
%%%%%%%%%%%%%%%%%%%%%%%%%

\<dcolumn.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% dcolumn.4ht                      |version %
% Copyright (C) |CopyYear.2004.      Eitan M. Gurari         %
|<TeX4ht copyright|>
   |<dcolumn hooks|>
\Hinput{dcolumn}
\endinput
>>>        \AddFile{9}{dcolumn}

\<dcolumn hooks\><<<
\pend:defIII\DC@centre{\def\Dpoint{##2}\a:dcolumn}
\append:def\DC@endcentre{\b:dcolumn}
\pend:defIII\DC@right{\def\Dpoint{##2}\a:dcolumn}
\append:def\DC@endright{\b:dcolumn}
\NewConfigure{dcolumn}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{makecell}
%%%%%%%%%%%%%%%%%%%%%%%%

\<makecell.4ht\><<<
% makecell.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|> 

|<makecell makegapedcells|>

\Hinput{makecell} 
\endinput
>>>  \AddFile{9}{makecell}

These commands redefine internall tabular macros, which can lead 
to errors. We need to disable them. User can provide an alternative 
configurations for them, but it is most likely unnecessary.

\<makecell makegapedcells\><<<
\NewConfigure{makegapedcells}{1}
\def\:tempa{\a:makegapedcells}
\HLet\makegapedcells\:tempa

\NewConfigure{nomakegapedcells}{1}
\def\:tempa{\a:nomakegapedcells}
\HLet\nomakegapedcells\:tempa
>>>


%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{longtable.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%

\<longtable.4ht\><<<
% longtable.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
   |<longtable code|>
   |<longtable hline|>
   |<longtable captions|>
\Hinput{longtable}
\endinput
>>>        \AddFile{7}{longtable}

\Link[file://localhost/n/candy/0/tex/teTeX/texmf/tex/latex/tools/longtable.sty]{}{}%
longtable.sty\EndLink{ \tt|}
\Link[http://www.fi.infn.it/pub/tex/doc/html/latex.html]{}{}latex\EndLink

\<longtable code\><<<
\def\:tempc[#1]#2{%
  |<tags for captions, empty|>%
  |<init conds for longtable|>%      
  \refstepcounter{table}\stepcounter{LT@tables}%
  \if l#1%
    \LTleft\z@ \LTright\fill
  \else\if r#1%
    \LTleft\fill \LTright\z@
  \else\if c#1%
    \LTleft\fill \LTright\fill
  \fi\fi\fi
  \let\LT@mcol\multicolumn
  \let\LT@@tabarray\@tabarray
  \let\LT@@hl\hline
  \def\@tabarray{%
    \let\hline\LT@@hl
    \LT@@tabarray}%
  \let\\\LT@tabularcr\let\tabularnewline\\%
  |<longtable page breaks|>%
  \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption
  \@tempdima\ht\strutbox
  \let\@endpbox\LT@endpbox
  \ifx\extrarowheight\@undefined
    \let\@acol\@tabacol
    \let\@classz\@tabclassz \let\@classiv\@tabclassiv
    \def\@startpbox{\vtop\LT@startpbox}%
    \let\@@startpbox\@startpbox
    \let\@@endpbox\@endpbox
    \let\LT@LL@FM@cr\@tabularcr
  \else
    \advance\@tempdima\extrarowheight
    \col@sep\tabcolsep
    \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr
  \fi
  \setbox\@arstrutbox\hbox{}%
  \let\@sharp##\let\protect\relax
   \begingroup
    \@mkpream{#2}%
    \xdef\LT@bchunk{%
       \global\advance\c@LT@chunks\@ne
       \global\LT@rows\z@\setbox\z@\vbox\bgroup
       \LT@setprevdepth
       |<ialign for html longtable|>}%
       |<globalize HAlign and ar:cnt|>%
  \endgroup
  |<set LT@cols|>%
  \LT@make@row
  \m@th\let\par\@empty 
  \everycr{}\lineskip\z@\baselineskip\z@
  \ifx \EndPicture\:UnDef
     \SaveMkHalignConfig |<longtable configuration for MkHalign|>% 
     \let\@sharp|=\relax
  \else \let\@sharp##\fi  
  \LT@bchunk}
\HLet\LT@array\:tempc
>>>

\<longtable page breaks\><<<
\let\newpage\empty
\let\pagebreak\empty
\let\nopagebreak\empty
>>>

\<globalize HAlign and ar:cnt\><<<
\xdef\:temp{%
   \def\noexpand\HAlign{\HAlign}%
   \def\noexpand\ar:cnt{\ar:cnt}}\aftergroup\:temp
>>>

\<globalize ar:cnt for array.sty\><<<
\xdef\:temp{%
   \def\noexpand\HAlign{\HAlign}%
   \def\noexpand\ar:cnt{\ar:cnt}}\aftergroup\:temp
>>>

\<set LT@cols\><<<
\LT@cols|=\ar:cnt
>>>

\<longtable code\><<<
\def\:tempc{%
  \crcr\LT@save@row\cr
  |<end longtable chunk|>%
  \global\setbox\@ne\lastbox    \unskip
  \egroup}
\HLet\LT@echunk\:tempc
>>>

\<end longtable chunk\><<<
\ifx \EndPicture\:UnDef \EndMkHalign\else \egroup\fi
>>>

\<longtable code\><<<
\let\:tempc\LT@startpbox
\append:defI\:tempc{\everypar{\HtmlPar}\a:longtableparbox}%
\HLet\LT@startpbox\:tempc
\NewConfigure{longtableparbox}{1}
>>>

\<longtable code\><<<
\NewConfigure{longtable}{6}
>>>

\<ialign for html longtable\><<<
\everycr{}\tabskip\LTleft\noexpand\MkHalign\noexpand\@sharp
   {\tabskip\z@ \@arstrut \@preamble \tabskip\LTright}%
>>>

\<longtable configuration for MkHalign\><<<
\ifx \recall:ar\:UnDef
   \edef\recall:ar{%
      \noexpand\ifx \noexpand\EndPicture\noexpand\:UnDef \noexpand\else
         \arrayrulewidth\the\arrayrulewidth
         \doublerulesep\the\doublerulesep
         \arraycolsep\the\arraycolsep
         \tabcolsep\the\tabcolsep
      \noexpand\fi }%
\fi
\arrayrulewidth\z@  \doublerulesep\z@
\arraycolsep\z@     \tabcolsep\z@
\Configure{MkHalign}
  \aa:longtable   
  {\bb:longtable \ProperTrTrue}
  {\a:putHBorder\InitHBorder \ifProperTr{\c:longtable}}
  {\ifProperTr{\d:longtable}\a:putHBorder\InitHBorder}%
  {\ifProperTr{\e:longtable}\RecallMkHalignConfig\recall:ar}
  {\ifProperTr{\f:longtable}}
>>>

\<init conds for longtable\><<<
|<init conds for @mkpream|>%      
\def\aa:longtable{%
   \gdef\aa:longtable{\let\HRow|=\lt:sv
       \HAdvance\HRow by 1 \global\let\:MkHalign:|=\lt:MkHalign:}%
   \global\setbox\LT:box|=\vbox{\a:longtable}%
   \global\let\lt:MkHalign:|=\:MkHalign:}%
\def\bb:longtable{%
   \ifHCond \global\let\bb:longtable|=\empty 
      \global\setbox\LT:ebox=\vbox{{\ht:everypar{}\leavevmode}\b:longtable}%
      \global\HCondfalse
   \fi}  
>>>

\<longtable code\><<<
\csname newbox\endcsname\LT:box
\csname newbox\endcsname\LT:ebox
\def\:tempc{%
  \ifvoid\LT@head\else
     \ifvoid\LT@firsthead
        \global\setbox\LT@firsthead=\hbox{\box\LT@head}%
     \else
        \global\setbox\tmp:bx=\hbox{\box\LT@head}%
  \fi\fi%
  \box\LT:box%
  \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi\nobreak
  \output{\LT@output}
}   
\HLet\LT@start\:tempc
\let\:tempc\endlongtable
\append:def\:tempc{\box\LT:ebox}
\pend:def\:tempc{\global\HCondtrue}
\HLet\endlongtable\:tempc
>>>

\<longtable code\><<<
\let\:tempc\LT@ntabularcr
\pend:def\:tempc{\global\let\lt:sv|=\HRow}
\HLet\LT@ntabularcr\:tempc
\let\:tempc\LT@end@hd@ft
\pend:defI\:tempc{\global\let\lt:sv|=\HRow}
\HLet\LT@end@hd@ft\:tempc
%\def\:tempc{\global\let\lt:sv|=\HRow}
%\HLet\LT@kill\:tempc
\def\LT@rebox#1\bgroup{% 
  #1\bgroup 
  \unskip 
}
\let\:tempc\LT@kill
\pend:def\:tempc{\global\let\lt:sv\HRow}
\HLet\LT@kill\:tempc
\let\LT:argtabularcr|=\LT@argtabularcr
\def\:tempc{\global\let\lt:sv|=\HRow  \LT:argtabularcr}
\HLet\LT@argtabularcr\:tempc
\ifx \tmp:bx\:UnDef \csname newbox\endcsname \tmp:bx \fi
%\def\:tempc{\LT@end@hd@ft\tmp:bx}
%\HLet\endhead\:tempc
% \def\:tempc{\LT@end@hd@ft\tmp:bx}
% \HLet\endfoot\:tempc
\pend:def\LT@output{%
  \ifvoid\LT@foot\else
     \ifvoid\LT@lastfoot
        \global\setbox\LT@lastfoot=\hbox{\box\LT@foot}%
     \else 
        \global\setbox\tmp:bx=\hbox{\box\LT@foot}%
  \fi\fi
}
\def\:tempc{\global\HCondtrue \LT@end@hd@ft\LT@lastfoot}
\HLet\endlastfoot\:tempc
>>>

Fix for the \Link[https://puszcza.gnu.org.ua/bugs/?437]{}{}starred linebreak issue\EndLink

\<longtable code\><<<
\def\LT@tabularcr{%
  \relax\iffalse{\fi\ifnum0=`}\fi
  \@ifstar
    {\LT@t@bularcr}%
    {\LT@t@bularcr}}
>>>



This code doesn't work well with Colortbl, so we will ignore it.
\Link[https://puszcza.gnu.org.ua/bugs/?636]{}{}More info here\EndLink.

\<longtable nohline\><<<
\def\:tempc{%
  \o:noalign:{\ifnum0=`}\fi
    \penalty\@M
    \futurelet\@let@token\LT@@hline}
>>>

The original code for longtable hline was complex, but it doesn't work 
with the Colortbl package. I've found that the default hline works just 
fine, so we probably don't need to change it at all.

\<longtable hline\><<<
\def\:tempc{\a:hline}
\HLet\LT@hline\:tempc
>>>

This code is not used as well.

\<longtable nohline\><<<
\def\:tempc{%
  \typeout{}
  \ifx\@let@token\hline
    \global\let\@gtempa\@gobble
    \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}%
  \else
    \global\let\@gtempa\@empty
    \gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}%
  \fi
  \ifnum0=`{\fi}%
  |<put longtable hline|>%
  \o:noalign:{\penalty\@M}%
  \@gtempa}
\HLet\LT@@hline\:tempc
>>>

\<put longtable hline\><<<
\a:hline
>>>

\<longtable captions\><<<
\def\:tempc{%
  \o:noalign:\bgroup  \gHAdvance\TitleCount  1 
    \@ifnextchar[{\egroup\LT@c@ption\@firstofone}\LT@capti@n}
\HLet\LT@caption\:tempc
>>>


\<old longtable makecaption\><<<
% this code is not used anymore, it produces spurious table cells, 
% resulting in wrong structure
\def\:tempc#1#2#3{%
  \LT@mcol\LT@cols c{\hbox{\parbox[t]\LTcapwidth{%
    \cptA: #1{\cap:ref{#2}}\if\relax\detokenize{#1}\relax\else\cptB:\fi\cptC:#3\cptD:
    \endgraf\vskip\baselineskip}}}}
\HLet\LT@makecaption\:tempc
>>>

Captions in Longtable are placed inside of the table structure.
We need to use special configuration to produce correct rendering, 
normal code for caption will not work.

\Link[https://tex.stackexchange.com/a/642350/2891]{}{} More details\EndLink

\<longtable captions\><<<
\NewConfigure{longtablecaption}{4}
\def\:tempc#1#2#3{%
    \a:longtablecaption #1{\cap:ref{#2}}\if\relax\detokenize{#1}\relax\else\b:longtablecaption\fi\c:longtablecaption#3\d:longtablecaption
    \endgraf%\vskip\baselineskip <- this caused error in https://tex.stackexchange.com/q/682383/2891
 }
\HLet\LT@makecaption\:tempc
>>>

\Link[https://puszcza.gnu.org.ua/bugs/?313]{}{}
Write table info to the LOT
\EndLink
\<longtable captions\><<<
\def\:tempc#1[#2]#3{%
  \LT@makecaption#1\fnum@table{#3}%
  \cur:lbl{}%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else%
  {\let\\\space%
  \protect:wrtoc%
  \edef\:temp{#2}%
  \edef\:temp{\the\:tokwrite{\string\doTocEntry%
  \string\toclot%
  {\thetable}{\string\csname\space a:TocLink\string\endcsname%
    {\FileNumber}{\cur:th \:currentlabel}{}{\ifx\:temp\empty\else \ignorespaces #2\fi}}%
      {}\relax}}\:temp%
  }%
  \fi%
}

\HLet\LT@c@ption\:tempc
>>>



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{table.sty of pctex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<pctable.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% pctable.4ht                          |version %
% Copyright (C) |CopyYear.1999.      Eitan M. Gurari         %
|<TeX4ht copyright|>
\:CheckOption{pic-table}\if:Option
   \pend:def\BeginTable{\Picture*{}}
   \append:def\EndTable{\EndPicture}
\else
   \catcode`\!=11
   |<fix pctex table|>
   \catcode`\!=12
\fi

   |<pctex table shared config|>
\Hinput{pctable}
\endinput
>>>        \AddFile{7}{pctable}

Didn't implement vertical lines. Default: html tables; can switch
to pictorial tables by rasing the \`'pic-table' switch.

\<fix pctex table\><<<
\HAssign\pc:tbl=0
\let\pctex:vrule=\relax
 \pend:def\BeginTable{\bgroup \Configure{HtmlPar}{}{}{}{}
\let\pc:endtd=\relax
\let\pc:endtr=\relax
\let\pc:cols=\relax\gHAdvance\pc:tbl by 1
    \Tg<table class="pctable\pc:tbl">
    \let\halign\TeXhalign \HRestore\noalign  }
 \append:def\EndTable{\pc:endtd\Tg</table>\egroup}

\def\pctex:vrule#1{} 

 \let\:tfSetVrule=\!tfSetVrule
\def\!tfSetVrule{%
  \!thToksEdef\!taRuleColumnTemplate={%
   \pctex:vrule{\the\!taColumnNumber}\the
      \!taRuleColumnTemplate}\:tfSetVrule}

\expandafter\def\csname !tk:l\endcsname{%
 \Css{.pctable\pc:tbl\space     
    td.pc-\the\!taColumnNumber{text-align:left;white-space: nowrap;
   padding-left:3pt;padding-right:3pt;}}}
\expandafter\def\csname !tk:c\endcsname{%
 \Css{.pctable\pc:tbl\space     
    td.pc-\the\!taColumnNumber{text-align:center;white-space: nowrap;
    padding-left:3pt;padding-right:3pt;}}}
\expandafter\def\csname !tk:r\endcsname{%
 \Css{.pctable\pc:tbl\space     
    td.pc-\the\!taColumnNumber{text-align:right;white-space: nowrap;
    padding-left:3pt;padding-right:3pt;}}}
\expandafter\def\csname !tk:p\endcsname{%
 \Css{.pctable\pc:tbl\space     
    td.pc-\the\!taColumnNumber{padding-left:3pt;padding-right:3pt;}}}

\pend:defI\ReadFormatKeys{\csname !tk:\string##1\endcsname}

\Css{.justleft{text-align:left;white-space: nowrap;
      padding-left:3pt;padding-right:3pt;}}
\Css{.justright{text-align:right; white-space: nowrap;
      padding-left:3pt;padding-right:3pt;}}
\Css{.justcenter{text-align:center; white-space: nowrap;
      padding-left:3pt;padding-right:3pt;}}

\let\:ReadFormatKeys=\ReadFormatKeys
\let\:tfAdjoinPriorColumn=\!tfAdjoinPriorColumn
\def\!tfAdjoinPriorColumn{%
   \def\ReadFormatKeys{%
   \!thToksEdef\!taDataColumnTemplate={%
      \pc:endtd\Tg<td\Hnewline
         class="pc-\the\!taColumnNumber">\the
                \!taDataColumnTemplate\Tg</td>}%
   \let\ReadFormatKeys=\:ReadFormatKeys\ReadFormatKeys}%
   \:tfAdjoinPriorColumn}

\let\:tfFinishFormat=\!tfFinishFormat
\def\!tfFinishFormat{%
  \edef\:temp{\!taPreamble{\noexpand\pc:endtd
    \Tg<tr>\the\!taPreamble \Tg</tr>}}\:temp
  \edef\pc:cols{\the\!taColumnNumber}\HAdvance \pc:cols by -1 
    \:tfFinishFormat}

\def\ReFormat[{%
  \omit
  \!taDataColumnTemplate{\pc:endtd
       \Tg<td\Hnewline class="refformat">##\Tg</td>}%
  \!taLeftGlue{}% 
  \!taRightGlue{}% 
  \catcode`\||=12  
  \catcode`\"=12  
  \ReadFormatKeys}

\pend:defI\!ttuse{%
  \ifnum ##1>\@ne   
     \omit \def\:multspn{colspan="##1"}%
     \expandafter\expandafter\expandafter\:gobble
  \fi}

\def\!ttShortHruleA{\pc:endtd\HCode{<tr><td 
   colspan="\pc:cols" class="short"><hr\Hnewline class="short"
   /></td></tr>}\null\ignorespaces}
\def\!ttFullHruleA{%
  \pc:endtd   \HCode{<tr><td
   class="full" colspan="\pc:cols"><hr\Hnewline 
   class="full" /></td></tr>}\penalty0 \egroup} 

\append:def\JustLeft{\pc:endtd
   \pc:td{justleft}\def\!ttRightGlue{\Tg</td>}}
\append:def\JustCenter{\pc:endtd
   \pc:td{justcenter}\def\!ttRightGlue{\Tg</td>}}
\append:def\JustRight{\pc:td{justright}\def\!ttRightGlue{\Tg</td>}}
\def\pc:td#1{\Tg<td class="#1"\:multspn>}
\let\:multspn|=\empty
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Horizontal Lines}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

In the case of vertical lines and spaces, we allow for
horizontal segmenattion to allow for vertical
lines to go through.

\SubSection{hline}

\<html latex halign\><<<
\def\:temp{\a:hline}
\HLet\hline|=\:temp
\NewConfigure{hline}[1]{\c:def\a:hline{#1}}
>>>

\<hline body for array/tabular\><<<
\append:def\hline:s{\a:HBorder}%
\def\:tempb{\ifnum \tmp:cnt<\ar:cnt 
    \advance\tmp:cnt by 1 \append:def\hline:s{\b:HBorder}%
    \expandafter\:tempb
  \fi }
\tmp:cnt|=0 \:tempb
\append:def\hline:s{\c:HBorder}\global\let\hline:s|=\hline:s
>>>

\<init for hlines\><<<
\global\let\hline:s|=\empty
>>>

\SubSection{V Spaces}

\<html latex halign\><<<
\def\:temp#1{\tmp:dim|=#1\xdef\HBorderspace{\the\tmp:dim}\cr\a:vspc}
\HLet\@xargarraycr|=\:temp
\NewConfigure{//[]}[1]{\c:def\a:vspc{#1}}
>>>

\<init for vspaces\><<<
\global\let\vspc:s|=\empty
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{cline}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<early latex definitions\><<<
\newif\ifomit:
>>>

\<html latex halign\><<<
\HAssign\cline:cnt=0
\def\:temp#1-#2\@nil{\omit \global\omit:true \cr 
   \o:noalign:{\a:xcline\HAssign\:tempb=#1 \set:clines{#2}}\ignoreEndTr}
\HLet\@cline|=\:temp
\def\set:clines#1{\expandafter\gHAssign\csname :\:tempb\endcsname=1
   \ifnum \:tempb<#1 \Advance:\:tempb by 1 \expandafter\set:clines
   \else \expandafter\:gobble
   \fi {#1}}
\NewConfigure{xcline}{1}
>>>

dblatex shows the \Verb=\xcline= in

\Verbatim
\documentclass{article}  
\usepackage{array}  
\begin{document}  
    \begin{tabular}{lll}  
                         \\\cline{2-3}  
    \end{tabular}  
\end{document}  
\EndVerbatim

but not when array.sty is out. Why?   xcline got introduced to detect
those appearences to be cleaned by xtpipes.  

\<init for clines\><<<
\global\let\cline:s|=\empty
\HAssign\:tempb=0 \init:clines  \global\let\cline:s|=\cline:s 
>>>

\<html latex halign\><<<
\def\init:clines{\ifnum \:tempb<0\csname ar:cnt\endcsname 
     \Advance:\:tempb by 1
     \expandafter\gHAssign\csname :\:tempb\endcsname=0
     \expandafter\append:def\expandafter\cline:s\expandafter{\csname
          :\:tempb\endcsname}%
     \expandafter\init:clines 
  \fi}
>>>

\<cond eliminate pre cline tr\><<<      
\gHAdvance\cline:cnt by 1
\expandafter\ifx \csname  cw:cline-\cline:cnt\endcsname \relax \else
   \Tag{Cline-\cline:cnt}{}%
\fi
\expandafter\ifx \csname  cw:Cline-\cline:cnt\endcsname \relax \else
   \ht:special{t4ht@[}%
\fi
>>>

\<end cond eliminate pre cline tr\><<<      
\ifomit: \Tag{cline-\cline:cnt}{}\fi
\expandafter\ifx \csname  cw:Cline-\cline:cnt\endcsname \relax \else
   \ht:special{t4ht@]}%
\fi
\global \omit:false
>>>

%%%%%%%%%%%%%%%%%%%
\SubSection{Configurations}
%%%%%%%%%%%%%%%%%%%

\<html latex halign\><<<
\def\InitHBorder{%
   |<init for vspaces|>%
   |<init for hlines|>%
   |<init for clines|>}
\def\HBorder{%
   \ifx \hline:s\empty \else\hline:s\fi
   \ifx \vspc:s\empty \else\vspc:s\fi
   \ifnum \expandafter\inspect:cline\cline:s{-1}>0 \d:HBorder
      \expandafter\reset:cline\cline:s2\g:HBorder\fi}
|<cline contains non-zero value?|>
\def\reset:cline#1{\ifcase #1
       \e:HBorder\expandafter\reset:cline
  \or  \f:HBorder\expandafter\reset:cline
  \else                                  
  \fi}
\InitHBorder
>>>

The value of \`'\cline:s' might contain too many digits for a TeX integer, hence
the  recursive macro \`'\inspect:cline' checks the digits separately.

\<cline contains non-zero value?\><<<
\def\inspect:cline#1{%
   \ifnum #1>0 1\expandafter\exit:inspect:cline
   \else \ifnum #1=-1 
        0\else \expandafter\expandafter\expandafter\inspect:cline  
   \fi   \fi
}
\def\exit:inspect:cline#1{%
   \ifnum #1=-1 
        0\else \expandafter\exit:inspect:cline
   \fi
}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Tabulary}
%%%%%%%%%%%%%%%%%%%%%%%%

\<tabulary.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% tabulary.4ht                          |version %
% Copyright (C) |CopyYear.2005.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  \Hinclude{\input tabulary-a.4ht}{array} 
\endinput
>>>        \AddFile{8}{tabulary}

\<tabulary-a.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% tabulary-a.4ht                        |version %
% Copyright (C) |CopyYear.2005.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<tabulary code|>
\Hinput{tabulary}
\endinput
>>>        \AddFile{8}{tabulary-a}

\<tabulary code\><<<
\NewConfigure{tabulary}{6}
\def\:tempc#1{\leavevmode 
   \let\@array:a\a:tabulary \let\@array:b\b:tabulary 
   \let\@array:c\c:tabulary \let\@array:d\d:tabulary 
   \let\@array:e\e:tabulary \let\@array:f\f:tabulary
   \hbox \bgroup   \:@tabular: 
      $\col@sep\tabcolsep \let\d@llarbegin\begingroup 
                                    \let\d@llarend\endgroup 
       \let\@classz\TY@classz 
   \@tabarray} 
\HLet\TY@tabular\:tempc 
>>>

\<tabulary code\><<<
\def\:tempc{\relax 
   \ifx \HCol\:UnDef \else \ifnum\HCol=1 \a:endarray\fi \fi 
   \crcr\ifx \EndPicture\:UnDef 
   \EndMkHalign\else \egroup\fi \egroup $\egroup} 
\HLet\endtabulary\:tempc 
\expandafter \let \csname endtabulary*\endcsname\endtabulary
>>>

\<tabulary code\><<<
\def\:tempc{\@chclass 
 \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else 
  \ifnum \@lastchclass=7 5 \else 
   \ifnum \@lastchclass=8 \tw@ \else 
    \ifnum \@lastchclass=9 \thr@@ 
   \else \z@ 
   \ifnum \@lastchclass = 10 \else 
   \edef\@nextchar{\expandafter\string\@nextchar}% 
   \@chnum 
   \if \@nextchar c\z@ \add:ar-\else 
    \if \@nextchar l\@ne \add:ar<\else 
     \if \@nextchar r\tw@ \add:ar>\else 
   \if \@nextchar C7 \add:ar C\else 
    \if \@nextchar L8 \add:ar L\else 
     \if \@nextchar R9 \add:ar R\else 
     \if \@nextchar J10 \add:ar J\else 
   \z@ \@chclass 
   \if\@nextchar ||\@ne \b:VBorder\else 
    \if \@nextchar !6 \else 
     \if \@nextchar @7 \b:VBorder\else 
      \if \@nextchar <8 \else 
       \if \@nextchar >9 \else 
  10 
  \@chnum 
  \if \@nextchar m\thr@@ \add:ar m\else 
   \if \@nextchar p4 \add:ar p\else 
    \if \@nextchar b5 \add:ar b\else 
   \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi\fi \fi \fi\fi \fi 
     \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi} 
\HLet\@testpach\:tempc
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Tabularx}
%%%%%%%%%%%%%%%%%%%%%%%%

\<tabularx.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% tabularx.4ht                          |version %
% Copyright (C) |CopyYear.2006.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{tabularx}
\endinput
>>>        \AddFile{7}{tabularx}

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{xltabular}
%%%%%%%%%%%%%%%%%%%%%%%%

\<xltabular.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% xltabular.4ht (|version), generated from |jobname.tex 
% Copyright 2024 TeX Users Group 
|<TeX4ht license text|> 
|<xltabular restore longtable|>
\Hinput{xltabular}
\endinput
>>> \AddFile{7}{xltabular}


\<xltabular restore longtable\><<<
% xltabular redefines \LT@array, which breaks all TeX4ht patches for this command
% we must restore TeX4ht's version
\let\xltabular\tabularx
\let\endxltabular\endtabularx
\let\longtable\XLT@longtable
\AtBeginDocument{
  \HLet\XLT@LT@array\n:LT@array:
}
>>>


%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Arydshln}
%%%%%%%%%%%%%%%%%%%%%%%%

We don't support any features yet, we just try to avoid 
compilation errors

\<arydshln.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% arydshln.4ht (|version), generated from |jobname.tex 
% Copyright 2022-2024 TeX Users Group 
|<TeX4ht license text|> 
% this is a copy of code that arydshln inserts to \@array
\def\:new:array{\adl@everyvbox\everyvbox
        \everyvbox{\adl@arrayinit \the\adl@everyvbox \everyvbox\adl@everyvbox}%
        % this line may lead to errors if the document uses Colortbl:
        % \ifadl@inactive \adl@inactivate \else \adl@activate \fi
        \let\adl@noalign\noalign}
\ifcsname n:@array:\endcsname% if \@array was already patched by TeX4ht
  \let\orig:n@array\n:@array:
  \def\n:@array:{\:new:array\orig:n@array}
\else
  \pend:def\@array{\:new:array}
\fi
\Hinput{arydshln}
\endinput
>>>        \AddFile{7}{arydshln}

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Tabu}
%%%%%%%%%%%%%%%%%%%%%%%%

Some details are
\Link[https://tex.stackexchange.com/a/467126/2891]{}{}here\EndLink. I
was not able to fix all tabu issues, it is too aggressive in basic table
handling. Michal

\<tabu.4ht\><<< 
% tabu.4ht (|version), generated from |jobname.tex 
% Copyright 2018-2023 TeX Users Group 
|<TeX4ht license text|> 
|<tabu config|>
|<tabu redefine env|>
\Hinput{tabu} 
\endinput
>>> \AddFile{9}{tabu}

\<tabu config\><<<
% we must suppress \everyrow redefintion by tabu, so some macro patching is necessary
\def\tabu@AtBeginDocument{
\ifdefined\CT@arc@ \else \let\CT@arc@  \relax \fi
\ifdefined\CT@drsc@\else \let\CT@drsc@ \relax \fi
 \let\tabu@arc@L \CT@arc@ \let\tabu@drsc@L \CT@drsc@
% \everyrow{}%
}

\let\orig:hline\hline
\def\tabu@firstline{\orig:hline}
\def\tabu@firsthline{\orig:hline}
\def\tabu@lastline  {\orig:hline}
\def\tabu@lasthline {\orig:hline}
% there is a clash between tabu and tex4ht on \hline handling
% we will just use \cr in place of \hline
\def\tabu@hline {\cr}% \tabu@hline

% this is basically a rewrite of the \tabu@select macro
% the original code just crashed everything
\def\tabu@select {%
        \expandafter \tabuthepreamble
}% \tabu@select


\def\tabu@setup{\tabu@alloc@
    \ifcase \tabu@nested
        \ifmmode \else \iftabu@spread\else \ifdim\tabu@target=\z@
            \let\tabu@afterendpar \par
        \fi\fi\fi
        \def\tabu@aligndefault{c}
        \tabu@init 
        \tabu@indent
    \else       % <nested tabu>
        \def\tabu@aligndefault{t}
        \let\tabudefaulttarget \linewidth
    \fi
    \let\tabu@thetarget \tabudefaulttarget \let\tabu@restored \@undefined
    \edef\tabu@NC@list{\the\NC@list}\NC@list{\NC@do \tabu@rewritefirst}%
    %\everycr{} % don't let tabu redefine \everycr
   \let\@startpbox \tabu@startpbox % for nested tabu inside longtabu...
             \let\@endpbox   \tabu@endpbox   % idem "    "    "    "    "    "
             \let\@tabarray  \tabu@tabarray  % idem "    "    "    "    "    "
    \tabu@setcleanup 
    % \tabu@setreset % this causes issues
}% \tabu@setup
>>>

\<tabu redefine env\><<<
\def\:tempa#1#{%
  \setbox\z@=\hbox#1{}% this is necessary to support \begin{tabu} to 7cm{...}
  \ifvmode\IgnorePar\fi\EndP\let\endtabu\endtabularx\tabularx{\textwidth}% 
}
\HLet\tabu\:tempa
>>>

We need to load the tabularx package, because we use it instead of Tabu for actual tables

\<add to usepackage\><<<
\AddToHook{package/tabu/before}{\RequirePackage{tabularx}} 
>>>


%%%%%%%%%%%%%%%%%%%%%%%%
\Section{threeparttable}
%%%%%%%%%%%%%%%%%%%%%%%%

\<threeparttable.4ht\><<< 
% threeparttable.4ht (|version), generated from |jobname.tex 
% Copyright 2022 TeX Users Group 
|<TeX4ht license text|> 
\def\:tempa{\o:TPT@endtabbox:\AddToHookNext{env/\@currenvir/after}{\IgnorePar}}
\HLet\TPT@endtabbox\:tempa
\Hinput{threeparttable} 
\endinput
>>> \AddFile{9}{threeparttable}

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{tabularray}
%%%%%%%%%%%%%%%%%%%%%%%%

\<tabularray.4ht\><<< 
% tabularray.4ht (|version), generated from |jobname.tex 
% Copyright 2022-2024 TeX Users Group 
|<TeX4ht license text|> 
|<tabularray definitions|>
|<tabularray table and rows|>
|<tabularray lines|>
|<tabularray cell|>
\Hinput{tabularray} 
\endinput
>>> \AddFile{9}{tabularray}

\<tabularray definitions\><<<
\NewConfigure{tabularray}{8}
\NewConfigure{tabularrayignoredcell}{2}
\NewConfigure{tabularrayattributes}[1]{\concat:config\CellAttributes{#1\space}}
\NewConfigure{tabularraystyles}[1]{\concat:config\CellStyle{#1}}
\NewConfigure{tabularraycolumnwidth}{1}

\ExplSyntaxOn
\NewConfigure{tabularrayhalign}[2]{%
  \cs_set:cpn{tabularray_halign:#1}{#2}
}

\NewConfigure{tabularrayvalign}[2]{%
  \cs_set:cpn{tabularray_valign:#1}{#2}
}
\ExplSyntaxOff
>>>

Insert basic tags for table and rows

\<tabularray table and rows\><<<
\ExplSyntaxOn
\long\def\:tempa#1#2#3#4{%
  % insert <table>...</table>
  \a:tabularray\o:__tblr_environ_code:nnnn:{#1}{#2}{#3}{#4}\b:tabularray
}
\HLet\__tblr_environ_code:nnnn\:tempa

\long\def\:tempa#1{\int_set:Nn \c@rownum {#1}\xdef\HRow{\@arabic\c@rownum}\c:tabularray\o:__tblr_build_row:N:{#1}\d:tabularray}
\HLet\__tblr_build_row:N\:tempa
\ExplSyntaxOff
>>>

Tabularray uses hrules in many places, it is not practical to redefine all commands that contain them,
se we disable underscores that are produced for rules using special.

\<tabularray lines\><<<
% disable rules
\ht:special{t4ht@_}
>>>

We detect borders for each cell using these functions. They can be then set using CSS.

Tabularray supports multiple rules between rows and cells, but these would be too difficult to support
using CSS, so we don't try that.

\<tabularray lines\><<<
\ExplSyntaxOn
% #1 row number, #2 column, #3 hline number (there can be multiple), #4 css property to be set
\def\:tblr:hlinestyle#1#2#3#4{
  % get line height
  \tl_set:Ne \l__tblr_h_tl{ \__tblr_spec_item:ne { hline } { [#1](#3) / @hline-height } }
  % get dash style
  \def\@tblr@dash{} % remove "dash" word from the variable for correct CSS string
  \tl_set:Ne \l__tblr_f_tl{\__tblr_spec_item:ne { hline } { [#1][#2](#3) / @dash }}
  % create CSS only when a dash style is set 
  \tl_if_empty:NF\l__tblr_f_tl{
    % get hline color
    \tl_set:Ne \l__tblr_g_tl { \__tblr_spec_item:ne { hline } { [#1][#2](#3) / fg } }
    \def\:hlinecolor{\#000000}
    % convert color to CSS value if color is set
    \tl_if_empty:NF\l__tblr_g_tl{\get:xcolorcss{\l__tblr_g_tl}\:hlinecolor}
    % \Configure{tabularraystyles} doesn't expand attributes, so we need to expand it here
    % otherwise, we would get wrong color and hline style in the last row, because this macro is called twice here
    \cs_set:ce{#4:}{#4:\dim_to_decimal_in_unit:nn{\l__tblr_h_tl*2}{1px}px~\l__tblr_f_tl\space~\:hlinecolor;}
    \Configure{tabularraystyles}{\csname#4:\endcsname}
  }
}

\def\:tblr:vlinestyle#1#2#3#4{
  \tl_set:Ne \l__tblr_t_tl{ \__tblr_spec_item:ne { vline } { [#2](#3) / @vline-width } }
  \def\@tblr@dash{} % remove "dash" word from the variable for correct CSS string
  \tl_set:Ne \l__tblr_f_tl{\__tblr_spec_item:ne { vline } { [#1][#2](#3) / @dash }}
  \tl_if_empty:NF\l__tblr_f_tl{
    \tl_set:Ne \l__tblr_g_tl { \__tblr_spec_item:ne { vline } { [#1][#2](#3) / fg } }
    \def\:hlinecolor{\#000000}
    % convert color to CSS value if color is set
    \tl_if_empty:NF\l__tblr_g_tl{\get:xcolorcss{\l__tblr_g_tl}\:hlinecolor}
    % \Configure{tabularraystyles} doesn't expand attributes, so we need to expand it here
    % otherwise, we would get wrong color and hline style in the last row, because this macro is called twice here
    \cs_set:ce{#4:}{#4:\dim_to_decimal_in_unit:nn{\l__tblr_t_tl*2}{1px}px~\l__tblr_f_tl\space~\:hlinecolor;}
    \Configure{tabularraystyles}{\csname#4:\endcsname}
  }
}
\ExplSyntaxOff
>>>

The code for cell is a bit complicated. We need to construct CSS properties
for horizontal and vertical alignment, background color and rules. 

\<tabularray cell\><<<
\ExplSyntaxOn
\long\def\:tempa#1#2{%
% find columns that are covered by rowspan and colspan
  \xdef\HCol{\@arabic\c@colnum}
  \xdef\HRow{\@arabic\c@rownum}
  \xdef\HMultispan{\lTblrCellColSpanTl}
  \xdef\HRowspan{\lTblrCellRowSpanTl}
  \let\CellAttributes\@empty
  \let\CellStyle\@empty
  % calculate ignored cells, if the current cell uses colspan or rowspan
  \int_step_inline:nnn{\c@rownum }{\c@rownum - 1 + \lTblrCellRowSpanTl}{
    \int_step_inline:nnn{\c@colnum }{\c@colnum - 1  + \lTblrCellColSpanTl}{
      % the loop always matches the current cell, we must ignore it
      \str_if_eq:eeF{\HCol.\HRow}{####1.##1}{%
        \cs_gset:cpn{ignoredcell-####1-##1}{}
      }
    }
  }
  \cs_if_exist_use:c{tabularray_halign:\g__tblr_cell_halign_tl}
  \cs_if_exist_use:c{tabularray_valign:\g__tblr_cell_valign_tl}
  % the vertical aligment can be set also in \g__tblr_cell_middle_tl, so we should try it as well
  \cs_if_exist_use:c{tabularray_valign:\g__tblr_cell_middle_tl}
  % calculate column width
  \dim_compare:nNnT {\__tblr_data_item:nen{column}{\HCol}{@col-width}} > {0pt}{
    \__tblr_get_table_width:% initialize \tablewidth
    \edef\HColWidth{\fp_eval:n{\__tblr_data_item:nen{column}{\HCol}{@col-width}/\tablewidth*100}\%}
    % save table width, preferably in CSS
    \a:tabularraycolumnwidth%
  }
  % there can be multiple hlines for each cell, but we only suport the first one, because of limitations of CSS
  \:tblr:hlinestyle{#1}{#2}{1}{border-top}
  \int_compare:nNnT{\HRow + \HRowspan - 1} = {\c@rowcount}{% 
    % draw hline below the last row
    \:tblr:hlinestyle{\int_eval:n{\c@rownum + 1}}{#2}{1}{border-bottom}
  }
  % the same is true for vlines
  \:tblr:vlinestyle{#1}{#2}{1}{border-left}
  \int_compare:nNnT{\HCol + \HMultispan - 1} = {\c@colcount}{%
    % draw hline below the last row
    \:tblr:vlinestyle{#1}{\int_eval:n{\c@colnum + 1}}{1}{border-right}
  }
  % support for the background color
  \tl_set:Ne \l__tblr_b_tl
  { \__tblr_data_item:neen { cell } {#1} {#2} { background } }
  % save background color to the list of CSS, if it is set
  \tl_if_empty:NF \l__tblr_b_tl{
    \get:xcolorcss{\l__tblr_b_tl}\:bgcolor
    \Configure{tabularraystyles}{background-color: \:bgcolor;}
  }
  % We can use something like \Configure{tabularrayattributes}{rowspan="\HRowspan"} in \Configure{tabularray}
  % to declare correct attributes for joined cells
  \int_compare:nNnT {\HRowspan} > {1}{\g:tabularray}
  \int_compare:nNnT {\HMultispan} > {1}{\h:tabularray}
  \cs_if_exist:cTF{ignoredcell-\the\c@colnum-\the\c@rownum}{%
    \a:tabularrayignoredcell\e:tabularray\o:__tblr_build_cell_content:NN:{#1}{#2}\f:tabularray\b:tabularrayignoredcell
  }{%
    \e:tabularray\o:__tblr_build_cell_content:NN:{#1}{#2}\f:tabularray
  }
  % the ignored cell is global, so we must undefine it after the thes
  \cs_undefine:c{ignoredcell-\the\c@colnum-\the\c@rownum}%
}
\HLet\__tblr_build_cell_content:NN\:tempa

\ExplSyntaxOff
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{mdwtab}
%%%%%%%%%%%%%%%%%%%%%%%%

\<mdwtab.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% mdwtab.4ht                            |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<mdwtab config|>
\Hinput{mdwtab}
\endinput
>>>        \AddFile{9}{mdwtab}

\<mdwtab config\><<<
\def\:tempc[#1]#2{% 
  |<init conds for @mkpream|>%
  \edef\tab@restorehlstate{% 
    \global\tab@endheight\the\tab@endheight% 
    \gdef\noexpand\tab@hlstate{\tab@hlstate}% 
  }% 
  \def\tab@hlstate{n}% 
  \colset{tabular}% 
  \tab@initread 
  \let\@sharp\relax                                             % <--------
  \def\tab@midtext{\tab@setcr\ignorespaces\@sharp\@maybe@unskip}% <---------
  \def\tab@multicol{\@arstrut\tab@startrow}% 
  \tab@preamble{\tab@multicol\tabskip\z@skip}% 
  \tab@readpreamble{#2}% 
  \tab@leftskip\z@skip% 
  \tab@rightskip\z@skip% 
  \tab@setposn{#1}% 
%  \ifdim\tab@width=\z@% 
%    \def\tab@halign{}% 
%  \else% 
%    \def\tab@halign{to\tab@width}% 
%  \fi% 
  \lineskip\z@\baselineskip\z@% 
%%%%%%%%%%%%%%%%%%%%%%%%%%
\SaveMkHalignConfig
\Configure{MkHalign}
   {\@array:a}%
   {\@array:b\ProperTrTrue}%
   {\a:putHBorder\InitHBorder 
    |<cond eliminate pre cline tr|>%
    \ifProperTr{\@array:c}}%
   {\ifProperTr{\@array:d}%
    |<end cond eliminate pre cline tr|>%
    \a:putHBorder\InitHBorder}%
   {\ifProperTr{\@array:e}\RecallMkHalignConfig   %\recall:ar
   }%
   {\ifProperTr{\@array:f}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  \m@th% 
  \def\tabularnewline{\tab@arraycr\tab@penalty}% 
  \tab@setcr% 
  \let\par\@empty% 
  \everycr{}\tabskip\tab@leftskip  \tab@left
  \edef\:temp{\noexpand\MkHalign \@sharp{\the\tab@preamble}}%
% \hshow{:temp}%
  \:temp 
%  \halign\expandafter\bgroup% 
%    \the\tab@preamble\tabskip\tab@rightskip\cr% 
}
\HLet\@array\:tempc
>>>

\<mdwtab config\><<<
\def\:tempc#1{% 
  \@ifundefined{\tab@colset!col.\string#1}{% 
    \tab@err@undef{#1}\tab@mkpreamble% 
  }{% 
    \if c#1\add:ar   -\else
    \if l#1\add:ar   <\else
    \if r#1\add:ar   >\else
    \if p#1\add:ar   p\else
    \if b#1\add:ar   b\else
    \if m#1\add:ar   m\else
    \if ||#1\b:VBorder\else
    \if @#1\d:VBorder \else
    \fi\fi\fi\fi\fi\fi\fi\fi
    \@nameuse{\tab@colset!col.\string#1}% 
  }% 
} 
\HLet\tab@mkpreamble@iii\:tempc
|<alignment utilities for VBorder|>%
>>>

\<mdwtab config\><<<
\def\:tempc{\relax  
   \ifx \HCol\:UnDef \else \ifnum\HCol=1 \a:endarray\fi \fi 
   \crcr\ifx \EndPicture\:UnDef \EndMkHalign 
   \else \egroup\fi 
   \tab@right 
   \tab@restorehlstate } 
\HLet\endarray\:tempc 
>>>

\<mdwtab config\><<<
\pend:def\tabular{|<set hooks of tabular|>}
\def\endtabular{\endarray}
>>>

\<mdwtab config\><<<
\expandafter\pend:defI\csname tabular*\endcsname{
   \expandafter\let\expandafter\@array:a\csname a:tabular*\endcsname 
   \expandafter\let\expandafter\@array:b\csname b:tabular*\endcsname
   \expandafter\let\expandafter\@array:c\csname c:tabular*\endcsname 
   \expandafter\let\expandafter\@array:d\csname d:tabular*\endcsname
   \expandafter\let\expandafter\@array:e\csname e:tabular*\endcsname 
   \expandafter\let\expandafter\@array:f\csname f:tabular*\endcsname
}
\expandafter\def\csname endtabular*\endcsname{\endarray}
\NewConfigure{tabular*}{6}
>>>

\<mdwtab config\><<<
\pend:def\smarray{%
  \let\@array:a\a:smarray \let\@array:b\b:smarray
  \let\@array:c\c:smarray \let\@array:d\d:smarray
  \let\@array:e\e:smarray \let\@array:f\f:smarray
}
\def\endsmarray{\endarray}
\NewConfigure{smarray}{6}
>>>

%%%%%%%%%%%%%%%%%%%
\Section{tabto}
%%%%%%%%%%%%%%%%%%%

\<tabto.4ht\><<<
% tabto.4ht (|version), generated from |jobname.tex 
% Copyright 2023 TeX Users Group 
|<TeX4ht license text|> 
|<tabto redefine|>
\Hinput{tabto}
\endinput
>>>\AddFile{9}{tabto}

\<tabto redefine\><<<
\NewConfigure{tabto}{1}
\NewConfigure{tabtos}{1} % for starred version \tabto*
% the provided dimension is stored in \Htabsize
\ProvideDocumentCommand\tabto:fourht{sm}{\def\Htabsize{\the\dimexpr#2\relax}\IfBooleanTF {#1}{\a:tabtos}{\a:tabto}}
\HLet\tabto\tabto:fourht
>>>

%%%%%%%%%%%%%%%%%%%
\Chapter{multirow}
%%%%%%%%%%%%%%%%%%%

\<multirow.4ht\><<<
% multirow.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2004. Eitan M. Gurari
|<TeX4ht copywrite|>
 |<multirow hooks|>
\Hinput{multirow}
\endinput
>>>        \AddFile{9}{multirow}

\<multirow hooks\><<<
\def\@xmultirow[#1]#2[#3]#4[#5]#6{%
  \expandafter\multirow@piii#3\relax\end%
  \multirow@dima=#2\ht\@arstrutbox
  \advance\multirow@dima#2\dp\@arstrutbox
  \ifdim#2pt<\z@\multirow@dima=-\multirow@dima\fi
  \advance\multirow@dima \multirow@cntb\bigstrutjot
  \if*#4\multirow@vbox{#1}{}{\hbox{\strut#6\strut}}%
  \else \if=#4\multirow@setcolwidth{#6}%
    \multirow@vbox{#1}{\hsize\multirow@colwidth\@parboxrestore}{\strut#6\strut\par}%
  \else \multirow@vbox{#1}{\hsize#4\@parboxrestore}{\strut#6\strut\par}%
  \fi \fi
  \ifdim#2pt>\z@
    \if#1t\relax\multirow@dima=\ht0\else
      \multirow@dima=\ht\@arstrutbox
      \ifmultirow@prefixt \advance\multirow@dima\bigstrutjot\fi
      \if#1b\relax \advance\multirow@dima\dp\@arstrutbox
        \ifmultirow@prefixb \advance\multirow@dima\bigstrutjot\fi
      \fi
    \fi
  \else
    \if#1b\relax\else
      \advance\multirow@dima-\dp\@arstrutbox
      \ifmultirow@prefixb \advance\multirow@dima-\bigstrutjot\fi
      \if#1t\relax\advance\multirow@dima-\ht\@arstrutbox
        \ifmultirow@prefixt \advance\multirow@dima-\bigstrutjot\fi
        \advance\multirow@dima\ht0
      \fi
    \fi
  \fi
  \advance\multirow@dima#5\relax
  \leavevmode\a:multirow
  \setbox0\vtop{\vskip-\multirow@dima\box0\vss}\dp0=\z@
  \ifmultirowdebug{\showboxdepth=5 \showboxbreadth=10 \showbox0}\fi
  \box0\b:multirow
}
\NewConfigure{multirow}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Pictures}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltpictur.dtx]{}{}ltpictur.dtx\EndLink

The \`'\picture' does not offer text substitute (too much pain to
create them).  Also note that \`'\Picture+{}' puts the picture in a box, but not so \`'\Picture+[]{}'

DON't we need in the following \''\LaTexEnv'

\<latex ltpictur\><<<
\let\lt:pic|=\picture
\def\picture{%
   \ifx \EndPicture\:UnDef
      \a:picture
      \let\end:lt:pic|=\endpicture
      \def\endpicture{\end:lt:pic \b:picture}%
   \else \let\EndPicture|=\empty
   \fi\lt:pic}
>>>

Picture environments, and other also, can be indirectly nested in
setbox comamnds. Hence the setting of \''\EndPicture' to empty
for nested occurances of \''\endpicture'.

\<latex ltpictur\><<<
\NewConfigure{picture}{2}
>>>

%\ConfigureEnv{picture}
%    {\ifvmode \Indent\HCode{<div align=center>}%
%        \def\aft:Env{\HCode{</div>}\Indent}%
%     \else \def\aft:Env{}\fi}
%    {\aft:Env}{}{}

% \ConfigureEnv{picture}{\leavevmode}{\HCode{<BR CLEAR="ALL">}\Indent}{}{}

The BR tag is used to force line breaks within text.
Normally, linebreaks are treated as a space by browsers
(except inside the PRE tag). The optional CLEAR
attribute is used when you have an IMG image in your
text. If that image uses ALIGN=LEFT or
ALIGN=RIGHT, the text will flow around it. If you have
text you want below the image, you can do this with
{\tt <BR CLEAR=LEFT>} or CLEAR=RIGHT to force
scrolling down to a clear left or right margin,
respectively. Using CLEAR=ALL will scroll down until
both marings are clear. CLEAR=NONE is the default,
and does nothing. 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Theorem Environments}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%
\Section{LaTeX}
%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltthm.dtx]{}{}ltthm.dtx\EndLink

In latex.cls \''\@thm'  is defined with two arguments, and in
amsthm.sty with three parameters. In both cases we have a
\''\@currentlabel' defined through a \''refstepcounter', and
the latter command introducing its own identity, instead of that
of the theorem, into the xref file (and then the href fields
of the html tags). The following code corrects that behavior.

\<latex ltthm\><<<
\def\:thm{\o:@thm:}
\def\:temp{|<seed begin theorem|>\:thm}
\HLet\@thm|=\:temp
\let\o:@endtheorem:|=\@endtheorem
\append:def\@endtheorem{\c:newtheorem}
\NewConfigure{newtheorem}{3}
>>>

\<seed begin theorem\><<<
\let\sv:item|=\item
\def\item[##1]{|<no page break before item|>\let\item|=\sv:item
               \item[##1]\b:newtheorem}%
\a:newtheorem\AutoRefstepAnchor 
>>>

A page break before an item might have a different behavor than a
regular start of a paragraph at an item. Hence, the following code.

\<no page break before item\><<<
\nobreak
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{ntheorem.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<theorem.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% theorem.4ht                           |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<theorem sty|>
\Hinput{theorem}
\endinput
>>>        \AddFile{8}{theorem}

\<theorem sty\><<<
\let\theo:@thm=\@thm
\def\@thm#1#2{%
   \expandafter\ifx \csname end#1\endcsname\@endtheorem \else
        \expandafter\let \csname end#1\endcsname\@endtheorem
   \fi
   \theo:@thm{#1}{#2}%
}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{ntheorem.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<ntheorem.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ntheorem.4ht                         |version %
% Copyright (C) |CopyYear.1999.      Eitan M. Gurari         %
|<TeX4ht copyright|>
|<ntheorem.sty|>
|<ntheorem.std|>
\Hinput{ntheorem}
\endinput
>>>        \AddFile{8}{ntheorem}

\Link[http://www.informatik.uni-freiburg.de/\string
     ~may/Ntheorem/ntheorem.html]{}{}%
ntheorem\EndLink

\<ntheorem.sty\><<<
\def\:tempc{\nonumber\endeqnarray} 
\expandafter\HLet \csname endeqnarray*\endcsname\:tempc
>>>

\<ntheorem.sty\><<<
\if@thmmarks
    \pend:defI\@endtrivlist{|<prepend end trivlist|>}
\fi
>>>

\<ntheorem.styNO\><<<
\def\:temp{%
     \gdef\snd:halign{\t:eqnar
        \global\let\snd:halign\empty}%
      \global\let\Oldeqnnum|=\@eqnnum
      \gdef\@eqnnum{\Oldeqnnum\PotEndMark{\SetMark@endeqnarray}}%
      \@@eqncr
      \egroup
      \global\advance\c@equation\m@ne
   $$\rc:roco \global\@ignoretrue
   \global\let\@eqnnum\Oldeqnnum}
\HLet\endeqnarray|=\:temp
\def\:temp{%
    \gdef\snd:halign{\t:eqnar
        \global\let\snd:halign\empty}%
    \let\reserved@a\relax
    \ifcase\@eqcnt \def\reserved@a{& & &}\or \def\reserved@a{& &}%
     \or \def\reserved@a{&}\else
       \let\reserved@a\@empty
       \@latex@error{Too many columns in eqnarray environment}\@ehc\fi
     \reserved@a {\D:eqnar
        \normalfont \normalcolor \PotEndMark{}\d:eqnar }%
     \global\@eqnswtrue\global\@eqcnt\z@\cr
     %
      \egroup
      \global\advance\c@equation\m@ne
   $$\rc:roco \global\@ignoretrue}
\expandafter\HLet\csname endeqnarray*\endcsname|=\:temp
>>>

\<ntheorem.styNO\><<<
\def\sv:roco{\let\sv:Row|=\HRow  \let\sv:Col|=\HCol}
\def\rc:roco{\global\let\HRow|=\sv:Row  \global\let\HCol|=\sv:Col}
\def\first:row{\gHAssign\HRow|=0 }
\def\next:row{\gHAdvance\HRow |by 1 \gHAssign\HCol|=0 }
\def\next:col{\gHAdvance\HCol |by 1 }
>>>


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{bussproofs}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<bussproofs.4ht\><<<
% bussproofs.4ht (|version), generated from |jobname.tex
% Copyright 2019 TeX Users Group
|<TeX4ht license text|>

\NewConfigure{DisplayProof}{2}

\pend:defI\DisplayProof{\a:DisplayProof}
\append:defI\DisplayProof{\b:DisplayProof}
\Hinput{bussproofs}
\endinput

>>> \AddFile{8}{bussproofs}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{proof}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<proof.4ht\><<<
% proof.4ht (|version), generated from |jobname.tex
% Copyright 2019 TeX Users Group
|<TeX4ht license text|>
\NewConfigure{infer}{2}
\def\:temp[#1]#2#3{%
\a:infer\o:@infer:[#1]{#2}{#3}\b:infer
}
\HLet\@infer|=\:temp
\Hinput{proof}
\endinput
>>> \AddFile{8}{proof}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Sectioning Commands}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Section{Cut Points}

% 

We make the following temporary definitions so to cheat CutAt and the likes that
definitions for the keywords exist.

\<book / report / article cut points\><<<
\Configure{UndefinedSec}{likepart}
\Configure{UndefinedSec}{likechapter}
\Configure{UndefinedSec}{likesection}
\Configure{UndefinedSec}{likesubsection}
>>>

\<ams art, proc, book\><<<
\Configure{UndefinedSec}{likepart}
\Configure{UndefinedSec}{likechapter}
\Configure{UndefinedSec}{likesection}
\Configure{UndefinedSec}{likesubsection}
>>>

\<latex html cut points\><<<
\def\cut:gr#1{\lk:#1like|<par del|>%
    \ifx \:temp\empty \expand:after{%
       \expand:after{\expandafter\let\csname #1\endcsname|=}%
                                     \csname :#1\endcsname
       \ct:gr{#1}%
       \expand:after{\expandafter\let\csname :#1\endcsname|=}%
                                     \csname #1\endcsname
       \expandafter\let\csname #1\endcsname|=\:UnDef}%
    \else
        \expand:after{\ct:gr{#1}}%
    \fi}
 \def\ct:gr#1{%
   \edef\:temp{%
      \let\:csname \HP:file : #1\endcsname |=\:csname #1\endcsname
      \let\:csname \HP:file :Cut:#1\endcsname |=\:csname Cut:#1\endcsname
      \def\:csname #1\endcsname{%
         \noexpand \@ifnextchar*{\noexpand\after:gobble
                                      \:csname :like#1\endcsname}%
                                {\:csname \HP:file :#1-\endcsname}}%
      \def\:csname \HP:file :#1-\endcsname####1{%
         \noexpand\cond:cs{\HP:file}{####1}%
         \:csname \HP:file : #1\endcsname{####1}}%
      \def\:csname Cut:#1\endcsname####1{%
         \noexpand\cond:cs{Cut:\HP:file}{####1}%
         \noexpand\cond:cs{\HP:file :Cut:#1}{####1}}%
   }\:temp }
\def\lk:#1like#2|<par del|>{\def\:temp{#1}}
\def\after:gobble#1#2{#1}
>>>

\Section{Shared Below Chapter Stuff}

Sectioning commands can be called directly through their default
definitions, or indirectly throught \''\rdef:sec'.  

The latter invocation calls a corresponding tex4ht command:
\''\:likefoo' in case of a starred commands, and \''\no:foo' in case
of non-starred commands. Then it invokes the original definition,
without a title, to extract the native changes in the environment,
such as counter numbers.

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltsect.dtx]{}{}ltsect.dtx\EndLink

\<\><<<
\let\no:ssect|=\@ssect
\def#1#2#3{\no:ssect{#1}{#2}{0ex}}
\let\no:sect|=\@sect
\def\no@sect#1#2#3#4#5{\no:sect{#1}{#2}{#3}{#4}{0ex}}
>>>

The LaTeX command hook mechanism doesn't like our redefinitions of 
\''\@sect' and \''\@ssect', so we need to declare and use them explicitly. 
Otherwise, packages that try to add hooks to these commands may cause errors.
See \Link[http://puszcza.gnu.org.ua/bugs/?639]{}{} this bug report\EndLink.

\<latex ltsect\><<<
\NewHookWithArguments{cmd/@sect/before}{8}
\NewReversedHookWithArguments{cmd/@sect/after}{8}
\NewHookWithArguments{cmd/@ssect/before}{5}
\NewReversedHookWithArguments{cmd/@ssect/after}{5}
>>>

\<latex ltsect\><<<
\let\no@ssect|=\@ssect
\def\@ssect#1#2#3#4#5{%
  \UseHookWithArguments{cmd/@ssect/before}{5}{##1}{##2}{##3}{##4}{##5}%
  \:Sc3\no@ssect{#1}{#2}{#3}{#4}{\:Sc4#5\:Sc2}\HtmlEnv%
  \UseHookWithArguments{cmd/@ssect/after}{5}{##1}{##2}{##3}{##4}{##5}%
}
\let\no@sect|=\@sect
\def\@sect#1#2#3#4#5#6[#7]#8{%
   \UseHookWithArguments{cmd/@sect/before}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
   \xdef\c:secnumdepth{#2}\:Sc3%
   \no@sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{\:Sc4#8\:Sc2}\HtmlEnv%
   \UseHookWithArguments{cmd/@sect/after}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
 }
\let\:startsection|=\@startsection
\def\@startsection#1{\@ifstar{\Configure{secType}{like#1}}%
   {\Configure{secType}{#1}}%
   \:Sc1\:startsection{#1}}
\NewConfigure{secType}[1]{\def\sec:typ{#1}}
>>>

\''\@sec' and \''\@ssec'  are redefined in tex4ht.4ht to be based on
building-blocks of tex4ht.sty. The \''section-'  option resestablish 
the default setting.

\<latex ltsect\><<<
\NewConfigure{@sec @ssect}[1]{%
   \def\rdef:sec##1{#1\csname no@##1\endcsname}}
\:CheckOption{sections-}     \if:Option 
   \Configure{@sec @ssect}{}
\else      
   \Configure{@sec @ssect}{%
      |<sv Sc, sec, ssec|>\let\:Sc|=\:gobble
      |<redf sec|>%
      |<redf ssec|>\IgnorePar}
\fi
>>>

The following is need for \''\@seccntformat'.

\<disable @seccntformat\><<<
\ifx \o:@seccntformat:\:UnDef
  \let\o:@seccntformat:|=\@seccntformat
\fi
\let\@seccntformat|=\:gobble
>>>

\<restore @seccntformat\><<<
\let\@seccntformat=\o:@seccntformat:
>>>

% <P \:P:>

%  \let\no:Sect|=\@sect
%   \def\no@sect{\SkipRefstepAnchor\no:Sect}

\<redf sec\><<<
\def\@sect##1##2##3##4##5##6[##7]##8{%
   \UseHookWithArguments{cmd/@sect/before}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
   |<disable @seccntformat|>%
   \let\@sect|=\no@sect   \xdef\c:secnumdepth{##2}%
   {\SkipRefstepAnchor \let\addcontentsline|=\:gobbleIII \let\mark|=\:gobble
    \no@sect{##1}{##2}{##3}{##4}{##5}{##6}[{##7}]{}}%
   |<recall Sc, sec, ssec|>%
   |<restore @seccntformat|>%
   \HtmlEnv    \Toc:Title{##7}\csname no:#1\endcsname{##8}%
   \UseHookWithArguments{cmd/@sect/after}{8}{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}%
 }%
>>>

In the above we want \`'[{##7}]' instead of \`'[##7]', in case `]' is
included in the parameter.

The following is for the star option.

\<redf ssec\><<<
\def\@ssect##1##2##3##4##5{%
   \UseHookWithArguments{cmd/@ssect/before}{5}{##1}{##2}{##3}{##4}{##5}%
   |<star sec title|>%
   \let\@ssect|=\no@ssect
   {\def\addcontentsline####1####2####3{}%
    \no@ssect{##1}{##2}{##3}{##4}{}}%
   |<recall Sc, sec, ssec|>%
   \HtmlEnv   \csname :like#1\endcsname{##5}%
   \UseHookWithArguments{cmd/@ssect/after}{5}{##1}{##2}{##3}{##4}{##5}%
 }%
>>>

\<sv Sc, sec, ssec\><<<
\let\sv:Sc|=\:Sc \let\sv:sect|=\@sect \let\sv:ssect|=\@ssect
>>>

\<recall Sc, sec, ssec\><<<
\let\:Sc|=\sv:Sc \let\@sect|=\sv:sect \let\@ssect|=\sv:ssect
>>>

\<latex ltsect\><<<
\pend:defI\@hangfrom{\a:@hangfrom}
\append:defI\@hangfrom{\b:@hangfrom}
\NewConfigure{@hangfrom}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Configuration for `section-' option}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<latex ltsect\><<<
\long\def\ConfigureSec#1#2#3#4#5{%
   \expandafter\def\csname #1:Sc1\endcsname{#2}%
   \expandafter\def\csname #1:Sc2\endcsname{#3}%
   \expandafter\def\csname #1:Sc3\endcsname{#4}%
   \expandafter\def\csname #1:Sc4\endcsname{#5}%
}
\def\:Sc#1{%
   \ifx \sec:typ\:UnDef
       \:warning{Missing \string\Configure{secType}{...}}%
       \let\sec:typ|=\empty
   \fi
   \csname \sec:typ :Sc#1\endcsname}
>>>

\<latex.ltx latex edit+ commands\><<<
\def\:Sc#1{%
   \ifx \sec:typ\:UnDef
       \:warning{Missing \string\Configure{secType}{...}}%
       \let\sec:typ|=\empty
   \fi
   \ifx \EndPicture\:Undef\a:trc Sec(\sec:typ)#1\b:trc\fi
   \csname \sec:typ :Sc#1\endcsname
   \ifx \EndPicture\:Undef\c:trc Sec(\sec:typ)#1\d:trc\fi
}
>>>

\<latex.ltx latex edit commands\><<<
\def\:Sc#1{%
   \ifx \sec:typ\:UnDef
       \:warning{Missing \string\Configure{secType}{...}}%
       \let\sec:typ|=\empty
   \fi
   \expandafter\ifx \csname \sec:typ :Sc#1\endcsname \relax
      \ifx \EndPicture\:Undef\a:trc Sec(\sec:typ)#1\b:trc
                             \c:trc Sec(\sec:typ)#1\d:trc\fi
   \else  \csname \sec:typ :Sc#1\endcsname \fi
}
>>>

%%%%%%

\Section{Cut Points}

The following is for equating starred and non-starred (i.e., like) sectioning commands.

\<latex html cut points\><<<
\let\tex:cutat\:CutAt
\def\:CutAt#1#2,#3//{%
   \chk:like #2like//%
   \ifx  \:temp\empty \expand:after{\tex:cutat#1#2,}\del:like#2,#3//%
      \else                 \tex:cutat#1#2,like#2,#3//\fi}
\def\chk:like#1like#2//{\def\:temp{#1}}
\def\del:like#1like{#1}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Footnotes, Floats, and Figures}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Floats, Inserts, and Captions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltfloat.dtx]{}{}ltfloat.dtx\EndLink

% \pend:def\caption{\html:addr \edef\cur:th{\last:haddr f}}

\<latex ltfloat\><<<
\def\@xfloat #1[#2]{%
    \def \@captype {#1}%
   \:clearpage \bf:float \:clearpage
   \begingroup
      \expandafter\ifx\csname end#1\endcsname\o:end@float:
         \expandafter\let\csname end#1\endcsname\float@end
         \expandafter\let\csname end#1*\endcsname\float@dblend
      \fi
      \@parboxrestore
      \reset@font 
      \normalsize  
      \everypar{\HtmlPar}%
}
\let\o:end@float:|=\end@float
\def\end@float{\endgroup\:clearpage \af:float}
\let\end@dblfloat|=\end@float
>>>

Need to fix also double float

% Floats put the content of figures within vboxes.  Setting parameter
% \`'[h]' for here, make things worse (why?). Does \`'\vsize=\z@ \vss'
% do any good? it should! The HCodes should be within the boxes so
% that they will not be detached from the figures.
% 
% 
% \<html latex floats\><<<
% \def\:temp#1#2{%                       |%%\def\pend:defIBI#1#2{% |%
%    \def\:temp{#2}%
%    \def\:tempa{\def#1####1[####2]}%
%    \expandafter\expandafter\expandafter\expandafter
%        \expandafter\expandafter\expandafter\:tempa
%    \expandafter\expandafter\expandafter{\expandafter\:temp #1{##1}[##2]}}
% 
% \:temp\@xfloat{\:clearpage {\ht:everypar{}\bf:float }\:clearpage}
% >>>
% 
% %\let\:xfloat|=\@xfloat
% %\def\@xfloat{\:clearpage {\ht:everypar{}\bf:float }\:clearpage \:xfloat}
% 
% 
% 
% \<html latex floats\><<<
% \pend:def\end@float{\vsize\z@ \vss}
% \append:def\end@float{\:clearpage {\ht:everypar{}\af:float}}
% \append:def\@endfloatbox{\ht\@currbox|=0.5\ht\@currbox }
% >>>
% 
% To get the float not to split from part of the additions of TeX4ht,
% and from floating, we cheat in the dimensions.  Since the current
% box is a \''\vbox', we cut the hight by two.
% 

\`'#1' before anchors, \`'#2' after anchors, \`'#3' after float.

\<latex ltfloat\><<<
\Odef\c:float:[#1]#2#3#4{%
   \def\bf:float{#2|<tags for captions|>#3}%
   \def\af:float{#4}}
\gHAssign\capt:cnt|=0
\Configure{float}{}{}{}
>>>

The initialization of the counter is for degenerated cases in
which the captions don't appear within floats. Does this work?

The anchors of the links are within the frames of the pictures, only if
they are  empty (or the default frame of horizontal lines before and
after the picture are used \`'   \def\:tempa{\HCode{<HR>}}\def\:tempb{#1}%
   \ifx \:tempa\:tempb  \else
').

The following has been changed for getting links in \`'.aux' files to
\`'.lot' (list of tables) and \`'lof'  (list of figures) files.

\<latex ltfloat\><<<
|<latex caption index|>
\long\def\:tempc#1[#2]#3{\par \cur:lbl{}%
  |<write caption to toc|>\begingroup
    |<latex caption index save|>
    \@parboxrestore \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup 
|<latex caption index print|>
|<cancel if-label anchors|>}
\def\numberline#1{\hbox to\@tempdima{#1\hfil} }
\HLet\@caption|=\:tempc
>>>

The index commands used inside caption may result in fatal error. 
We use the LaTeX 3 sequences to save their contents inside caption,
and print them when it is safe.

\<latex caption index\><<<
\ExplSyntaxOn
\seq_new:N\:savedindex
\def\:initsaveindex{\seq_gclear:N\:savedindex}
\def\:saveindex#1{\seq_gput_right:Nn\:savedindex{#1}}
\def\:printsavedindex{\seq_map_inline:Nn\:savedindex{\index{##1}}}
\ExplSyntaxOff
>>>

\<latex caption index optional\><<<
\ExplSyntaxOn
\renewcommand\:saveindex[2][]{\seq_gput_right:Nn\:savedindex{[#1]{#2}}}
\def\:printsavedindex{\seq_map_inline:Nn\:savedindex{\index##1}}
\ExplSyntaxOff
>>>

\<latex caption index save\><<<
\:initsaveindex%
\let\index\:saveindex%
>>>

\<latex caption index print\><<<
\:printsavedindex%
>>>

The \''|<cancel if-label anchors|>' request no 
the \''\label' commands to avoid duplicating the anchor already set by the 
\''\caption' command.

\<config book-report-article utilities\><<<
|<book-report-article caption|>
\pend:def\caption{\SkipRefstepAnchor}
>>>

\<book-report-article caption\><<<
|<config makecaption|>
>>>

\<config makecaption\><<<
\NewConfigure{caption}[4]{\c:def\cptA:{#1}\c:def\cptB:{#2}%
   \c:def\cptC:{#3}\c:def\cptD:{#4}}
\long\def\@makecaption#1#2{%   |%\:makecaption|%
{\cptA: |<caption and ref/tag|>\if :#1:\else\cptB:\fi}{\cptC:{#2}\cptD:}}
>>>

\<write caption to toc\><<<
\begingroup
   \gHAdvance\TitleCount by 1  
   \protect:wrtoc
   \edef\:temp{#2}%
   \edef\:temp{\the\:tokwrite{\string\doTocEntry
     \string\toc|<caption type|>{\csname 
        the#1\endcsname}{\string\csname\space a:TocLink\string\endcsname
      {\FileNumber}{\cur:th
        \:currentlabel}{}{\ifx\:temp\empty\else \ignorespaces #2\fi}}%
     {#1}\relax}}\:temp 
\endgroup
>>>

\<caption type\><<<
\expandafter\ifx\csname ext@#1\endcsname\relax
#1\else\csname ext@#1\endcsname\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Tags for Figures}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<caption and ref/tag\><<<
\cap:ref{#1}%
>>>

A \`'\Link{}{\cur:th\@currentlabel}#1\EndLink' will send the
rferference to the caption and not the figure, a problematic situation
for cases that the captions appear at the bottom.

The \`'\global\let\skip:anchor\:UnDef' voids \`'\SkipRefstepAnchor'
in \''\caption'.

\<latex ltfloat\><<<
\:CheckOption{refcaption}     \if:Option 
   \def\cap:ref#1{\cur:lbl{}\Link{}{\cur:th\:currentlabel}#1\EndLink
                  \global\let\skip:anchor\:UnDef}
\else
   \Log:Note{for links into captions, instead
       of float heads, use the command line option `refcaption'}%
   \def\cap:ref#1{\cur:lbl{}%
      #1\Tag{\float:cnt cAp\capt:cnt}{\cur:th\:currentlabel}%
     \gHAdvance\capt:cnt |by 1  }
\fi
>>>

\<tags for captions\><<<
\gHAdvance\float:cnt |by 1
\gHAssign\capt:cnt|=0  
\hbox{\def\flt:anchor{#1}\get:cptg}%
>>>

\<tags for captions, empty\><<<
\gHAdvance\float:cnt |by 1
\gHAssign\capt:cnt|=0  
\hbox{\def\flt:anchor{}\get:cptg}%
>>>

The hbox to preserve vertical mode, and for avoiding extra \''<P>''s.

\<latex ltfloat\><<<
\HAssign\float:cnt|=0
\def\get:cptg{%
   \ifTag{\float:cnt cAp\capt:cnt}{%
      \Make:Label{\LikeRef{\float:cnt cAp\capt:cnt}}{\flt:anchor}%
      \Advance:\capt:cnt |by 1  \expandafter\get:cptg
   }{}}
>>>

\<html tex floats\><<<
\let\:ins|=\@ins
\let\:endinsert|=\endinsert
\def\::ns{\:ins \let\endinsert|=\:endinsert}
\def\@ins{\ifx \EndPicture\:UnDef \par\a:insert\par\bgroup
      \def\endinsert{\egroup\par\b:insert\par}
   \else \expandafter\::ns\fi }
>>>

\<config plain utilities\><<<
\NewConfigure{insert}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Wrapfig}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<wrapfig.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% wrapfig.4ht                          |version %
% Copyright (C) |CopyYear.2003.      Eitan M. Gurari         %
|<TeX4ht copyright|>
|<wrap fig|>
\Hinput{wrapfig}
\endinput
>>>        \AddFile{9}{wrapfig}

\<wrap fig\><<<
\def\WF@wr[#1]#2{% 
  \lowercase{\def\WFplace{#2}}%
  \@ifnextchar[\WF@rapt{\WF@rapt[\wrapoverhang]}}
\def\WF@rapt[#1]#2{% 
   \a:wrapfloat   |<tags for captions, empty|>%
   \vtop\bgroup \setlength\hsize{\ifdim #2=0pt 0.1pt\else #2\fi}%
      \@parboxrestore}
\long\def\WF@floatstyhook#1\@ignoretrue{\b:wrapfloat  
   \global\@ignoretrue}
\NewConfigure{wrapfloat}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Floatpag}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<floatpag.4ht\><<<
% floatpag.4ht (|version), generated from |jobname.tex
% Copyright 2019 TeX Users Group
|<TeX4ht license text|>
% this command doesn't make sense in HTML anyway
\renewcommand\thisfloatpagestyle[1]{}
\Hinput{floatpag}
\endinput
>>> \AddFile{9}{floatpag}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Footnotes}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Thanks}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<latex ltfloat\><<<
\def\:temp#1{{\stepcounter{footnote}%
   \ifx \footnote\thanks
      \a:thank\@fnsymbol\c@footnote\b:thank
   \fi
   \let\a:thanks\empty    \let\b:thanks\empty
   \protected@xdef\@thanks{\noexpand\a:thanks{\@thanks\c:thank
     \@fnsymbol\c@footnote\d:thank #1\e:thank}\noexpand\b:thanks}%
}}
\HLet\thanks|=\:temp
\NewConfigure{thank}{5}
\NewConfigure{thanks}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{LaTeX}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The engines of footnotes are

\Verbatim
\def\@footnotemark{...\@makefnmark...}
\long\def\@footnotetext#1{...\@makefntext{#1}...}
\EndVerbatim

with the index suplied to both places in \''\@thefnmark'.  We set the following hooks.

\Verbatim
\def\@footnotemark{...\a:@makefnmark\@makefnmark
                                           \b:@makefnmark...}
\long\def\@footnotetext#1{...\a:@makefntext
                \@makefntext{\b:@makefntext 
                                   \a:@makefnbody #1\b:@makefnbody
                            }\c:@makefntext...}
\EndVerbatim

\<latex ltfloat\><<<
\pend:def\@footnotemark{\bgroup
  \expandafter\ifx \csname @makefnmark\endcsname\relax \else
    \pend:def\@makefnmark{\hbox\bgroup\a:footnotemark}%
    \append:def\@makefnmark{\b:footnotemark\egroup}%
  \fi
}
\append:def\@footnotemark{\egroup}
\NewConfigure{footnotemark}{2}
\NewConfigure{footnotebody}{2}
>>>

\<latex ltfloat\><<<
\long\def\@footnotetext#1{\leavevmode
   \vbox{%\IgnorePar
      \leftskip0pt {\ht:everypar{}\parindent0pt\leavevmode}%
      |<makefntext for footnotetext|>%
      \reset@font\footnotesize
      \color@begingroup
        \@makefntext{\ignorespaces#1}%
      \color@endgroup
      \ht:special{t4ht@[}}\ht:special{t4ht@]}}
\NewConfigure{footnotetext}{3}
>>>

\<makefntext for footnotetext\><<<
\long\def\:tempc##1{|<footnote label|>\a:footnotetext
   \o:@makefntext:{\b:footnotetext \csname a:footnotebody\endcsname
                {##1}\csname b:footnotebody\endcsname}\c:footnotetext
}%
\HLet\@makefntext\:tempc
>>>

\<footnote label\><<<
\protected@edef
  \@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
\anc:lbl f{footnote}%
>>> 

The following arises in cases like \`'
\begin{minipage}{6in} 
x\footnote{The}
\end{minipage}'.

\<latex ltfloat\><<<
\long\def\@mpfootnotetext#1{\leavevmode
   \vbox{%
      \leftskip0pt {\ht:everypar{}\parindent0pt\leavevmode}%
      |<makefntext for mpfootnotetext|>%
      \reset@font\footnotesize
      \color@begingroup
         \@makefntext{\ignorespaces #1}%
      \color@endgroup
      \ht:special{t4ht@[}}\ht:special{t4ht@]}}
>>>

\<makefntext for mpfootnotetext\><<<
\def\:tempc##1{|<mpfootnote label|>\a:footnotetext
   \o:@makefntext:{\b:footnotetext \csname a:footnotebody\endcsname
                {##1}\csname b:footnotebody\endcsname}\c:footnotetext
}%
\HLet\@makefntext\:tempc
>>>

\<mpfootnote label\><<<
\protected@edef
  \@currentlabel{\csname p@mpfootnote\endcsname\@thefnmark}%
\anc:lbl f{footnote}%
>>> 

The following assign the counter into \''\FNnum'.

\<latex ltfloat\><<<
\def\FNnum{\the\c@footnote}
\def\:tempc{%
   \HAssign\FNnum = \csname c@\@mpfn\endcsname
   \HAdvance\FNnum by 1
   \o:footnote:
}
\HLet\footnote=\:tempc
\def\:tempc[#1]{%
   \HAssign\FNnum = #1\relax
   \o:@xfootnote:[#1]%
}
\HLet\@xfootnote\:tempc
\def\:tempc{%
   \HAssign\FNnum = \c@footnote
   \HAdvance\FNnum by 1
   \o:footnotemark:
}
\HLet\footnotemark\:tempc

% fix \footnotemark in \section*
\MakeRobust\footnotemark

\def\:tempc[#1]{%
   \HAssign\FNnum =  #1\relax
   \o:@xfootnotemark:[#1]%
}
\HLet\@xfootnotemark\:tempc
\def\:tempc{%
   \HAssign\FNnum = \csname c@\@mpfn\endcsname
   \o:footnotetext:
}
\HLet\footnotetext\:tempc

% fix \footnotetext in \section*
\MakeRobust\footnotetext

\def\:tempc[#1]{%
   \HAssign\FNnum = #1\relax
   \o:@xfootnotenext:[#1]%
}
\HLet\@xfootnotenext\:tempc
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Other}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Verbatim
eplain/eplain.tex:\def\vfootnote#1{\insert\footins\bgroup
musitex/musixsty.tex:\def\vfootnote#1{\insert\footins\bgroup\parskip\z@\eightpoint
context/base/plain.tex:\def\vfootnote#1{\insert\footins\bgroup
cyrplain/base/cyrplain.tex:\def\vfootnote#1{\insert\footins\bgroup
latex/mathtime/lplain-m.tex:%\def\vfootnote#1{\insert\footins\bgroup
plain/base/plain.tex:\def\vfootnote#1{\insert\footins\bgroup
plain/mathtime/plain-mt.tex:\def\vfootnote#1{\insert\footins\bgroup
plain/misc/mimulcol.tex:  \def\vfootnote##1{\insert\footins\bgroup
\EndVerbatim

\<plain vfootnote\><<<
\long\def\vfootnote#1{%
   \gHAdvance\FNnum |by 1
   \def\FNmark{#1}\ifx \FNmark\empty
      \def\FNmark{*}%
   \fi
   \a:vfootnote\b:vfootnote\bgroup
   \futurelet\:temp\fnt:body}
\def\fnt:body{\ifx \:temp\bgroup \bgroup
      \aftergroup\end:vfootnote\def\:temp{\let\:temp|=}%
   \else \def\:temp##1{##1\end:vfootnote}\fi 
   \:temp}
\def\end:vfootnote{\egroup\c:vfootnote}
\HAssign\FNnum |= 0
\NewConfigure{vfootnote}{3}
>>>

The following definition is after manmac, which allows the second
parameter to have changes of catcodes. Earlier, we had the
following definition.

\Verbatim
\long\def\vfootnote#1#2{%
   \gHAdvance\FNnum |by 1 \def\:temp{#1}\ifx \:temp\empty
      \def\:temp##1[##2]##3{##1[##2]{*}}\expandafter\:temp \fi
   \HPageButton[fn\FNnum]{#1}\BeginHPage[fn\FNnum]{ }{#2}\EndHPage{}}
\EndVerbatim

LaTeX does not redefine \`'\vfootnote'.  The splited definition of
HPage insures that the title of the hypertext will have a blank, and
not some possible math commands. An empty parameter in the HPage would
put the file name in the title.

\<eplain vfootnote\><<<
\long\def\vfootnote#1{%
   \gHAdvance\FNnum |by 1 \def\:temp{#1}\ifx \:temp\empty
      \def\:temp##1[##2]##3{##1[##2]{*}}\expandafter\:temp \fi
   \def\FNmark{#1}%
   \a:vfootnote\b:vfootnote\bgroup
   \futurelet\:temp\fnt:body}
\def\fnt:body{\ifx \:temp\bgroup \bgroup
      \aftergroup\end:vfootnote\def\:temp{\let\:temp|=}%
   \else \def\:temp##1{##1\end:vfootnote}\fi 
   \:temp}
\def\end:vfootnote{\egroup\c:vfootnote}
\HAssign\FNnum |= 0
\NewConfigure{vfootnote}{3}
>>>

AmS-TeX needs to restore footnote

\<html TeX4ht local env\><<<
\HLet\footnote|=\vfootnote
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Superscripts}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The following command 
\`'\def\@textsuperscript#1{%
  {\m@th\ensuremath{^{\mbox{\fontsize\sf@size\z@#1}}}}}',
where the exponent is too early to be an
active character.

\<latex ltfloat\><<<
\def\:temp#1{%
  {\m@th\ensuremath{^{\mbox{\fontsize\sf@size\z@#1}}}}}
  \def\:tempc#1{{\m@th
     \ifmmode {\HCode{}}\sp {\mbox{\fontsize\sf@size\z@#1}}%
     \else 
        \a:textsuperscript
           {\mbox{#1}}\b:textsuperscript
     \fi }}
  \HLet\@textsuperscript\:tempc
\NewConfigure{textsuperscript}{2}
\Configure{textsuperscript}
   {$\relax{\HCode{}}\sp}
   {$}
>>>

The definition of \`'\@textsuperscript' in latex2e uses feartures not
available in latex209.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Subscripts}

This is a variant of textsuperscript.

\<subscript.4ht\><<<
% subscript.4ht (|version), generated from |jobname.tex
% Copyright 2015-2021 TeX Users Group
|<TeX4ht license text|>
|<subscript def|>
\Hinput{subscript}
\endinput
>>>  \AddFile{9}{subscript}

\<latex ltfloat\><<<
|<subscript def|>
\Hinput{subscript}
>>>
\<subscript def\><<<
\def\:temp#1{%
   {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
  \def\:tempc#1{{\m@th%
     \ifmmode {\HCode{}}\sb {\mbox{\fontsize\sf@size\z@#1}}%
     \else%
        \a:textsubscript%
           {\mbox{#1}}\b:textsubscript%
     \fi }}
  \HLet\@textsubscript\:tempc
\NewConfigure{textsubscript}{2}
\Configure{textsubscript}
   {$\relax{\HCode{}}\sb}
   {$}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{subfigure.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Defines a command \`'\externaldocument' for importing exterla aux
files from foreugn sources. Should be called after \''\Preamble', and
before \''\begin{document}'.

\<subfigure.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% subfigure.4ht                        |version %
% Copyright (C) |CopyYear.1997.      Eitan M. Gurari         %
|<TeX4ht copyright|>
\ifx\subfig@oldlabel\relax 
   |<2002 subfigure|>
\else 
   |<pre 2002 subfigure|>
\fi
|<fix subfigure|>
|<subfigure.sty shared config|>
\Hinput{subfigure}
\endinput
>>>        \AddFile{9}{subfigure}

\<pre 2002 subfigure\><<<
\def\:tempc{%
  \begingroup   \gHAdvance\TitleCount 1
    \let\begingroup|=\empty
    \let\:tempa|=\xdef
    \def\xdef{\let\xdef|=\:tempa
       \def\protect{\string}\xdef}\o:@subcaption:}
\HLet\@subcaption=\:tempc
>>>

\<2002 subfigure????\><<<
\def\:tempc{\gHAdvance\TitleCount 1 \o:@subcaption:}
\HLet\@subcaption=\:tempc
>>>

The above breaks the following example.

\Verbatim
\documentclass{book} 
 \usepackage{subfigure} 
\begin{document} 
  \tableofcontents 
  \listoffigures 
\chapter{Beginning.} 
\section{Introduction} 
 
\begin{figure}[H] 
   \subfigure{yyyyyyyyy} 
   \caption{cccccccccccc} 
\end{figure} 
 
\section{Next try} 
\chapter{Next one.} 
\section{Next Section} 
\section{Another section} 
 
\end{document} 
\EndVerbatim

\<pre 2002 subfigure\><<<
\def\:tempc#1[#2]#3{\a:subfigure
      \o:@subfloat:{#1}[#2]{\cur:lbl{}#3}\b:subfigure}
\HLet\@subfloat|=\:tempc
>>>

\<2002 subfigure\><<<
\def\:tempc#1[#2][#3]#4{\a:subfigure \cur:lbl{}%
   \o:@subfloat:{#1}[#2][#3]{#4}\b:subfigure}
\HLet\@subfloat|=\:tempc
>>>

Had to remove \`'\Link{}{\cur:th \:currentlabel}\EndLink' above after 
\`'#3' to avoide duplicate \''<a id=...>' elements:

\Verbatim
\documentclass{article}
\usepackage{subfigure}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\subfigure[curve]{\includegraphics{cube.eps}}
\end{figure}
\end{document}
\EndVerbatim

\<fix subfigure\><<<
\NewConfigure{subfigure}{2}
\def\:tempc#1#2{\o:@makesubfigurecaption:{%
   \pend:def\thesubfigure{\a:subfigurecaption}%
   \append:def\thesubfigure{\b:subfigurecaption}%
   \pend:def\thesubtable{\a:subfigurecaption}%
   \append:def\thesubtable{\b:subfigurecaption}%
   #1}{\c:subfigurecaption#2\d:subfigurecaption}}
\HLet\@makesubfigurecaption|=\:tempc
\NewConfigure{subfigurecaption}{4}
>>>

\<fix subfigure\><<<
\def\:tempc{\gHAdvance\TitleCount 1 \o:subfig@oldcaption:}
\HLet\subfig@oldcaption\:tempc
>>>

Was
\Verbatim
\def\:tempc{\gHAdvance\TitleCount 1 \o:@caption:}
\HLet\@caption\:tempc
\EndVerbatim

which failed on

\Verbatim
\documentclass{article}
\usepackage{makeidx}
% try to comment out this ...
\usepackage{subfigure}

% ... and this.
\makeindex

\begin{document}

% try placing the \index-statement outside of the caption.
\begin{figure}
Foo
\caption{Bar\index{ka!boom}
}
\end{figure}
\printindex
\end{document}
\EndVerbatim

%%%%%%%%%%%%%
\Section{caption.sty}
%%%%%%%%%%%%%

\<caption.4ht\><<<
% caption.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2007. Eitan M. Gurari
|<TeX4ht copywrite|>
|<caption shared config|>
|<caption redefine makecaption|>
|<caption addtocontents|>
\Hinput{caption}
\endinput
>>>        \AddFile{9}{caption}


\<add to usepackage\><<<
\Configure{PackageHooks}{caption.sty}{caption-hooks.4ht}
>>>

\<caption-hooks.4ht\><<<
% caption-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020-2022 TeX Users Group
|<TeX4ht license text|>
\:AtEndOfPackage{%
  \long\def\caption@If@Package@Loaded#1[#2]#3#4{}
  \renewcommand*\caption@redefine{%
    \let\caption\caption@caption%
    % \let\@caption\caption@@caption% 
  }%
}
>>> \AddFile{9}{caption-hooks}

\<caption shared config\><<<
\let\sv:toclof\toclof
\def\toclof#1#2#3{%
   \bgroup
     \def\a:TocLink##1##2##3##4{\gdef\:temp{##4}}%
     #2%
   \egroup
   \ifx \:temp\empty \else
      \sv:toclof{#1}{#2}{#3}%
   \fi
}
>>>

\<caption shared config\><<<
\let\lof:ConfigureToc\ConfigureToc
\long\def\ConfigureToc#1#2#3#4#5{% 
   \lof:ConfigureToc{#1}{#2}{#3}{#4}{#5}%
   \def\:temp{#1}\def\:tempa{lof}\ifx \:temp\:tempa
      \let\toc:lof\toclof
      \def\toclof##1##2##3{%
         \bgroup
           \def\a:TocLink####1####2####3####4{\gdef\:temp{####4}}%
           ##2%
         \egroup      
         \ifx\:temp\empty\else
            \toc:lof {##1}{##2}{##3}%
         \fi
   }\fi% 
} 
>>>

Handle redefined caption command. We ignore the second parameter of
\''\Configure{caption}'. It contains the separator between caption number
and label. It is colon by default, but user can configure to use something 
different. We should keep the separator selected by the user.

\<caption redefine makecaption\><<<
\long\def\@makecaption#1#2{%   
  |<fix continued float|>%
  \caption@make@above%
  \cptA:\caption@@make{\cap:ref{#1}}{\cptC:#2}\cptD:%
  \caption@make@below%
}
\long\def\caption@makecaption#1#2{%   
  |<fix continued float|>%
  \caption@make@above%
  \cptA:\caption@@make{\cap:ref{#1}}{\cptC:#2}\cptD:%
  \caption@make@below%
}
>>>

This definition should fix support for the \''ContinedFloat' command. 
Without it, we can get an error message that the current float type
is different than the one to be continued.

\<fix continued float\><<<
\xdef\continuedfloat@captype{\@captype}>>>

Caption's version of addcontentsline doesn't prevent expansion of macros, which 
may lead to errors when for example \''\%' is used. The use of detokenize should
prevent this issue.

\<caption addtocontents\><<<
 \renewcommand*\caption@@@addcontentsline[4]{%
   \def\temp{#1}\def\tempa{toc}\ifx \temp\tempa\else%
   \gHAdvance\TitleCount  1%
   \fi%
   \addcontentsline{#1}{#2}{\protect\numberline{#3}{\detokenize{#4}}}%
 }

>>>

%%%%%%%%%%%%%
\Section{subcaption.sty}
%%%%%%%%%%%%%

\<subcaption.4ht\><<<
% subcaption.4ht (|version), generated from |jobname.tex
% Copyright 2021-2023 TeX Users Group
|<TeX4ht license text|>
\NewConfigure{subfigure}{2}
\ConfigureEnv{subfigure}{\a:subfigure}{\b:subfigure}{}{}
\ConfigureEnv{subtable}{\a:subfigure}{\b:subfigure}{}{}
% these counters are not reset with TeX4ht, which leads to 
% wrong numbering of subfigures
\AddToHook{env/figure/begin}{\setcounter{subfigure}{0}}
\AddToHook{env/table/begin}{\setcounter{subtable}{0}}
\Hinput{subcaption}
\endinput
>>>        \AddFile{9}{subcaption}


%%%%%%%%%%%%%
\Section{footnotebackref.sty}
%%%%%%%%%%%%%

Dummy package for footnotebackref. We need to disable it completely.

\<footnotebackref.4ht\><<<
% footnotebackref.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
\Hinput{footnotebackref}
\endinput
>>> \AddFile{9}{footnotebackref}

\<add to usepackage\><<<
\Configure{PackageHooks}{footnotebackref.sty}{footnotebackref-hooks.4ht}
>>>

We disable the package, but still support the package options, as
other packages (such as tablefootnote.sty) rely on them.

\<footnotebackref-hooks.4ht\><<<
% footnotebackref.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
\:dontusepackage{footnotebackref}
\RequirePackage{kvoptions}% v3.10
\@ifpackageloaded{hyperref}{}{\RequirePackage{hyperref}}

\SetupKeyvalOptions{family=FootnoteBackref, prefix=FootnoteBackref@}

% The symbol between the footnotenumber and the footnotetext
% If empty no symbol will be printed
\DeclareStringOption{symbol}

% Option to hyperlink the footnotenumber
\DeclareBoolOption[true]{numberlinked}
\ProcessKeyvalOptions*
\endinput
>>> \AddFile{9}{footnotebackref-hooks}



%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{pagenote}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<pagenote.4ht\><<<
% pagenote.4ht (|version), generated from |jobname.tex
% Copyright 2023 TeX Users Group
|<TeX4ht license text|>
|<pagenote definitions|>
\Hinput{pagenote}
\endinput
>>> \AddFile{9}{pagenote}


\<pagenote definitions\><<<
% patch commands that print note numbers, so we can add links
\NewConfigure{notenumintext}{2}
\def\:tempa#1{\a:notenumintext\o:notenumintext:{#1}\b:notenumintext}
\HLet\notenumintext\:tempa

\NewConfigure{notenuminnotes}{2}
% we must save the note id in \:currentnoteid, to make it available in \Configure{notenuminnotes}
\def\:tempa#1{\def\:currentnoteid{#1}\a:notenuminnotes\o:notenuminnotes:{#1}\b:notenuminnotes}
\HLet\notenuminnotes\:tempa

>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{enotez}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<enotez.4ht\><<<
% enotez.4ht (|version), generated from |jobname.tex
% Copyright 2023 TeX Users Group
|<TeX4ht license text|>
|<enotez definitions|>
\Hinput{enotez}
\endinput
>>> \AddFile{9}{enotez}


\<enotez definitions\><<<
\NewConfigure{enotezmark}{2}
\NewConfigure{enotezback}{2}
\NewConfigure{enmark}{2}
% patch commands that print note numbers, so we can add links
\ExplSyntaxOn
% \:currentnoteid contains the note number
\protected\def\:tempa #1#2{\def\:currentnoteid{#1}\a:enotezmark\o:enotez_write_mark:nn:{#1}{#2}\b:enotezmark}
\HLet\enotez_write_mark:nn\:tempa

\protected\def\:tempa#1{\def\:currentnoteid{#1}\a:enotezback\o:enotez_write_list_number:n:{#1}\b:enotezback}
\HLet\enotez_write_list_number:n\:tempa

% enmark has issue with spurious space after note number, but space is missing after dot.
\cs_set:Npn   \enmark #1 {\a:enmark#1\unskip\b:enmark}
\Configure{enmark}{}{.}

\ExplSyntaxOff
>>>


%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{floatrow.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

We must prevent Floatrow from redefining of basic LaTeX
environments, such as table.

\<floatrow.4ht\><<<
% floatrow.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
\def\:tempa#1{}
\HLet\flrow@restyle\:tempa
\Hinput{floatrow}
\endinput
>>>  \AddFile{9}{floatrow}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Index and Glossary}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltidxglo.dtx]{}{}ltidxglo.dtx\EndLink

The index part is defined in latex.ltx, loaded by \''\makeindex', and
can be overridden elsewhwere (e.g., in  index.sty). The case is
similar for make glossary.

\<control @\><<<
\def\#{\string\#}%
>>>

Within the source, we have a definition \''\chardef\#=`\#' which
in immediate environment has the meaning of \''\#' and in regular envirionment
the meaning of \''\chat`\#'.

\<latex ltidxglo\><<<
\NewConfigure{wrindex}[1]{\concat:config\a:wrindex{#1}}
\let\a:wrindex\empty
\expandafter\ifx \csname @indexfile\endcsname\relax \else
   \let\o:wrindex:|=\@wrindex
   \DeclareRobustCommand\@wrindex{\a:wrindex \o:wrindex:}
   \Configure{wrindex}
      {|<control @|>\warn:idx{\jobname}%
       \:wribefr\@indexfile}
\fi
\ifx \@glossaryfile\:UndDef \else
   \let\:wrglossary|=\@wrglossary
   \def\@wrglossary{\:wribefr\@glossaryfile\:wrglossary}
\fi
\def\:wribefr#1{\title:chs{\html:addr  
   \hbox{\Link-{}{|<index haddr|>}\EndLink}}{}%
   \edef\:temp{\write#1{\expandafter\string\a:idxmake{\RefFileNumber
      \FileNumber}{\title:chs {|<index haddr|>}{\cur:th
      \:currentlabel}}{\a:makeindex}}}\:temp}
\ifx \a:makeindex\:UnDef
   \NewConfigure{makeindex}{1} \Configure{makeindex}{}
\fi
\ifx \beforeentry\:UnDef \def\beforeentry#1#2{}   \fi
\NewConfigure{idxmake}{1}
\Configure{idxmake}{\beforeentry}
>>>

Without the \''\hbox' we have sometimes a problem. Why?

% \<latex ltidxglo\><<<
% \pend:def\index{\bgroup\let\@bsphack\empty \let\@esphack\empty}
% \append:defI\@index{\egroup}
% >>>

The index command expandas to
\Verb+\begingroup \@sanitize \@wrindex+
and changes catcodes within \Verb+\@sanitize+.  The \Verb+\:wrindex+
needs to be careful with catcodes changes to avoid errors.  For instance, 
a spacefactor in the following at oolatex

\Verbatim
\documentclass[12pt]{article}  
\usepackage{makeidx}     
\makeindex  
\begin{document}  
\index{Hola: Hallo} Hola  
\printindex                       
\end{document}  
\EndVerbatim

or braces in the following for htlatex.

\Verbatim
\documentclass{article}  
\usepackage[frenchb]{babel}  
\usepackage{makeidx}  
\makeindex  
  
\begin{document}  
\begin{itemize}  
\item \index{blabla} blabla  
\item blabla  
\end{itemize}  
\end{document}  
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{theindex}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\Verbatim
latex foo
 makeindex -o foo.ind testindex.idx
 latex foo
\EndVerbatim

\<config book-report-article utilities\><<<
|<book-report-article idx|>
>>>

\<book-report-article idx\><<<
\long\def\c:theindex:#1#2#3#4#5#6#7#8#9{%
   \def\theindex{\SaveEverypar\ht:everypar{}#1%
      \def\idx:item{}%
      \def\endtheindex{\idx:item#2\RecallEverypar}%
      \def\item{\idx:item\def\idx:item{#4}\let\index|=\@gobble #3}%
      \def\subitem{\idx:item\def\idx:item{#6}\let\index|=\@gobble #5}%
      \def\subsubitem{\idx:item\def\idx:item{#8}\let\index|=\@gobble #7}}%
   \def\indexspace{\idx:item#9\let\idx:item|=\empty}}
|<theindex warning|>
\Configure{@begin}{theindex}{\ind:defs}
>>>

The following was in \`'\theinsex'

\Verbatim
      \ifx \idx:item\:UnDef 
         \ifx \LNK\:UnDef 
           \ifx \LNKno\:UnDef 
             \ifx \@indexfile\:UndDef \else
                \warn:idx{\jobname}%
      \fi\fi \fi \fi
\EndVerbatim

\<theindex warning\><<<
\def\warn:idx#1{%
  \expandafter\ifx \csname #1warn:idx\endcsname\relax
     \expandafter\global
         \expandafter\let \csname #1warn:idx\endcsname|=\def
     \writesixteen
        {---------------------------------------------------------}%
     \:warning{If not done so, the index is to be processed by
      ^^J\space\space tex '\string\def\string\filename
         {{#1}{idx}{4dx}{ind}} \noexpand\input\space idxmake.4ht'
      ^^J\space\space  makeindex -o #1.ind #1.4dx
      ^^Jinstead of
      ^^J\space\space  makeindex -o #1.ind #1.idx  
      ^^JOn some platforms, the quotation marks ' should be 
      ^^J      replaced by double quotation marks " or eliminated.
      ^^J---------------------------------------------------------
     }%
     {\Configure{Needs}{File: #1.4idx}\Needs{}}%
  \fi}
>>>

\<index 4.1beta warning\><<<
\def\warn:idx#1{%
  \expandafter\ifx \csname #1warn:idx\endcsname\relax
     \expandafter\global
         \expandafter\let \csname #1warn:idx\endcsname|=\def
     \:warning{If not done so, the index is to be processed by
      ^^J\space\space tex '\string\def\string\filename
         {{\jobname}{|<index 4.1beta ext I|>}{4dx}%
          {|<index 4.1beta ext II|>}} \noexpand
             \input\space idxmake.4ht'
      ^^J\space\space  makeindex -o 
         \jobname.|<index 4.1beta ext II|>\space \jobname.4dx
      ^^Jinstead of
      ^^J\space\space  makeindex -o
         \jobname.|<index 4.1beta ext II|>\space
         \jobname.|<index 4.1beta ext I|>%
      ^^JOn some platforms, the quotation marks ' should be 
      ^^J      replaced by double quotation marks " or eliminated.
     }%
     {\Configure{Needs}{File: #1.4idx}\Needs{}}%
  \fi}
>>>

\<splitidx warning\><<<
\def\warn:idx#1{%
  \expandafter\ifx \csname #1warn:idx\endcsname\relax
     \expandafter\global
         \expandafter\let \csname #1warn:idx\endcsname|=\def
     \:warning{If not done so, the index is to be processed by
      ^^J\space\space tex '\string\def\string\filename
         {{#1}{idx}{4dx}{ind}} \noexpand\input\space idxmake.4ht'
      ^^J\space\space  move #1.4dx #1.idx
      ^^Jbefore invoking
      ^^J\space\space  splitindex #1.idx  
      ^^JOn some platforms, the quotation marks ' should be 
      ^^J      replaced by double quotation marks " or eliminated.
     }%
     {\Configure{Needs}{File: #1.4idx}\Needs{}}%
  \fi}
>>>

\<theindex warning\><<<
\ifOption{info}{\Log:Note{
A script of the form
^^Jtex '\def\string\filename{{\%\%1}{idx}{4dx}{ind}} 
                                       \string\input\space  idxmake.4ht'
^^Jmakeindex -o \%\%1.ind \%\%1.4dx
^^Jin the env file, automatically calls to the revised makeindex
^^Jcommand.  An extra compilation of the source LaTeX file is required,
^^Jto get the index correctly into the output.}}{}
>>>

\<doc warning\><<<
\def\warn:idx#1{%
  \expandafter\ifx \csname #1warn:idx\endcsname\relax
     \expandafter\global
         \expandafter\let \csname #1warn:idx\endcsname|=\def
     \:warning{If not done so, the index is to be processed by
      ^^J\space\space tex '\string\def\string\filename
         {{#1}{idx}{4dx}{ind}} \noexpand\input\space idxmake.4ht'
      ^^J\space\space  makeindex -s #1.ist -o #1.ind #1.4dx
      ^^Jinstead of
      ^^J\space\space  makeindex -s #1.ist -o #1.ind #1.idx  
      ^^JOn some platforms, the quotation marks ' should be 
      ^^J      replaced by double quotation marks " or eliminated.
     }%
     {\Configure{Needs}{File: #1.4idx}\Needs{}}%
  \fi}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{makeidx}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<makeidx.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% makeidx.4ht                          |version %
% Copyright (C) |CopyYear.2002.      Eitan M. Gurari         %
|<TeX4ht copyright|>
\pend:defII\see{\a:see}
\append:defII\see{\b:see}
\NewConfigure{see}{2}
\Hinput{makeidx}
\endinput
>>>        \AddFile{9}{makeidx}

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{splitidx.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<splitidx.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% splitidx.4ht                         |version %
% Copyright (C) |CopyYear.2003.      Eitan M. Gurari         %
|<TeX4ht copyright|>
|<splitidx configs|>
\Hinput{splitidx}
\endinput
>>>        \AddFile{9}{splitidx}

\<splitidx configs\><<<
|<splitidx warning|>
\pend:defII\@@@wrsindex{%
   \if@splitidx
      \warn:idx{##1}%
      \@ifundefined{@indexfile@##1}{}{\html:addr
              \hbox{\Link-{}{|<index haddr|>}\EndLink}%
      \edef\:temp{\expandafter
         \write\csname @indexfile@##1\endcsname{\expandafter
           \string\a:idxmake{\RefFileNumber
           \FileNumber}{|<index haddr|>}{\a:makeindex}}}\:temp}%
   \else
      \warn:idx{\jobname}%
      \html:addr \hbox{\Link-{}{|<index haddr|>}\EndLink
      \edef\:temp{%
         \write\@indexfile{\expandafter\string\a:idxmake{\RefFileNumber
           \FileNumber}{|<index haddr|>}{\a:makeindex}}}\:temp}%
   \fi
}
\ifx \a:makeindex\:UnDef
   \NewConfigure{makeindex}{1} \Configure{makeindex}{}
\fi
>>>

% \def\printindex#1#2{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
%  {\def\indexname{#2}\@input{#1.ind}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{External Processing of Index File (idxmake.4ht)}
%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Shared}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<theindex warning\><<<
\def\ind:defs{\let\LNKidx\empty
   \def\LNK##1##2##3##4{\ifx\NewConfigure\:UnDef\else
        \def\LNK:number{##4}%
        \a:LNK[##1]{##2}{}\gHAdvance\:LNKno1
           \def\:THIrd{##3}\ifx\:THIrd\empty
              \LNKidx{\ifx\c:LNK\empty\:LNKno\else \c:LNK\fi}\else
              \LNKidx{##3}\fi
           \global\let\LNKidx\empty
        \b:LNK
      \fi}%
   \def\:LNKno{0}}
\NewConfigure{LNK}{3}
\Configure{LNK}{\Link}{\EndLink}{}
>>>

A `=' in \'+\let\LNKidx=+ is harmful.

\<open 4dx output files\><<<
\newwrite\idx
\newwrite\indexes
\def\MakefileIn#1#2#3#4{#1.#3}
\def\MakefileIndexes#1#2#3#4{#1.4ix}
\immediate\openout\idx=\expandafter\MakefileIn\filename\relax
\immediate\openout\indexes=\expandafter\MakefileIndexes\filename\relax
>>>

\<close 4dx output files\><<<
\immediate\closeout\idx
\immediate\closeout\indexes
>>>

\<idxmake.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% idxmake.4ht                          |version %
% Copyright (C) |CopyYear.2000.      Eitan M. Gurari         %
|<TeX4ht copyright|>

\def\SourceInd#1#2#3#4{#1.#2}
\def\MakefileInd#1#2#3#4{#1.#4}

\newcount\cnt
\newtoks\split

\def\noXcatcodes{%
   \cnt=0
   \def\noXXcatcodes{%
      \catcode\cnt12
      \ifnum\cnt<255
          \advance\cnt  1  \expandafter\noXXcatcodes
      \fi }%
   \noXXcatcodes }

|<open 4dx output files|>
\def\beforeentry#1#2#3#4{
   \def\file{#1}\def\anchor{#2}\def\pointer{#3}\def\indexentry{\string#4}
   \begingroup   \noXcatcodes
     \catcode`\s=11 \catcode`\e=11 `%for \see`%
     \catcode`\^^M=10    \catcode`\ =10    \catcode`\^^I=10
     \catcode`\{=1 \catcode`\}=2 \futurelet\next\preGetentries
}
\def\bparent#1||(#2|<par del|>{\def\core{#1}\def\parent{#2}}
\def\eparent#1||)#2|<par del|>{\def\core{#1}\def\parent{#2}}
\def\see#1||see#2||see#3|<par del|>{\def\preSee{#1}\def\isSee{#2}}
|<regular index|>
|<reverse index|>
\input \expandafter\SourceInd\filename\relax
|<close 4dx output files|>

\bye
\endinput
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Reverse Index}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<reverse index\><<<
\newcount\GetentriesN
\GetentriesN=0
\def\indexentry{\string\indexentry}
\def\Ganchor{\ifnum \GetentriesN<10 0\fi
  \ifnum \GetentriesN<100 0\fi
  \ifnum \GetentriesN<1000 0\fi
  \the\GetentriesN}
\def\Beforeentry{\let\getentries=\Getentries
   \let\Beforeentry=\beforeentry \Beforeentry}
\def\Getentries#1#2{\endgroup
   \advance\GetentriesN by 1
   \let\parent=\empty
   \bparent#1||(|<par del|>\ifx \parent\empty
      \eparent#1||)|<par del|>\ifx \parent\empty
        \see#1||see||see|<par del|>%
        \ifx \isSee\empty |<no see entry|>%
        \else             |<yes see entry|>\fi
      \else
        \immediate\write\idx{\indexentry\the\split{%
           |<alt ind nun|>\string\erange{\csname \core||(\endcsname}
           \core|<alt ind nun|>\string\comNum}{#2}}%
      \fi
   \else
        \immediate\write\idx{\indexentry\the\split{%
           |<alt ind nun|>\string\brange{\Ganchor}
           \core|<alt ind nun|>\string\comNum}{#2}}%
        \expandafter\edef\csname \core||(\endcsname{\Ganchor}%
   \fi
}
>>>

\<no see entry\><<<
\immediate\write\idx{\indexentry\the\split{%
           |<alt ind nun|>%
   #1|<alt ind nun|>\string\comNum}{#2}}%
>>>

\<yes see entry\><<< 
\immediate\write\idx{\indexentry\the\split{%
   {\Ganchor}%
   \preSee\string\gobble||see{\isSee}}{#2}}%
>>>

We want two references to the index numbers like in
\`'\indexentry{\indNum{0006}...\indNum{0006}\comNum}{1}' because the \`'\item
\indNum{0006}...\indNum{0006}\comNum' sometimes appear as
\`'\item...\indNum{0006}\comNum' with the first index being lost due
to `@' entries \`'\index{...@...}'.

\<alt ind nun\><<<
\string\indNum{\Ganchor}%
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Regular Index}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<regular index\><<<
\newcount\entryNum
|<split index|>
\def\getentries#1#2{\endgroup
   \advance\entryNum by 1 
   \let\parent=\empty
   \bparent#1||(|<par del|>\ifx \parent\empty  
      \eparent#1||)|<par del|>\ifx \parent\empty   
        |<non-regular index|>%
      \else
        \immediate\write\idx{\indexentry\the\split{%
          \core||LNK\csname \core||(\endcsname
          --\string\LNK{\file}{\anchor}{\pointer}}{|<entry num|>}}%
        \immediate\write\indexes{\string \indexmark\the\split{% 
          \core}{|<entry num|>}}%
      \fi
   \else
      \expandafter\edef\csname \core||(\endcsname
          {{\file}{\anchor}{\pointer}{|<entry num|>}}%
   \fi
}
>>>

We replace the page numbers to avoid foeign material there, like spaces in
case of roman numbers, introduced by tex4ht.  It also protects from
duplicate entries in a given page,  desliked by makeindex.  

\<entry num\><<<
\the\entryNum
>>>

% \ifx\chapter\:UnDef \expandafter\section
%          \else \expandafter\chapter \fi *{\indexname}
% \idx:item

The \''\hasBar' probably  removes the need for treating \''\see' and 
\''\seealso' macros.

\<non-regular index\><<<
\see#1||see||see|<par del|>%
\ifx \isSee\empty
   \hasBar#1|||<par del|>{#1}{#2}%
\else
   \immediate\write\idx{\indexentry\the\split{%
     \preSee||see{\string\LNK{\file}{\anchor}{\isSee}{}}}{|<entry num|>}}%
   \immediate\write\indexes{\string \indexmark\the\split{% 
     \preSee}{|<entry num|>}}%
\fi
>>>

\<regular index\><<<
\def\hasBar#1||#2|<par del|>#3#4{%
   \def\temp{#2}\ifx \temp\empty
      \immediate\write\idx{\indexentry\the\split{% 
         #3||LNK{\file}{\anchor}{\pointer}}{|<entry num|>}}%
      \immediate\write\indexes{\string \indexmark\the\split{% 
         #3}{|<entry num|>}}%
   \else \yeshasBar#3|<par del|>{|<entry num|>}\fi
}
\def\yeshasBar#1||#2|<par del|>#3{%
   \immediate\write\idx{\indexentry\the\split{% 
       #1||yhbLNK{#2}{\file}{\anchor}{\pointer}}{|<entry num|>}}%
   \immediate\write\indexes{\string \indexmark\the\split{% 
       #2}{|<entry num|>}}%
}
>>>

\<theindex warning\><<<
\def\yhbLNK#1{\expandafter\let\expandafter\LNKidx\csname
          #1\endcsname\LNK}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Split Index}
%%%%%%%%%%%%%%%%%%%%%%%%%%

Assumes  the extra `[...]' argument in 
\`'\indexentry[...]{...}{...}'

\<split index\><<<
\def\preGetentries{\ifx [\next \expandafter\opGetentries
  \else \global\split={}\expandafter\getentries\fi}
\def\opGetentries[#1]{\global\split={[#1]}\getentries}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{????}
%%%%%%%%%%%%%%%%%%%%%%%%%%

Tables in two columns.

\Verbatim
\Configure{theindex}
   {\Columns[WIDTH="100\%",VALIGN="TOP"]{2}} {\EndColumns}
   {\idx:tbl}  {\endidx:tbl}
   {\idx:tbl\idx:sub}  {\endidx:tbl}
   {\idx:tbl\idx:sub\idx:sub}  {\endidx:tbl}
   {\hbox{\HCode{<P>}}}
\def\idx:tbl{\hbox\bgroup\HCode{<TABLE \:zbsp{theindex}><TR
   CLASS="theindex"><TD CLASS="theindex">}}
\def\endidx:tbl{\HCode{</TD></TR></TABLE>}\egroup}
\def\idx:sub{\ \HCode{</TD><TD CLASS="theindexsub">}}
\EndVerbatim

Redifine \''\index' and \''\glossary' to add the \`'\beforeentry{file
name}{tag}' before each \''\indexentry' and each \''\glossaryentry',
with default definition for \''\beforeentry' to eat its fields and do
nothing. 

In addition, The command inserts a tag at the file. To get a
pointer to the file, all we need to insert te redefinition
\`'\def\beforeentry#1#2#3#4{#3{\Link[#1]{#2}{}#4\EndLink}}' which puts
the link on the page number (for whatever the page number is good, or
replaces it with another mark).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{/LoadLabels for imports}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<html latex coauthor\><<<
\def\LoadLabels{\@ifnextchar[{\LD:lbls}{\LD:lbls[]}}
\def\LD:lbls[#1]#2{%
   |<load xrefs for Link|>%
   {\let\bibdata|=\@gobble
    \def\@newl@bel##1##2{\:newl@bel{##1}{#1##2}}%
    \let\@writefile\@gobbletwo
    \catcode`\@|=11       \get:input{#2.aux}%
    \catcode`\@|=12  }}
>>>

\''\newlabel' already given in LaTeX

\<load xrefs for Link\><<<
\if !#1!%
   \ld:flxrf{#2}{}%
\else
   \LoadRef-[)F]{#2}{)F#1##1}%
   \LoadRef-[)Q]{#2}{)Q#1##1}%
\fi
>>>

\<html latex coauthor\><<<
\def\RefLabel#1#2{{%
   \Configure{XrefFile}{#1}%
   \def\file:id{-1}%
   \ref{#1#2}}}
>>>

The above doesn't work always.  Try

*** filea.tex ***

\Verbatim
\documentclass{article}

\usepackage{tex4ht}

\begin{document}   \LoadLabels{fileb}

\section{a...a}    \ref{x}             \end{document}
\EndVerbatim

*** fileb.tex ***

\Verbatim
\documentclass{article}

\usepackage{tex4ht}

\begin{document}

\section{b...b}    \label{x}          \end{document}
\EndVerbatim

%%%%%%%%%%%%%%%%%%
\Section{Glossaries}
%%%%%%%%%%%%%%%%%%

\<glossaries.4ht\><<<
% glossaries.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2008. Eitan M. Gurari
|<TeX4ht copywrite|>
|<config glossaries|>
|<index in glossary|>
\Hinput{glossaries}
\endinput
>>>        \AddFile{6}{glossaries}

\<config glossaries\><<<
\def\:tempc#1#2{\Link{#1}{}#2\EndLink}  
\HLet\@glslink\:tempc
\def\:tempc#1#2{\Link{}{#1}\EndLink#2}
\HLet\@glstarget\:tempc
\def\:tempc#1 #2\@nil{% 
 \toks@=\expandafter{\the\toks@#1}% 
 \ifx\\#2\\% 
   \edef\x{\the\toks@}% 
   \ifx\x\empty 
   \else 
%     \hyperlink{\glsentrycounter.\the\toks@}%
                {\the\toks@}% 
   \fi 
 \else 
   \@gls@ReturnAfterFi{% 
     \@gls@removespaces#2\@nil 
   }% 
 \fi 
} 
\HLet\@gls@removespaces\:tempc
>>>

This should fix wrong handling of paragraphs in glossary.
The problem is that extra paragraph is inserted
when a new letter is started.

\<index in glossary\><<<
\Configure{@begin}{theglossary}{
  \Configure{theindex}{}{}{}{}{}{}{}{}{}{}
  \def\idx:item{\SaveEverypar\ht:everypar{}}
  \let\end:theidx\empty
}
>>>

%%%%%%%%%%%%%%%%%%
\Section{Glossary}
%%%%%%%%%%%%%%%%%%

\<glossary.4ht\><<<
% glossary.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2005. Eitan M. Gurari
|<TeX4ht copywrite|>
|<config glossary|>
\Hinput{glossary}
\endinput
>>>        \AddFile{6}{glossary}

\<config glossary\><<<
\def\glosslabel#1{\Link{}{#1}\EndLink} 
\def\glossref#1#2{\Link{#1}{}#2\EndLink}
>>>

The above are problematic when spaces are present.

\Verbatim
\documentclass{report} 
 
\usepackage{glossary} 
 
\makeglossary 
 
\begin{document} 
 
\printglossary 

\glossary{name=a b,description=c} 
 
\end{document} 
\EndVerbatim

\<config glossary\><<<
\Configure{@begin}{theglossary}{\ind:defs}
|<theglossary warning|>
refextract\warn:gls{\jobname}
>>>

\<theglossary warning\><<<
\def\warn:gls#1{%
  \expandafter\ifx \csname #1warn:glo\endcsname\relax
     \expandafter\global
         \expandafter\let \csname #1warn:glo\endcsname|=\def
     \writesixteen
        {---------------------------------------------------------}%
     \:warning{If not done so, the glossary is to be processed by
      ^^J\space\space tex '\string\def\string\filename
         {{#1}{glo}{4dx}{gls}} \noexpand\input\space idxmake.4ht'
      ^^J\space\space  makeindex -o #1.gls -s #1.ist #1.4dx
      ^^Jinstead of
      ^^J\space\space  makeindex -o #1.gls -s #1.ist #1.glo
      ^^JOn some platforms, the quotation marks ' should be 
      ^^J      replaced by double quotation marks " or eliminated.
      ^^J---------------------------------------------------------
     }%
     {\Configure{Needs}{File: #1.4idx}\Needs{}}%
  \fi}
>>>

\<config glossary\><<<
\def\gloskip{\expandafter\ifx\csname gloskip:\gls@style\endcsname\relax
      \indexspace \else \csname gloskip:\gls@style\endcsname\fi} 
\NewConfigure{gloskip}[2]{\expandafter\def\csname gloskip:#1\endcsname{#2}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Bibliography}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{LaTeX}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltbibl.dtx]{}{}ltbibl.dtx\EndLink

\`'\Link' must follow \`'\o:bibitem:'; otherwise it will insert stuff before an \`'\item'.

\<latex ltbibl\><<<
\:CheckOption{no-bib} \if:Option\else
   |<cite in doc to bib|>
   |<listing of bib|>
\fi
>>>

% 
%   \let\:citex=\@citex
%   \def\@citex[#1]#2{\Link{X#2}{}\:citex[#1]{#2}\EndLink}
% 

\<cite in doc to bib\><<<
\ifx \o:@citex:\:UnDef \let\o:@citex:|=\@citex\fi
\catcode`\:=12
\def\@citex[#1]#2{%
  \let\@citea\@empty
  |<a cite|>\@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{,\penalty\@m\ }%
     {|<sub sup cite|>\xdef\@citeb{\expandafter\@firstofone\@citeb}}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
       \G@refundefinedtrue
       \@latex@warning
         {Citation `\@citeb' on page \thepage \space undefined}}%
       {{|<link cite|>\csname b@\@citeb\endcsname
         |<end link cite|>}}}}{#1}|<b cite|>}
\catcode`\:=11
>>>

\<a cite\><<<
\csname a:cite\endcsname
>>>

\<b cite\><<<
\csname b:cite\endcsname
>>>

\<link cite\><<<
\cIteLink {X\@citeb}{}%
>>>

\<end link cite\><<<
\EndcIteLink
>>>

\<sub sup cite\><<<
\SUBOff \SUPOff
>>>

Was \''\x:SUBOff \x:SUPOff'--any problems?

Had to remove \''\hbox' from \`'{\cIteLink {X\@citeb}{}\csname
            b@\@citeb\endcsname\EndcIteLink}' because it created 

The following is treated in a similar manner to ref.

\<latex ltbibl\><<<
\NewConfigure{cite}[4]{\c:def\a:cite{#1}\c:def\b:cite{#2}%
   \d:def\cIteLink{#3}\ifx \cIteLink\empty 
      \let\cIteLink|=\:gobbleII\fi \c:def\EndcIteLink{#4}}
\Configure{cite}{}{}{}{}
>>>

\<latex ltbibl\><<<
\:CheckOption{bibtex2} \if:Option
   \expandafter\def\csname bibliography2\endcsname{\csname
         a:bibliography2\endcsname
      \Link{YX\b:blabel}{}\csname b:bibliography2\endcsname
      \EndLink \csname c:bibliography2\endcsname}%
   \let\bibitem:ii\@bibitem
   \def\@bibitem#1{\bibitem:ii{#1}\def\b:blabel{#1}}
   \let\lbibitem:ii=\@lbibitem
   \def\@lbibitem[#1]#2{\lbibitem:ii[#1]{#2}\def\b:blabel{#2}}
   \let\bibliography:ii=\bibliography
   \def\bibliography#1{%
      \let\bibliography=\bibliography:ii
      {\bibliography{#1}}
      \bgroup
         \ConfigureEnv{thebibliography}{}{}{}{}
         \ConfigureList{thebibliography}
            {\let\en:bib=\empty}
            {\en:bib}
            {\en:bib
             \def\en:bib{\csname b:bibitem2\endcsname\EndHPage{}}%
             \HPage{}\csname a:bibitem2\endcsname
            }
            {\csname c:bibitem2\endcsname}
         \def\section##1##2{}
         \Configure{bibanchor}{YX}
         \@fileswfalse
         \@input@{\jobname j.bbl}%
      \egroup
   }
   \NewConfigure{bibliography2}{3}
   \NewConfigure{bibitem2}{3}
   |<bib2 warning|>
   |<create aux j|>
\fi
>>>

The \`'\bibliography{#1}'  may have \''\newcommand' instructions. Hnce,
to avoid complaints about redefined commands, we  put \`'\bibliography{#1}' within a group.

\<create aux j\><<<
\bgroup
  \catcode`\/=0
  \catcode`\\=12
  /gdef/bib:style{\bibstyle}
  /catcode`/\=0
  /catcode`//=12
\egroup
>>>

\<create aux j\><<<
\bgroup  
  \catcode`\&=12
  \gdef\get:aux{%
    \immediate\read15 to \line
    \ifeof15 \else
       \expandafter\scan:aux\line @@@@@@@@@&&&&
       \expandafter\get:aux
    \fi
  }
  \gdef\put:aux#1&&&&{%
     \immediate\write15{\ifx \first\bib:style
        \expandafter\ifx \csname a:bibliographystyle2\endcsname\empty
             \line \else
             \bib:style{\csname a:bibliographystyle2\endcsname}\fi
       \else  \line\fi}}
\egroup
\def\scan:aux#1#2#3#4#5#6#7#8#9{\def\first{#1#2#3#4#5#6#7#8#9}\put:aux}
\NewConfigure{bibliographystyle2}{1}
\Configure{bibliographystyle2}{}
>>>

\<create aux j\><<<
\def\j:aux{%
  \bgroup
    \immediate\openin15=\jobname .aux
    \ifeof15 \else
      \no:catcodes{0}{255}{12}%
      \no:catcodes{65}{90}{11}%
      \no:catcodes{97}{122}{11}%
      \catcode`\^^M=5
      \immediate\openout15=\jobname j.aux
      \get:aux
      \immediate\write15{}
      \immediate\closeout15
      \immediate\closein15
    \fi
  \egroup
}
\append:def\@enddocumenthook{%
  \let\:dofilelist=\@dofilelist
  \def\@dofilelist{%
     \let\@dofilelist=\:dofilelist
     \j:aux \@dofilelist}}
>>>

\<bib2 warning\><<<
\:CheckOption{bibtex2} \if:Option
   \Log:Note{Option `bibtex2' requires
      compilation of `\jobname j.aux' with bibtex.}   
   \immediate\write-1{ Employ \string\Configure{bibliographystyle2}{...} 
     to change the bibliography style.}
\else
   \Log:Note{for 2 levels bibtex bibliography,
        use the command line option `bibtex2'}
\fi
>>>

%\def\bibitem{\@ifnextchar[\@lbibitem\@bibitem}
%\def\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\if@filesw
%      {\let\protect\noexpand
%       \immediate
%       \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
%\def\@bibitem#1{\item\if@filesw \immediate\write\@auxout
%       {\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces}
%

\<listing of bib\><<<
\ifx \o:@lbibitem:\:UnDef \let\o:@lbibitem:|=\@lbibitem\fi
\def\@lbibitem[#1]#2{{\:SUBOff\:SUPOff\edef\:tempb{{#2}}%
   \pend:def\:tempb{\o:@lbibitem:[#1]}%
   \global\let\:temp|=\:tempb}%
   \setb:anc{#2}\:temp\bib:anc \let\AnchorLabel|=\sv:anc\ignorespaces}
>>>

\<listing of bib\><<<
\ifx \o:@bibitem:\:UnDef \let\o:@bibitem:|=\@bibitem \fi
\def\@bibitem#1{{\:SUBOff\:SUPOff\edef\:temp{\noexpand\o:@bibitem:{#1}}%
   \global\let\:temp|=\:temp}\:temp}
\pend:defI\@bibitem{\setb:anc{##1}}
\append:defI\@bibitem{\bib:anc
   \let\AnchorLabel|=\sv:anc \ignorespaces}
>>>

\<book / report / article\><<<
\ifx \@openbib@code\:UnDef \else
 \pend:def\@openbib@code{\labelsep|=\z@}
\fi
>>>

Old versions of latex don't have \`'\@openbib@code' (article 1995/06/26 v1.3g).

\<listing of bib\><<<
\def\setb:anc#1{\let\sv:anc|=\AnchorLabel
   \def\bib:anc{\def\bib:anc{#1}\ifx \bib:anc\empty \else
      \a:bibitem{}{\a:bibanchor#1}\b:bibitem\fi \gdef\bib:anc{}}%
   \def\AnchorLabel{\bib:anc}|<config write bibcite|>}
\NewConfigure{bibitem}{2}
\NewConfigure{bibanchor}{1}
\Configure{bibanchor}{X}
>>>

The option \''/bib' puts the (normally long) keys in a separate lines.

\<config write bibcite\><<<
\let\cite:item=\item
\def\item##1\if@filesw##2\fi{\let\item\cite:item
   \item##1\if@filesw {\a:bibcite ##2}\fi}
>>>

\<listing of bib\><<<
\NewConfigure{bibcite}[1]{\concat:config\a:bibcite{#1}} 
\let\a:bibcite\relax
>>>

%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Chicago}
%%%%%%%%%%%%%%%%%%%%%%

\<chicago.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% chicago.4ht                          |version %
% Copyright (C) |CopyYear.2006.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config chicago|>
\Hinput{chicago}
\endinput
>>>        \AddFile{9}{chicago}

\<config chicago\><<<
\catcode`\:=12
\def\@citedatax[#1]#2{% 
\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi% 
  \def\@citea{}|<a cite|>\@cite{\@for\@citeb:=#2\do% 
    {\@citea\def\@citea{, }\@ifundefined% by Young 
       {b@\@citeb}{{\bf ?}% 
       \@warning{Citation `\@citeb' on page \thepage \space undefined}}% 
        {|<link cite|>\csname b@\@citeb\endcsname
        |<end link cite|>}}}{#1}|<b cite|>}
\catcode`\:=11
>>>

%%%%%%%%%%%%%%%%%%%%%%
\SubSection{For XML}
%%%%%%%%%%%%%%%%%%%%%%

%\<latex def Configure\><<<

\<latex.ltx non trace configurations\><<<
\def\g:let#1#2{\global\let#1|=#1}
>>>

\<latex.ltx latex edit commands\><<<
\def\g:let#1#2{\advance\tmp:cnt |by1
   \ifx \:temp\empty
       \edef\:temp{\noexpand\pend:def\noexpand#1{\noexpand
         \a:trc List(#2)\the\tmp:cnt\noexpand\b:trc}}\:temp
       \edef\:temp{\noexpand\append:def\noexpand#1{\noexpand
         \c:trc List(#2)\the\tmp:cnt\noexpand\d:trc}}\:temp
       \let\:temp|=\empty
   \fi
   \global\let#1|=#1}
>>>

The four parts indicate what should appear at the head, before
each label, after each label, and at the tail of the lists.

In the default setting, the lists that are not referenced through
block-environments are supposed to create no code. We made this choice
because there are many trivial lists that just create
indentation in LaTeX that is undesired in html. The outcome of such
lists would probably have been \`'<DL><DT><STRONG></STRONG><DD>.....</DL>'.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Page styles and related commands}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/base/ltpage.dtx]{}{}ltpage.dtx\EndLink

\SubSection{Fussy and Sloppy}

\<latex ltpage\><<<
\:CheckOption{fussy}  \if:Option  \else
   \def\sloppy{%
     \tolerance 9999%
     \emergencystretch 3em}
   \def\fussy{%
     \emergencystretch\z@
     \tolerance 200}
   \def \@largefloatcheck{%
     \ifdim \ht\@currbox>\textheight
       \@tempdima -\textheight
       \advance \@tempdima \ht\@currbox
       \ht\@currbox \textheight
     \fi
   }
\fi
>>>

\ifHtml[\HPage{more}\Verbatim

>  >> LaTeX Warning: Float too large for page by 1873.00085pt on input line
>
>  > No. It was a mistake of mine.
>
>   Nevertheless, this may be worth looking into a bit. I get two of these
> warnings, and four overfull hbox warnings, when compiling with the htm
> option on.

My fault.

> This is not a big problem, but it is a bit annoying because
> it forces me to look closely if perhaps an important warning is hidden
> inbetween. Maybe, since for the HTML output the pagesize is irrelevant,
> it is possible to have TeX4ht set the pagesize to a very large
> value?

This can cause too much burdun on TeX as far as resources are
concerned.  Instead TeX4ht sets the lines and spaces to flexible
dimensions, and  hides the warning messages from the users.

You can turn the overfull warning messages on with the `fussy' option
of \Preamble.  So far I never found this option to be useful,
and I suspect that the only place it can become useful is when
dvi pictures overflow the page dimensions.

fussy option in \Preamble to see box overlows.  Typically, this
messages are irrelevant.

>  >> LaTeX Warning: Float too large for page by 1873.00085pt on input line
>
>  > No. It was a mistake of mine.
>
>   Nevertheless, this may be worth looking into a bit. I get two of these
> warnings, and four overfull hbox warnings, when compiling with the htm
> option on.

My fault.

> This is not a big problem, but it is a bit annoying because
> it forces me to look closely if perhaps an important warning is hidden
> inbetween. Maybe, since for the HTML output the pagesize is irrelevant,
> it is possible to have TeX4ht set the pagesize to a very large
> value?

This can cause too much burdun on TeX as far as resources are
concerned.  Instead TeX4ht sets the lines and spaces to flexible
dimensions, and  hides the warning messages from the users.
\EndVerbatim\EndHPage{}]\fi

 
LaTeX offers the following definitions.

\Verbatim
\def\sloppy{%
  \tolerance 9999%
  \emergencystretch 3em%
  \hfuzz .5\p@
  \vfuzz\hfuzz}
\def\fussy{%
  \emergencystretch\z@
  \tolerance 200%
  \hfuzz .1\p@
  \vfuzz\hfuzz}
\def \@largefloatcheck{%
  \ifdim \ht\@currbox>\textheight
    \@tempdima -\textheight
    \advance \@tempdima \ht\@currbox
    \@latex@warning {Float too large for page by \the\@tempdima}%
    \ht\@currbox \textheight
  \fi
}
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

For center, flushleft, and flushright we don't want identation, so we
can't use tables for separating from above and below. Similarly is the
case for tabbing and verbatim, but they get separate treatment.

In TeX4ht, \''\begin{...}' and \''\end{...}' are redefined
to \''\SaveEverypar\begin{...}' and \''\end{...}\RecallEverypar' 
so it is pointless to directly deal with paragraph breaks 
and saving.  Since the saving and recalling are global
operations (in a pushdown fashion), the above
redefine the saved environment to eliminate 
paragraph breaks after the environment.

WE HAVE here a problem if someone goes directly, e.g., for
\''\quotation...\endquotation' instead of 
\''\begin{quotation}...\end{quotation}'. On the other hand, 
LaTeX doesn't mention the first case as an option.

\ifHtml[\HPage{test data}\Verbatim
\documentstyle{article}

\title{Essential \LaTeX}
\author{Jon Warbrick}

\input tex4ht.sty \Preamble{html,fonts}
        \begin{document}
     \EndPreamble

 \maketitle

\def\HR{\HCode{<HR>}}

\HR====== verse 

\begin{verse}
Gertjan Klein\\
Postbus 23656
\end{verse}

\HR====== quote

\begin{quote}
The buck stops here.

The buck stops here.
\end{quote}

\HR====== flushleft/flushright

We can stop \LaTeX\ from justifying each line to both the
left and the right margins.
\begin{flushright}
The {\tt flushright} environment is\\
used for text with an even right margin\\
and a ragged left margin.
\end{flushright}
\begin{flushleft}
and the {\tt flushleft} environment is\\
used for text with an even left margin\\
and a ragged right margin.
\end{flushleft}

\HR====== quote center/flushleft/flushright  

\begin{quote}
The buck stops here. The buck stops here. The buck stops here. 
The buck stops here. 
\begin{center}1\\123\\12345\end{center}
\begin{flushleft}1\\123\\12345\end{flushleft}
\begin{flushright}1\\123\\12345\end{flushright}
\end{quote}

\HR====== quote center/flushleft/flushright  par

\begin{quote}
The buck stops here. The buck stops here. The buck stops here. 
The buck stops here. 

\begin{center}1\\123\\12345\end{center}
\begin{flushleft}1\\123\\12345\end{flushleft}

\begin{flushright}1\\123\\12345\end{flushright}
\end{quote}

\HR======  quote tabbing

\begin{quote}\begin{tabbing}
\verb|\subsubsection| \= \verb|\subsubsection|~~~~~~~~~~ \=           \kill
\verb|\chapter|       \> \verb|\subsection|    \> \verb|\paragraph|    \\
\verb|\section|       \> \verb|\subsubsection| \> \verb|\subparagraph| \\
\end{tabbing}\end{quote}

\HR====== quote verbatim

\begin{quote}\begin{verbatim}
\command{text}  xx
yy
\end{verbatim}\end{quote}

\end{document}

\EndVerbatim\EndHPage{}]\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{LaTeX Accents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Handles accents that reach \''\add@accent'. Currently just empty
bases?

\<latex ltoutenc\><<<
\def\:tempc#1#2{\expandafter
   \ifx \csname accent \cf@encoding :#1\endcsname\relax 
      \o:add@accent:{#1}{#2}%
   \else \def\:temp{\add:accent{#1}{#2}}%
      \expandafter\expandafter\expandafter\:temp
      \csname accent \cf@encoding :#1\endcsname{}{}|<par del|>\fi }
\HLet\add@accent\:tempc
\def\add:accent#1#2#3#4{%
   \def\:temp{#3#4}\ifx \:temp\empty
      \o:add@accent:{#1}{#2}%
      \expandafter\expandafter\expandafter\gob:pardel
   \else \def\:temp{#2}\def\:tempa{#3}\ifx \:temp\:tempa
          #4\expandafter\expandafter\expandafter\gob:pardel
       \else 
          \expand:after{\expand:after{\add:accent{#1}{#2}}}%
   \fi \fi }
\def\gob:pardel#1|<par del|>{}
>>>

\<latex ltoutenc\><<<
\NewConfigure{add accent}[3]{%
  \expandafter\ifx \csname accent #1\endcsname\relax
     \expandafter\let\csname accent #1\endcsname=\empty
  \else \def\:temp{#2#3}\ifx \:temp\empty
     \expandafter\let\csname accent #1\endcsname=\empty
  \fi \fi 
  \expandafter\scan:accents\csname accent #1\endcsname{#2}{#3}%
  }
\def\scan:accents#1#2#3{\def\:temp{#2#3}\ifx \:temp\empty\else
    \append:def#1{{#2}{#3}}\expand:after{\scan:accents#1}%
  \fi}
>>>

The first argument should be an encoding:accent-number pair.

\Verbatim
     \Configure{add accent}{OT4:18}   
       {E}{\add:acc{00C8}}  
       {e}{\add:acc{00E8}}  
       {}{}   
\EndVerbatim 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Output Routine}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://mirror.ctan.org/macros/latex/base/ltoutput.dtx]{}{}ltoutput.dtx\EndLink

\SubSection{Head and Foot Lines}

\<latex ltoutput\><<<
\pend:def\@outputpage{\let\@oddhead=\empty \let\@oddfoot=\empty
  \let\@evenhead=\empty \let\@evenfoot=\empty }
>>>

\<latex ltoutput\><<<
\pend:def\newpage{%
   \@noskipsectrue
   \if@nobreak \@nobreakfalse \ht:everypar{\HtmlPar}\fi 
   \a:newpage
}
\NewConfigure{newpage}{1}
>>>

\<latex ltoutput\><<<
\pend:def\clearpage{% 
  \bgroup
     \Configure{newpage}{}%
}
\append:def\clearpage{% 
  \egroup
} 
>>>

\Verb+\clearpage+ has  a \Verb+\vtop{}+ in its body.

\<latex ltoutput\><<<
\pend:def\clearpage{\IgnorePar}
>>>

\<latex ltsect\><<<
\let\:xsect|=\@xsect
\def\@xsect#1{\:xsect{0ex}}
\append:def\@afterheading{\everypar{\HtmlPar}}
\let\@svsechd\empty
>>>

The above is needed for taking care of inserting lost paragraph breaks 
at top of pages. Can't put \''\def\@noskipsecfalse{\@noskipsectrue}'; it 
is a problem for titlesec.

The need to initialize   \''\@svsechd' arises in

\Verbatim
\documentclass{prosper}
\begin{document}
 \begin{slide}{}
    \section*{aaa}
 \end{slide}
\end{document}
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Utilities}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{TO BE ORGANIZED}
\Section{Non-classified LaTeX************************}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<more html latex\><<<
\NewConfigure{InsertTitle}{1}
\NewConfigure{AfterTitle}{1}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{srcltx.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<srcltx.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% srcltx.4ht                           |version %
% Copyright (C) |CopyYear.2002.      Eitan M. Gurari         %
|<TeX4ht copyright|>
\ifx \originalxxxeverypar\:UnDef
   |<config srcltx|>
\else
   |<srcltx 1999|>
\fi
\Hinput{srcltx}
\endinput
>>>        \AddFile{9}{srcltx}

\<srcltx 1999\><<<
\let\ht:everypar\originalxxxeverypar
>>>

\<config srcltx\><<<
\:warning{disabling SRCOK}%
\SRCOKfalse
\let\SRCOKtrue=\relax
\ifx \src@new@everypar \:UnDef 
   |<pre 2004 srcltx|>
\else 
   \let\everypar\src@new@everypar 
   \let\ht:everypar\everypar
\fi
\def\src@@include#1{\let\include\src@include
   \let\src@include\:UnDef \let\src@@include\:gobble \include}
\def\src@@@input#1{\let\input\src@input 
   \let\src@input\:UnDef \let\src@@@input\:gobble \input}
\def\:temp#1\expandafter\src@spec#2|<par del|>{\everymath{#1}}
\expandafter\:temp \the\everymath\expandafter\src@spec |<par del|>
\def\:temp#1\expandafter\src@spec#2|<par del|>{\everypar{#1}}
\expandafter\:temp \the\everypar\expandafter\src@spec |<par del|>
\def\src@@bibliography#1#2{\src@bibliography{#2}}
>>>

\<pre 2004 srcltx\><<<
\ifx \src@everypar\:UnDef \else
   \let\everypar\src@everypar
   \let\ht:everypar\everypar
\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{emulateapj.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<emulateapj.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% emulateapj.4ht                       |version %
% Copyright (C) |CopyYear.1999.      Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config emulateapj.clo utilities|>
|<config emulateapj.clo shared|>
\Hinput{emulateapj}
\endinput
>>>        \AddFile{9}{emulateapj}

\<config emulateapj.clo shared\><<<
\def\make@slugcomment{\ifx\@submitted\@empty\relax\else
   \a:slugcomment\hbox{\@submitted}\b:slugcomment    
\fi}
\NewConfigure{slugcomment}[2]{\c:def\a:slugcomment{#1}%
   \c:def\b:slugcomment{#2}}
>>>

\<config emulateapj.clo shared\><<<
\def\subtitle{{\a:subtitle \noindent
   \a:submitted\scriptsize {\sc \@submitted}\b:submitted
   Preprint typeset using \LaTeX\ style emulateapj\b:subtitle}}

\NewConfigure{subtitle}[2]{\c:def\a:subtitle{#1}\c:def\b:subtitle{#2}}%
>>>

\<config emulateapj.clo shared\><<<
\NewConfigure{submitted}[2]{\c:def\a:submitted{#1}\c:def\b:submitted{#2}}%
>>>

\<config emulateapj.clo shared\><<<
\def\title#1{{%
  \subtitle  \a:title\uppercase{#1}\b:title}}
\NewConfigure{title}[2]{\c:def\a:title{#1}\c:def\b:title{#2}}%
>>>

\<config emulateapj.clo shared\><<<
\def\author#1{{\a:author\small\scshape#1\b:author}\make@slugcomment}
\NewConfigure{author}[2]{\c:def\a:author{#1}\c:def\b:author{#2}}%
>>>

\<config emulateapj.clo shared\><<<
\def\affil#1{{\a:affil#1\b:affil}}
\NewConfigure{affil}{2}
>>>

\<config emulateapj.clo shared\><<<
\def\keywords#1{{\a:keywords{\it\@keywordtext :} #1\b:keywords}}
\NewConfigure{keywords}[2]{\c:def\a:keywords{#1}\c:def\b:keywords{#2}}%
>>>

\<config emulateapj.clo shared\><<<
\def\subjectheadings#1{{\a:subjectheadings{\it
   \@keywordtext :} #1\b:subjectheadings}}
\NewConfigure{subjectheadings}[2]{\c:def\a:subjectheadings{#1}%
   \c:def\b:subjectheadings{#2}}%
>>>

\<config emulateapj.clo shared\><<<
\let\subsecnum@size=\:gobble
\let\secnum@size=\:gobble
>>>

% renewed for catcode of ^

\<config emulateapj.clo shared\><<<
\def\altaffilmark#1{$\sp{#1}$}
\def\tablenotemark#1{$\sp{\rm #1}$}
\def\tablenotetext#1#2{
    \@temptokena={\vspace{.5ex}{\noindent\llap{$\sp{#1}$}#2}\par}
    \@temptokenb=\expandafter{\tblnote@list}
    \xdef\tblnote@list{\the\@temptokenb\the\@temptokena}}
\def\set@tblnotetext{\def\tablenotetext##1##2{{%
    \@temptokena={{\parbox{\pt@width}{\hskip1em$\sp{\rm ##1}$##2}}\par}%
    \@temptokenb=\expandafter{\tblnote@list}
    \xdef\tblnote@list{\the\@temptokenb\the\@temptokena}}}}
\def\arcdeg{\hbox{$\sp\circ$}}
\def\arcmin{\hbox{$\sp\prime$}}
\def\arcsec{\hbox{$\sp{\prime\prime}$}}
\def\fd{\hbox{$.\!\!\sp{\rm d}$}}
\def\fh{\hbox{$.\!\!\sp{\rm h}$}}
\def\fm{\hbox{$.\!\!\sp{\rm m}$}}
\def\fs{\hbox{$.\!\!\sp{\rm s}$}}
\def\fdg{\hbox{$.\!\!\sp\circ$}}
\def\farcm{\hbox{$.\mkern-4mu\sp\prime$}}
\def\farcs{\hbox{$.\!\!\sp{\prime\prime}$}}
\def\fp{\hbox{$.\!\!\sp{\scriptscriptstyle\rm p}$}}
\def\slantfrac#1#2{\hbox{$\,\sp#1\!/\sb#2$}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{ifthen.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<ifthen.4ht\><<<
% ifthen.4ht (|version), generated from |jobname.tex 
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>

   |<fix nameref ifthen|>
   |<fix ifthen|>
   |<ifthen.sty shared config|>
\Hinput{ifthen}
\endinput
>>>        \AddFile{7}{ifthen}

Nameref redefines ifthenelse command, but it clashes with BibLaTeX,
so we revert back to the original version.

The 2022 version of Nameref doesn't redefine it anymore, so we will
restore the original ifthen only if we are on a system with not updated
Nameref.

\<fix nameref ifthen\><<<
\ifdefined\NROrg@ifthenelse%
\let\ifthenelse\NROrg@ifthenelse%
\fi
>>>

\<fix ifthen\><<<
\long\def\:tempc{% 
   \let\sv:begingroup\begingroup
   \def\:tempc{\let\begingroup\sv:begingroup}%
   \def\begingroup{\sv:begingroup
      \aftergroup\:tempc
      \def\begingroup{\let\begingroup\sv:begingroup
                      \begingroup
                      \a:ifthenelse
   }}%
   \o:ifthenelse:}
\HLet\ifthenelse\:tempc
>>>

\<fix ifthen\><<<
\NewConfigure{ifthenelse}[1]{\concat:config\a:ifthenelse{#1}}
\let\a:ifthenelse\empty
\Configure{ifthenelse}{%
   \let\rEfLiNK\@secondoftwo
   \HRestore\pageref
}  
>>>

\Link[/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/base/ifthen.sty]{}{}%
ifthen.sty\EndLink

Fixed for cases like \`'\ifthenelse{\isodd{\pageref{abc}}}'.

\<xifthen.4ht\><<<
% xifthen.4ht (|version), generated from |jobname.tex 
% Copyright 2021 TeX Users Group 
|<TeX4ht license text|> 
|<fix xifthen|>
\Hinput{xifthen}
\endinput
>>> \AddFile{7}{xifthen}

The \`'\TE@repl' command is executed by \`'\ifthenelse', 
where \`'\begingroup' is redefined to insert TeX4ht hooks. 
We need to prevent execution of this code here, so we use 
\`'\sv:begingroup', saved version of \`'\begingroup' from
ifthen.4ht.
\Link[https://tex.stackexchange.com/a/628068/2891]{}{}%
More details\EndLink.

\<fix xifthen\><<<
\def \TE@repl #1#2{%
  \long \def \@tempc ##1#1##2{%
    \def \@tempb{\@tempc}%
    \sv:begingroup % Thanks MPG
      \toks@ {##2}%
      \edef \@tempa {\the \toks@}% <- UF v1.3
    \expandafter \endgroup
    \ifx \@tempa \@tempb
      \toks@ \expandafter {\the \toks@ ##1}%
      \expandafter \@gobble
    \else
      \toks@ \expandafter {\the \toks@ ##1#2}%
      \expandafter \@tempc
    \fi
    ##2%
  }%
  \toks@ \expandafter {\expandafter}%
  \expandafter \@tempc \the \toks@ #1\@tempc
}
>>>


\<non classified latex\><<<
|<early latex util|> 
|<more latex math|>

   |<latex trace configurations|>
|<latex html cut points|>
|<config latex.ltx utilities|>
|<latex.ltx latex trace configurations|>
|<config latex.ltx shared|>
|<config plain-latex shared|>
   |<elements for lists|>
   |<html lists|>
   |<html latex lists|>
   |<html latex bib|>
   |<elements for latex divs|>
   |<elements for divs|>
   |<html latex divs|>
   \:CheckOption{new-accents}     \if:Option
      |<revised accent definitions|>
      |<revised latex accent definitions|>
      |<new accents|>
   \else
      |<temp patch for accents on small caps|>
      |<accents|>
   \fi
   |<text symbols|>
   |<html local env|>
   |<more html tex|> 
   |<html tex env|>
      |<html latex.ltx core|>
      |<html latex floats|>
   |<more html latex|>
|<latex 1999|>
|<latex 2000|>
|<html latex coauthor|>
|<latex.ltx|>
\def\:temp#1#2|<par del|>{\def\:temp{#1}}
\expandafter\:temp\usepackage|<par del|>
\def\:tempa{\@latex@e@error}
\ifx \:temp\:tempa
   |<latex209.4ht|>
\else
   |<not latex209|>
\fi
>>>

In latex, we have \`'\let\math=\(
\let\endmath=\)
\def\displaymath{\[}
\def\enddisplaymath{\]\global\@ignoretrue}'.

\`'\Configure {[]} {cond-before-math} {cond-after-math} 
{cond-start-math} {cond-end-math}' The cond is on at least one of the parameters in the pair being non-empty.

\`'$$...$$' and \`'\[...\]' should have identical behavior with
respect to paragraphs.

\`'\[..\]' is for \`'$$...$$' and \`'\(...\)' is for \`'$...$'.

Tried \`'\let\B:math|=\[  \let\E:math|=\]  
            \let\b:math|=\(  \let\e:math|=\)  '
for LaTeX{}, but there were occassions 
it failed me.

%  \def\after:protect##1{}%
%  \def\protect##1{\string\protect\string##1\after:protect{##1}\relax\space}%
%   \let\x@protect|=\protect

\<latex changes for tex4ht.sty\><<<
|<html latex start|>
|<html latex hook on end|>
\expandafter\ifx \csname pageno\endcsname\relax
                 \let\pageno|=\c@page   \fi 
\let\accent:def|=\def
\pend:def\protect:wrtoc{\:protect 
   \Configure{ }{ }%
   \let\\\space%
 \toc:lbl:idx}
  \def\endMkHalign{\EndMkHalign}
\let\vrb:tt\texttt
\def\:protect{\vrb:tt   
  \let\protect|=\@unexpandable@protect      
  \let\ref|=\o:ref \more:no
}
>>>

\<shared plain,eplain\><<<
\pend:def\protect:wrtoc{\Configure{ }{ }}
>>>

% \def\add:protect#1{\append:defI\after:protect{\check:protect{#1}{##1}}}
% \def\check:protect#1#2{\ifx #1#2\expandafter\gobble:space\fi}
% \def\gobble:space#1\space{}
%

The following allows pushing the math mode into the cells,
instead of being placed on top of the tabular environment (tabular
has a \`'$' outside the environment--for compatibility with the
shared environment of array?). 
\ifHtml[\HPage{more}
Removed \`'\edef\:temp{\the\everymath}\ifx \:temp\empty
        \:warning{tabular within math?}\fi \let\:@tabular:|=\empty'
to allow dealing with

\Verbatim
\documentclass{article}%
\begin{document}

\catcode`\:=11

\def\fff#1{\immediate
   \write16{....[#1]..........\the\everymath}%
%   \write16{....[#1]..........\meaning\a:mth}%
%  \immediate   \write16{.............\meaning\PicMath }%   
}

\ifx \Configure\UnDef\else
   \Configure{$}{\PicMath}{\EndPicMath}{}
\fi

\fff{}
$A$

\begin{tabular}{l}
$C$
\begin{tabular}{l}%
$D$
\end{tabular}
\end{tabular}

$
\begin{array}{l}
$C$
\begin{tabular}{l}%
$D$
\end{tabular}
\end{array}
$

\end{document}
\EndVerbatim\EndHPage{}]\fi

\<fix for tabular\><<<
\def\:@tabular:{\expandafter\everymath
  \expandafter{\expandafter \everymath \expandafter{\the\everymath}}}%
>>>

  

\<latex.ltx\><<<
|<html latex halign|>
\:CheckOption{new-accents}     \if:Option \else
   |<latex accents|>
\fi
>>>

Do we also  want \''\add@accent' redefined to
\`'\def\add@accent#1#2{{\accent#1 #2}}'.

\<latex.ltx\><<<
      \pagestyle{empty}  \def\pagestyle#1{}   
                         \def\thispagestyle#1{}
      \def\ps@plain{}
      \setlength\oddsidemargin   {0in}
      \setlength\evensidemargin  {0in}
>>>

\Chapter{Display-Paragraph Environments of LaTeX}

Environments to consider: quote, quotation, verse, center, flushleft,
flushright, tabarray (tabular/array), tabbing, and verbatim. The
last two may be combined into quote or quotations. With the exeption of
the last two, they are all displayed-paragraph environments (C.5 in LaTeX).

The above environments are built on top of \''\list...\endlist' and
\''\trivlist...\endtrivlist' in LaTeX, and there we impose the html
code.  That is, we use \''\Configure{lists}' that is common to both
constructs.

\ifHtml[\HPage{test data}\Verbatim
\documentstyle{article}

 \input tex4ht.sty \Preamble{html,fonts}
        \begin{document}
     \EndPreamble

\begin{verse}
=============

(P)=============
\end{verse}

\begingroup \verse
=============
\endverse  \endgroup

...................
\begin{verse}
=============
\end{verse}
.............

(P)................

(P)...................
\begin{verse}
=============
\begin{verse}
+=============

+(P)=============
\end{verse}

\begingroup \verse
+=============
\endverse  \endgroup

+...................
\begin{verse}
+=============
\end{verse}
+.............

+(P)................

+(P)...................
\begin{verse}
+=============
\end{verse}
+.............

\end{verse}
.............

\end{document}
\EndVerbatim\EndHPage{}]\fi

\ifHtml[\HPage{more}\Verbatim
>   - More serious is that the verse and quote environments are still
> centered in Powerbrowser. 

The reason is probably that Powerbrowser does not recognize the
property WIDTH="1" in <TD>, a feature that should be legal in html 3.2.

> The html output for my address, for example,
> looks like this:
> 
>   <TABLE
>   WIDTH="100%" CELLPADDING="0" CELLSPACING="15"><TR><TD
>   WIDTH="1"></TD><TD
>   >
> 
>        XX XX<BR>
>        XX<BR>
>        XX xx<BR>
>        The xx<BR>
>        email: <A HREF="mailto:xx@xx.nl">xx@xx.xx</A>
>   </TD></TR></TABLE>
> 
> If I remove the ``WIDTH="100%"'' from the table tag, this is fixed,
> without breaking anything in MSIE or Netscape.

Once you remove the WIDTH property, the width of the table is
determined by its content instead of the page dimension.  This
can cause adversary conditions for nested environments.

For instance

   \documentstyle{article}
   
   \input tex4ht.sty \Preamble{html}  \begin{document}   \EndPreamble
   
   \begin{quote}
   The buck stops here.
   \begin{flushleft}1\\123\\12345\end{flushleft}
   \begin{flushright}1\\123\\12345\end{flushright}
   \end{quote}
   
   \end{document}

creates the outcome

   +-------------------------------------------------------+
   | The buck stops here.                                  |
   |       1                                               |
   |       123                                             |
   |       12345                                           |
   |                                                       |
   |                                                     1 |
   |                                                   123 |
   |                                                 12345 |
   +-------------------------------------------------------+

which translates to the following one when the WIDTH property 
is removed.

   +-------------------------------------------------------+
   | The buck stops here.                                  |
   |       1                                               |
   |       123                                             |
   |       12345                                           |
   |                                                       |
   |                    1                                  |
   |                  123                                  |
   |                12345                                  |
   +-------------------------------------------------------+

\EndVerbatim\EndHPage{}]\fi

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Tables of Contents}

\Section{Modifying LaTeX Macros}

\<article et al tocs\><<<
\def\tableofcontents{%
   \ifx\contentsname\empty \else
      \ifx\contentsname\:UnDef \else
         |<protect from TocAt|>\section*{\contentsname}%
         |<end protect from TocAt|>%
   \fi\fi
   \:tableofcontents}
>>>

\<book et al tocs\><<<
\def\tableofcontents{%
   \ifx\contentsname\empty \else
      |<protect from TocAt|>\chapter*{\contentsname}%
      |<end protect from TocAt|>%
   \fi
   \:tableofcontents}
>>>

Without the following, the chapter*/section* introduces
the cutat configuration for the  \''\tableofcontents' 

\<protect from TocAt\><<<
%
>>>

\<end protect from TocAt\><<<
%
>>>

\<html latex tocs\><<<
\edef\:TOC{%
   \noexpand\ifx [\noexpand\:temp  
      \noexpand\expandafter\noexpand\:TableOfContents
   \noexpand\else 
      \noexpand\Auto:ent{|<entries for latex tocs|>}%
   \noexpand\fi}
|<latex et al tocs|>
>>>

\<latex et al tocs\><<<
\def\:tableofcontents{\futurelet\:temp\:TOC}
\def\Auto:ent#1{%
   \edef\auto:toc{\noexpand\:TableOfContents[\ifx \auto:toc\:UnDef
      #1\else \auto:toc \fi]}  \auto:toc
   \global\let\auto:toc|=\:UnDef }
>>>

\<html /addcontentsline\><<<
\def\addcontentsline#1#2#3{\if@filesw \begingroup
   \no:lbl:idx  \let\protect\@unexpandable@protect  
   \@temptokena{\thepage}%
   |<revised /addcontentsline|>\@tempa
   \if@nobreak \ifvmode\nobreak\fi\fi\endgroup\fi}
>>>

The redefinition of \''\addcontentsline' should preserve vertical mode.
The following is the modification to the original def.  

\<revised /addcontentsline\><<<
\def\:tempb{#1}\def\:tempa{toc}%
\ifx \:tempb\:tempa
  |<addcontentsline html addr|>%
  \hbox{\Link{}{\:tempb}\EndLink}%
  \edef\@tempa{|<add contents line|>}%
\else
 |% \gHAdvance\TitleCount by 1|%%
 |<non-toc addcontentsline html addr|>%
  \hbox{\Link{}{|<haddr prefix|>\last:haddr}\EndLink}%
  \edef\@tempa{|<add non-toc contents line|>}%
\fi
>>>

\<non-toc addcontentsline html addr\><<<
\html:addr
>>>

\<add non-toc contents line\><<<
\csname if:toc\endcsname{\the\:tokwrite{\string\doTocEntry
    \string\toc#1{}{\string\csname\space a:TocLink\string\endcsname
   {\FileNumber}{|<haddr prefix|>\last:haddr}{}{#3}}{\the\@temptokena}\relax}}%
>>>

\<add contents line\><<<
\csname if:toc\endcsname{\the\:tokwrite{\string\doTocEntry
    \string\toc#2{}{\string\csname\space a:TocLink\string\endcsname
   {\FileNumber}{\:tempb}{}{#3}}{\the\@temptokena}\relax}}%
>>>

In the above link,

\List{disc}

\item Originally we didn't have a file name in \`'[...]',
and it caused a problem in parent-children relationships.  
So we introduced  
Without \`'[\RefFileNumber\FileNumber]' the cross link
is not recognized in parents-childred relationships.
\item Then it turned out that some
browsers reload the current page if the file name is mentioned,
so we removed the reference to the page name 

\<addcontentsline html addr\><<<
\edef\:tempb{|<section html addr|>}%
>>>

Instead of

\<\><<<
\NewHaddr\:tempb
>>>

\item Do the parent-children relationships still work?

\EndList

\<add aux line\><<<
\write \@auxout{\string\@writefile{#1}{\protect
     \contentsline{#2}{#3}{\the\@temptokena}}}%
>>>

The command \''\addvspace' may appear at start of list of tables
and it must be reached in vertical mode (see list tables -- lot).

The following goes also into non-core latex.
Do we need \`' \Configure{cite}{}{}{}{}%' in the following?

\<html latex.ltx core\><<<
\def\@starttoc#1{%
  \begingroup
    \makeatletter 
    \def\:temp{#1}\def\:tempa{toc}%
    \ifx \:temp\:tempa
       \@input{\jobname.4ct}%
    \else
       \@input{\jobname.#1}%
       \if@filesw
         \expandafter\expandafter\csname
             newwrite\endcsname\csname tf@#1\endcsname
         \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
       \fi
    \fi
    \global\@nobreakfalse
  \endgroup}
>>>

\Section{Default Choice of Entries for TOC's}

\<entries for latex tocs\><<<
\ifnum \c@tocdepth >-2 part,\fi
\expandafter\ifx \csname @chapter\endcsname\relax 
   \ifnum \c@tocdepth >\z@  section,\fi
\else
   \ifnum \c@tocdepth >\m@ne chapter,appendix,\fi
   \ifnum \c@tocdepth>0 section,\fi
\fi
\ifnum \c@tocdepth>1 subsection,\fi
\ifnum \c@tocdepth>2 subsubsection,\fi
\ifnum \c@tocdepth>3 paragraph,\fi
\ifnum \c@tocdepth>4 subparagraph,\fi
UnDFexyz>>>

\Verbatim
The paper output looks like this:
The paper output looks like this:

  5  Miscellaneous
     5.1  Changing ...
     ...
     5.5  Timer quirks
  References

The MSIE and Netscape output looks like this:

  5 Miscellaneous
    5.1 Changing ...
    ...
    5.5 Timer quirks
    References
    About this document
\EndVerbatim

\<html latex tocs\><<<
\def\:tocs{\noexpand\:tableofcontents}
>>>

\Section{Extra entries to Toc}

\<html latex tocs\><<<
\pend:defIII\addcontentsline{%
   \def\:temp{##1}\def\:tempa{toc}\ifx \:temp\:tempa
   \gHAdvance\TitleCount  1 \fi }
>>>

\Section{Configurations}

\<config latex.ltx utilities\><<<
\NewConfigure{tableofcontents}{5}
>>>

%%%%%%%%%%%%%%%%%%
\Chapter{Content in Margins}
%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Margin Notes}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<more html latex\><<<
\def\:tempc{\@ifnextchar [\:xmpar{\:xmpar[]}}
\HLet\marginpar\:tempc
\long\def\:xmpar[#1]#2{\a:marginpar{#2}\b:marginpar}
>>>

\<config latex.ltx utilities\><<<
\NewConfigure{marginpar}{2}
>>>

\ifHtml[\HPage{more}\Verbatim

Nope. DIV is not the one to use. Alan, if you know TeX, think
\marginpar{...}. I want to stuff a box somewhere, linked to the location in
the text where the item appears. I don't want to break the text that
contains the material in question. Now Mr. Freedom X, recall that while a
box inline is not recommended in HTML 4, it isn't illegal, either. I'm not
talking SGML here, Alan.

http://www.indrev.com<STYLE TYPE="text/css">
P {border: red   solid }
body {border: blue   solid 1em }
BODY {
      margin-left:20%;
      margin-right:20%;
      text-align:justify;
      }
.leader {
         width:10em;
         float:left;
         color:blue;
         text-align:left;
         }
.leader1 {
         width:10em;
         float:left;
         color:blue;
         text-align:left;
         padding-top:1em;
         }
.in {text-indent:3em}
.center {text-align:center}
</STYLE>

<SPAN class=leader>Right of nature what.</SPAN>The 
right of nature,</SPAN>  which writers commonly call <EM>jus
naturale,</EM> is the liberty each man hath to use his own power as he
will himself for the preservation of his own nature&mdash;that is to
<P><SPAN class=leader>Liberty what.</SPAN>
 to the proper signification of the word, the absence of external impediments; which impediments may oft take away part of a man's power to do what he would, but cannot hinder him from using the power left him according as his judgement and reason shall dictate to him.
 and law, <SPAN class=leader1>Difference of right and law.</SPAN>yet they ought to be distinguished, because right consists in liberty to do, or to forbear; whereas law determines and binds to one of them: so that law and right differ as much as obligation and liberty, which in one and the same matter are inconsistent. 

\EndVerbatim\EndHPage{}]\fi

%%%%%%%%%%%%%%%%%%
\Section{Picture Insertions}
%%%%%%%%%%%%%%%%%%

\<picins.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% picins.4ht                            |version %
% Copyright (C) |CopyYear.2005.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<picins configs|>
\Hinput{picins}
\endinput
>>>        \AddFile{9}{picins}

\<picins configs\><<<
\def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
   \def\parpicOpt{#5}%
   \old@par \a:parpic #7\b:parpic \old@par
}
\NewConfigure{parpic}{2}
>>>

%%%%%%%%%%%%%%%%
\Chapter{Other}
%%%%%%%%%%%%%%%%

\Section{Lost Spaces}

The following has the definition \''\def\@{\spacefactor\@m}' in latex,
and it causes  a loss of spaces in tex4ht.

\<more html latex\><<<
\let\@|=\empty
>>>

%%%%%%%%%%%%%%%%%%
\Section{Accents}
%%%%%%%%%%%%%%%%%%

The following was for 
\`'/n/candy/0/tex/teTeX/texmf/tex/latex/base/inputenc.sty'
and files like 
\`'/n/candy/0/tex/teTeX/texmf/tex/latex/base/latin1.def'.

But 2022 release of LaTeX don't need special handling of \`'\@tabacckcludge',
the accents works even when we remove the following redefinitions.

What is more serious is that these redefinitions of MakeUppercase and
MakeLowercase don't change text case anymore, and it also causes
compilation error for the \`'\chapter' command. So we need to 
disable it even if it was useful in some older documents.

\<latex accents not used anymore\><<<
\let\:tabacckludge|=\@tabacckludge
\def\@tabacckludge#1{\csname #1\endcsname}
\long\def\:temp#1{\bgroup  \let\@tabacckludge|=\:tabacckludge
   \csname o:MakeUppercase :\endcsname{#1}\egroup}
\expandafter\HLet\csname MakeUppercase \endcsname|=\:temp
\long\def\:temp#1{\bgroup  \let\@tabacckludge|=\:tabacckludge
   \csname o:MakeLowercase :\endcsname{#1}\egroup}
\expandafter\HLet\csname MakeLowercase \endcsname|=\:temp
>>>

The following is the reasoning why the previous lines were included in the
first place: 

\Verbatim

> Really, [latin1] redefines "=E1" as {\@tabacckludge'a}, and TeX4ht is
> not compatible with this. But this is a minor problem: hacking the
> file latin1.def I can change {\@tabbackludge'a} for {\'a}, whith lends
> to a correct output with TeX4ht (an even in a normal compilation under
> LaTeX).

I redefined \@tabacckludge to handle the problem for TeX4ht.  I don't
yet fully understand the purpose of \@tabacckludge, but I guess that
changing latin1.def will cause font problems in standard mode.
\EndVerbatim

\ifHtml[\HPage{more}\Verbatim
 \documentclass{article}
 \usepackage[latin1]{inputenc}

\input tex4ht.sty
\Preamble{html}

\begin{document}

\EndPreamble

\catcode`\@=11

\string Z {\@tabacckludge'Z} /// 

{\string \i {\@tabacckludge`\i} /// 

�              252

�             253

\end{document}

\EndVerbatim\EndHPage{}]\fi

\Verbatim

> I send to you my ..... file attached, but in order to test it
> you'll ned an instalation of the EC fonts. These fonts, as you
> probably know, are an extension of the Computer Modern fonts, with 256
> characters which include all the accented letters (tha are usual in
> european languages). For using these fonts it is only required to:
> 
> \usepackage{t1enc}
> 
> Automagically, when you use in your document \'a, this generates in
> the .dvi a character with code 225, instead of putting an accent over
> the character code 97 (a), as in the Computer Modern font. This is an
> advantage for hyphenating words containing accented characters. TeXht
> redefines this behaviour, but I guess that this is not important,
> since in HTML words are not hyphenated.
> 
> In addition I use \usepackage[latin1]{inputenc}, in order to make the
> typing less painful. With this package I can type "=E1", and this letter
> is translated to \'a (which in turn is translated in a single
> character code if you use the EC fonts).=20

\EndVerbatim

\ifHtml[\HPage{nedd to be fixed}\Verbatim
 \documentclass{book}

%  \usepackage[latin1]{inputenc}
  \usepackage{t1enc}

\input tex4ht.sty
\Preamble{html}

\begin{document}

\EndPreamble

\def\x{ � (252)  �   (253)}

% --------------------------------

\x   ========
\Picture*{} \x \EndPicture{}

\end{document}

\EndVerbatim\EndHPage{}]\fi

LaTeX temporarily reassigngs other meaning in tables and elsewhere  
to \'=\``=, \'+\=+, and \'+\``+.  Make sure that the followin
appear after their redefinition in TeX4ht so that they will carry 
the desired meaning.

\<latex accents\><<<
\let\@acci|=\' \let\@accii|=\` \let\@acciii|=\=
>>>

\<latex accents\><<<
\def\:tempc#1{%
   \if '#1\let\:temp=\@acci   \else
   \if `#1\let\:temp=\@accii  \else
   \if =#1\let\:temp=\@acciii \else
      \def\:temp{\@tabacckludge#1}\fi\fi\fi
   \:temp}
\HLet\a\:tempc
>>>

The \'\a' command is a compensantion for the missing cases of
\'=\``=, \'+\=+, and \'+\``+  used as
\'=\a``=, \'+\a=+, and \'+\a``+, respectively. In LaTeX
it is defined to equal \''\@tabacckludge'.

%%%%%%%%%%%%%
\SubSection{nomencl}
%%%%%%%%%%%%%

Compilation:

\Verbatim
   latex test 
   makeindex test.nlo -s nomencl.ist -o test.nls 
   htlatex test 
\EndVerbatim

\<nomencl.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% nomencl.4ht                           |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{nomencl}
\endinput
>>>        \AddFile{9}{nomencl}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{List-Tocs of Figures and Tables}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The following is for the list of figures/tables.

\<html latex tocs\><<<
\def\@dottedtocline#1#2#3#4#5{\hbox{\def\numberline##1{\e:listof
                ##1\f:listof}\c:listof#4\d:listof}\ignorespaces}
>>>

The added \''\par' after \''\a:listof' is to avoid problems in an
environment that should be entered in vertical mode, at least for
the case of \''\addvspace'.

% \@ifclassloaded{amsproc}{\:Optionfalse}{\:Optiontrue}
% \@ifclassloaded{amsbook}{\:Optionfalse}{}
%  \@ifclassloaded{amsart}{\:Optionfalse}{}
% \if:Option 

\<html latex tocs\><<<
\def\@starttoc#1{%
  \begingroup
    \makeatletter   \Configure{cite}{}{}{}{}%
    \def\:temp{#1}\def\:tempa{toc}%
    \a:listof\par
    \@input{\jobname.\ifx \:temp\:tempa 4ct\else #1\fi}%
    \b:listof
    \if@filesw
      \expandafter\expandafter\csname
          newwrite\endcsname\csname tf@#1\endcsname
      \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
    \fi
    \global\@nobreakfalse
  \endgroup}
>>>

Was \`'\pend:defI\@starttoc{\par}'

\SubSection{Configurations}

The  following is for book.cls, article.cls,...

\<config book-report-article shared\><<<
\NewConfigure{listof}{6}  
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{/input Command}
%%%%%%%%%%%%%%%%%%%%%%%%%

\<more html latex\><<<
\pend:defI\@iinput{\egroup}
\let\o:iinput:|=\@iinput
\def\@iinput{\bgroup \catcode`\_=12 \o:iinput:}
>>>

\<more html latex\><<<
\def\:tempc{\bgroup \catcode`\_=12 \la:include}
\def\la:include#1{\egroup \o:include:{#1}}
\HLet\include\:tempc
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Fonts (latex.ltx + fontmath.4ht)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<fontmath.4ht\><<<
% fontmath.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
|<config fontmath.ltx utilities|>
|<config fontmath.ltx shared|>
|<config fontmath|>
|<fontmath + plain classes|>
|<over/under fontmath|>
\Hinput{fontmath}
\endinput
>>>        \AddFile{2}{fontmath}

\<fontmath + plain classes\><<<
|<plain, fontmath, amsmath, amstex|>
|<plain, fontmath, amstex|>
>>>

% fontmath.ltx:\DeclareMathAlphabet      {\mathit}{OT1}{cmr}{m}{it}
% fontmath.ltx:\SetMathAlphabet\mathit{bold}{OT1}{cmr}{bx}{it}
% 
% latex209.def:\let\mathit\undefined
% latex209.def:\DeclareSymbolFontAlphabet\mathit{italic}
% 
% oldlfont.sty:\let\mathit\undefined
% oldlfont.sty:\DeclareSymbolFontAlphabet\mathit{italic}

Fonts can create problems in edef environments. The following
definition is to get protection in titles taht go to the top of
hypertext pages.  The \`'\text...' belong to latex.ltx.

\<config fontmath.ltx utilities\><<<
\def\:same#1{#1}
\def\no:fonts{\more:no  \let\protect\@unexpandable@protect }
\def\more:no{%
   \let\footnote|=\:gobble \let\ |=\space
 }
>>>

Definitions like \Verb'\def\mathbf#1{\a:mathbf#1\b:mathbf}'
must take care of commands like \Verb'\bf'.  The latter 
commands in effect tranform the  \Verb'\mathbf' commands into
old fashion  \Verb'$\bf R$'.

\<config fontmath.ltx shared\><<<
\def\choose:mfont#1{\ifx \math@bgroup \relax
     \expandafter\old:mfont
   \else
     \expandafter\new:mfont
   \fi  
   {#1}}
\def\old:mfont#1{\csname o:@#1:\endcsname}
|<new fonts setting|>
\:tempd{mathbf}
\:tempd{mathrm}
\:tempd{mathsf}
\:tempd{mathit}
\:tempd{mathtt}
>>>

\<new fonts setting\><<<
\def\new:mfont#1#2{%
      \csname a:#1\endcsname
      \csname o:#1@@:\endcsname
  {#2}\csname b:#1\endcsname
}
\def\:temp{\protect \@mathtt}
\ifx \mathtt\:temp
   |<pre 2005 fontmath|>
\else
   |<2005 fontmath|>
\fi
>>>

\<pre 2005 fontmath\><<<
\def\:tempd#1{%
   \expandafter\edef\csname #1\endcsname{%
       \noexpand\protect \expandafter\noexpand
            \csname #1@@\endcsname}
   \expandafter\edef\csname #1@@\endcsname{%
       \noexpand\protect \expandafter\noexpand
       \csname @#1\endcsname}
   \def\:tempc{\choose:mfont {#1}}
   \expandafter\HLet\csname #1@@\endcsname\:tempc
   \NewConfigure{#1}{2}%
}
>>>

\<2005 fontmath\><<<
\def\:tempd#1{%
   \expandafter\edef\csname #1\endcsname{%
       \noexpand\protect \expandafter\noexpand
            \csname #1@@\endcsname}
   \expandafter\edef\csname #1@@\endcsname{%
       \noexpand\protect \expandafter\noexpand
       \csname #1\space\endcsname}
   \def\:tempc{\choose:mfont {#1}}
   \expandafter\HLet\csname #1@@\endcsname\:tempc
   \NewConfigure{#1}{2}%
}
>>>

The following configuration break, for instance, with the following
source due to  dynamic  change of fonts.

\Verbatim
\documentclass{article} 
\begin{document} 
prima  {\boldmath $\mathrm{{\csname HCode\endcsname{}}^{14}C}$} 
 
seconda   {\boldmath $\mathsf{{\csname HCode\endcsname{}}^{15}C}$} 
 
terza   {\boldmath $\mathrm{{\csname HCode\endcsname{}}^{16}C}$} 
 
quarta   {\boldmath $\mathsf{{\csname HCode\endcsname{}}^{17}C}$} 
 
 quinta   {$\mathtt{{\csname HCode\endcsname{}}^{18}C}$} 
\end{document} 
\EndVerbatim

\<new fonts settingNO\><<<
\def\new:mfont#1#2{%
      \csname a:#1\endcsname
      \csname o:@#1:\endcsname
  {#2}\csname b:#1\endcsname   
}    
\def\:tempd#1{%
   \def\:tempc{\choose:mfont {#1}}
   \expandafter\HLet\csname @#1\endcsname|=\:tempc
   \NewConfigure{#1}{2}%
}
>>>

The \Verb+\csname mv@\math@version \endcsname+ showas the installed 
math macros. The following modification might also become handy.

\Verbatim
\def\install@mathalphabet#1{%
  \expandafter\ifx \csname o:\expandafter\:gobble\string #1:\endcsname\relax
     \:warning{\expandafter\:gobble\string #1 not configured}%
     \expand:after{\gdef#1}%
  \else
     \expand:after{\expandafter\gdef\csname o:\expandafter
         \:gobble\string #1:\endcsname}%
  \fi
}
\EndVerbatim

\Verbatim

The issue of font decoration in math is currently problematic.   

*  In unicode, decorated symbols get distinguished codes if 
   the decoration implies special math meaning.  Consequently,
   symbols with `meaningful' decorations should be embedded 
   in decorated unicode entries, whereas `meaningless' decorations
   should be set through style sheets (e.g., css or xslt). 

*  The behavior of latex doesn't seem to always be meaningful, for
   instance, \mathbf in the following example.

     \documentclass{amsart}
        \RequirePackage{bm}
     \begin{document}
     
       \def\x{ A + \alpha + \Delta }
     
       $ \x            $ \par       % none in bold
       $ \bm{ \x }     $ \par       % all in bold
       $ \mathbf{ \x } $            % just A and Delta in bold
     
     \end{document}
     
*   The decorations by \bm, I think, should be considered meaningless.
    Currently they can't be realized through style sheets, because the
    browsers don't seem to support such capabilities for mathml.

*   A few cases, like \mathbb, seem to have `meaningful' decorations.
    So tex4ht tries to implement these decorations.
\EndVerbatim

\<config latex.ltx shared\><<<
\NewConfigure{texttt}[2]{\expandafter\ifx \csname o:texttt :\endcsname\relax
  \long\def\:temp##1{{\a:texttt \csname o:texttt :\endcsname{##1}\b:texttt}}%
  \expandafter\HLet\csname texttt \endcsname|=\:temp  
  \fi \c:def\a:texttt{#1}\c:def\b:texttt{#2}}
\NewConfigure{textit}[2]{\expandafter\ifx \csname o:textit :\endcsname\relax
  \long\def\:temp##1{{\a:textit \csname o:textit :\endcsname{##1}\b:textit}}%
  \expandafter\HLet\csname textit \endcsname|=\:temp  
  \fi \c:def\a:textit{#1}\c:def\b:textit{#2}}
\NewConfigure{textrm}[2]{\expandafter\ifx \csname o:textrm :\endcsname\relax
  \long\def\:temp##1{{\a:textrm \csname o:textrm :\endcsname{##1}\b:textrm}}%
  \expandafter\HLet\csname textrm \endcsname|=\:temp  
  \fi \c:def\a:textrm{#1}\c:def\b:textrm{#2}}
\NewConfigure{textup}[2]{\expandafter\ifx \csname o:textup :\endcsname\relax
  \long\def\:temp##1{{\a:textup \csname o:textup :\endcsname{##1}\b:textup}}%
  \expandafter\HLet\csname textup \endcsname|=\:temp  
  \fi \c:def\a:textup{#1}\c:def\b:textup{#2}}
\NewConfigure{textsl}[2]{\expandafter\ifx \csname o:textsl :\endcsname\relax
  \long\def\:temp##1{{\a:textsl \csname o:textsl :\endcsname{##1}\b:textsl}}%
  \expandafter\HLet\csname textsl \endcsname|=\:temp  
  \fi \c:def\a:textsl{#1}\c:def\b:textsl{#2}}
\NewConfigure{textsf}[2]{\expandafter\ifx \csname o:textsf :\endcsname\relax
  \long\def\:temp##1{{\a:textsf \csname o:textsf :\endcsname{##1}\b:textsf}}%
  \expandafter\HLet\csname textsf \endcsname|=\:temp  
  \fi \c:def\a:textsf{#1}\c:def\b:textsf{#2}}
\NewConfigure{textbf}[2]{\expandafter\ifx \csname o:textbf :\endcsname\relax
  \long\def\:temp##1{{\a:textbf \csname o:textbf :\endcsname{##1}\b:textbf}}%
  \expandafter\HLet\csname textbf \endcsname|=\:temp  
  \fi \c:def\a:textbf{#1}\c:def\b:textbf{#2}}
\NewConfigure{textsc}[2]{\expandafter\ifx \csname o:textsc :\endcsname\relax
  \long\def\:temp##1{{\a:textsc \csname o:textsc :\endcsname{##1}\b:textsc}}%
  \expandafter\HLet\csname textsc \endcsname|=\:temp  
  \fi \c:def\a:textsc{#1}\c:def\b:textsc{#2}}
\NewConfigure{emph}[2]{\expandafter\ifx \csname o:emph :\endcsname\relax
  \long\def\:temp##1{{\a:emph \csname o:emph :\endcsname{##1}\b:emph}}%
  \expandafter\HLet\csname emph \endcsname|=\:temp  
  \fi \c:def\a:emph{#1}\c:def\b:emph{#2}}
>>>

\<base fonts\><<<
\def\:temp#1#2|<par del|>{\def\:temp{#1}}
\expandafter\:temp\usepackage|<par del|>
\def\:tempa{\@latex@e@error}
\ifx \:temp\:tempa \else
   |<not latex209 base fonts|>
\fi
>>>


\<not latex209 base fonts\><<<
\def\:tempa#1#2#3#4{\tmp:toks{#1{#2}}%
   \long\expandafter\edef\csname #4 \endcsname{\the\tmp:toks
        {\expandafter\noexpand
   \csname o:\expandafter\:gobble\string #3:\endcsname}}}
\def\:temp#1{%
  \expandafter\ifx \csname #1 \endcsname\relax\else
     \expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}%
  \fi
}
\:temp{rm}
\:temp{sf}
\:temp{tt}
\:temp{bf}
\:temp{it}
>>>

I don't really understand what the above code does. Is it really necessary anymore?
The short font commands are deprecated for quite some time, KOMA classes removed them
and this definition causes issues with it.

Michal, October 2018

Just disable the old font commands patching for now.

% \<book / report / article\><<<
% |<base fonts|>
% >>>
% 
% \<ams art + book + proc\><<<
% |<base fonts|>       
% >>>

The else part is for compabibility when the \`'fonts' option is 
inactive.

\ifHtml[\HPage{comment}\Verbatim
you probably don't want the `fonts' in \Preamble.  It is an ugly, and
not 100% safe, creature left over from the time fonts got their
support just from the from the .sty files.  Now the support comes from
tex4ht.c, based on the font information available in the dvi files.

\EndVerbatim\EndHPage{}]\fi

\Section{Hfonts}

\ifHtml[\HPage{test data}\Verbatim

\documentclass{article}

\input tex4ht.sty
\Preamble{html,3,next,fonts}
\begin{document}
\EndPreamble

The mathit needs a, preferable built-in, Protect.

\section{What is $\mathit{mathit}$?}

section one.

$\mathit{NONE-mathit}$\par
$\mathrm{NONE-mathrm}$\par
$\mathsf{NONE-mathsf}$\par
$\mathbf{NONE-mathbf}$\par
$\mathtt{NONE-mathtt}$\par
\par
\textbf{NONE-textbf}\par
\textit{NONE-textit}\par
\textrm{NONE-textrm}\par
\textsc{NONE-textsc}\par
\textsf{NONE-textsf}\par
\textsl{NONE-textsl}\par
\texttt{NONE-texttt}\par

\section{What is \textit{textit}?}

test

\end{document}

\EndVerbatim\EndHPage{}]\fi

How about the following ones?

\`'
\DeclareTextFontCommand{\textnormal}{\normalfont}
\DeclareTextFontCommand{\textmd}{\mdseries}
\DeclareTextFontCommand{\textup}{\upshape}
\DeclareTextFontCommand{\emph}{\em}'

\ifHtml[\HPage{why the extra x? in latex}\Verbatim

\Draw  \Large \baselineskip=0.8\baselineskip
   \TreeSpec(n,\Node & r,\SRectNode)()()
   \TreeAlign(H,-1,0)(0,0,0)
   \MinNodeSize(1,30)
\TreeSpace(S,30,10)  \NodeMargin(5,10)
\Tree()(
   1,n,s~~o~~u~~r~~c~~e//
   1,r,{TeX} //
   1,n,d\strut~~v\strut~~i\strut //
   2,r,{tex4ht} //
   0,n,{h\rlap{tml}}
   & 1,n,i\strut~~v\strut~~d\strut  //
   1,r,{dvi}~~{to}~~{gif}//
   0,n,g~~i~~f//
)
\EndDraw
\EndVerbatim\EndHPage{}]\fi

\SubSection{Parbox}

Hide an artificial  math.

\<latex math\><<<
\long\def\:temp#1#2[#3]#4#5{%
  \leavevmode
  \@pboxswfalse
  \setlength\@tempdima{#4}%
  \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}%
    \ifx|<new @iiiparbox|>#2\else
    \ifx|<old @iiiparbox|>#2\else
      \setlength\@tempdimb{#2}%
      \def\@parboxto{to\@tempdimb}%
    \fi\fi
     \def\v:TBL{#1}%
    \if#1b\vbox
    \else\if #1t\vtop
    \else\ifmmode\vcenter
    \else\@pboxswtrue |<hide parbox math|>$\vcenter
    \fi\fi\fi
    \@parboxto{\let\hss\vss\let\unhbox\unvbox
       \csname bm@#3\endcsname}%
    \if@pboxsw \m@th$\fi
  \@end@tempboxa}
\HLet\@iiiparbox|=\:temp
>>>

\<hide parbox math\><<<
\expandafter\everymath\expandafter{\expandafter
           \everymath\expandafter{\the\everymath}}%
>>>

\<old @iiiparbox\><<<
\@empty >>>

\<new @iiiparbox\><<<
\relax >>>

\Chapter{latex209.def}

\<latex209.4ht\><<<
% latex209.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
\let\:fnsymbol\@fnsymbol
\def\@fnsymbol#1{{\hbox{$\:fnsymbol{#1}$}}}
\Hinput{latex209}
>>>        \AddFile{5}{latex209}

         
\Chapter{Sectioning Commands}

   

\ifHtml[\HPage{more}\Verbatim

 >   (5.5.2.1) "likesection" instead of "section*"? Technically I don't
 > see offhand why this non-intuitive substitution should be necessary.

I always hated this part, and I hope I'll have enough time to fix it
before the text will go out of my hand for publication.
(Historically, I introduced the \like... commands to save the users
employing code like \expandafter\foo\csname ...*\endcsname.  I suspect
that historical reason is not valid anymore.)

-eitan

CAN'T, e.g., :

\Css{.sectionHead, .likesectionHead {
   text-align:right;
   font-family: cursive;
   border-bottom:solid 2px; }}

\EndVerbatim\EndHPage{}]\fi

\Section{Parts}

\<book / report / article\><<<
\ifx \part\:UnDef\else  
   |<html late parts|>
\fi
>>>

\<html late parts\><<<
\def\@part[#1]#2{%
    \ifnum \c@secnumdepth >-2\relax
      \SkipRefstepAnchor \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    }
>>>

The \''\@endpart' is not defined for \`'article' class.

The above is LaTeX's def without the output of titles.

\<html late parts\><<<
\let\:tempb|=\part
\Def:Section\part{\thepart}{#1} 
\let\:part|=\part
\let\part|=\:tempb
\let\no@part|=\@part
\def\@part[#1]#2{%
   {\let\addcontentsline|=\:gobbleIII\no@part[#1]{}}%
   \HtmlEnv   \Toc:Title{#1}\:part{#2}%
   \csname @endpart\endcsname%
 }
>>>

\<html late parts\><<<
\Def:Section\likepart{}{#1} 
\let\:likepart|=\likepart
\let\likepart|=\:UnDef
\let\no@spart|=\@spart
\def\@spart#1{%
   {\let\addcontentsline|=\:gobbleIII\no@spart{}}%
   \HtmlEnv   \:likepart{#1}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Configurations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Verbatim
\renewcommand\thesubsubsection {\thesubsection .\arabic{subsubsection}}
\renewcommand\theparagraph     {\thesubsubsection.\arabic{paragraph}}
\renewcommand\thesubparagraph  {\theparagraph.\arabic{subparagraph}}
\EndVerbatim

\Section{Chapters, Appendixes, and Like Chapters}

We can test for \''\@chapter', but not fo   \''\chapter', to
check whether the unit exists. fancyheadings.sty
changes the latter into \''\relax'.

\<chapters for book / report\><<<
\let\:tempb|=\chapter
\Def:Section\chapter{\thechapter}{#1} 
\let\:chapter|=\chapter
\let\chapter|=\:tempb
\def\@makechapterhead#1{}
\let\no@chapter|=\@chapter
\def\@chapter[#1]#2{%
   |<adjust minipageNum for setcounter footnote 0|>%
   {\SkipRefstepAnchor \let\addcontentsline|=\:gobbleIII\no@chapter[#1]{}}%
   \HtmlEnv   \Toc:Title{#1}\:chapter{#2}}
>>>

\<chapters for book / report\><<<
\Def:Section\likechapter{}{#1} 
\let\:likechapter|=\likechapter
\let\likechapter|=\:UnDef
\let\no@schapter|=\@schapter
\def\@schapter#1{%
   |<star ch title|>%
   {\let\addcontentsline|=\:gobbleIII\no@schapter{}}%
   \HtmlEnv   \:likechapter{#1}}
>>>

\<chapters for book / report\><<<
\let\no@appendix|=\appendix
\Def:Section\appendix{\thechapter}{#1} 
\let\:appendix|=\appendix
\def\appendix{%
   \def\@chapter[##1]##2{%
      |<adjust minipageNum for setcounter footnote 0|>%
      {\def\addcontentsline####1####2####3{}\no@chapter[##1]{}}%
      \HtmlEnv \Toc:Title{##1}\:appendix{##2}}%
   \no@appendix}
>>>

\<html latex divs\><<<
\def\Toc:Title#1{\gdef\TocTitle{#1}%
  \ifx\TocTitle\empty \global\let\TocTitle|=\:UnDef\fi}
>>>

If defined, the \''\TocTitle' carries  the info in the
square brackets of \`'\@chapter[##1]##2{...',
\`'\@section[##1]##2{...', etc.

\Verbatim
> I discovered that TeX4ht uses some literal strings, like "Chapter"
> for the name of the chapters. This causes an incompatibility with
> the package Babel (for typesetting documents in other languages than
> english). LaTeX uses the command \chaptername for storing the string
> "Chapter", and babel redefines this command in a convenient way for
> each language (in spanish, \chaptername is "Cap\'{\i}tulo"). Since
> TeX4ht does not use the \chaptername, its output is always
> "Chapter", which is inconvenient for non-english users. I don't know
> if TeX4ht uses other literal strings, I only noticed this one.
\EndVerbatim

\ifHtml[\HPage{more}\Verbatim
book.cls:\newcommand\contentsname{Contents}
book.cls:\newcommand\listfigurename{List of Figures}
book.cls:\newcommand\listtablename{List of Tables}
book.cls:\newcommand\bibname{Bibliography}
book.cls:\newcommand\indexname{Index}
book.cls:\newcommand\figurename{Figure}
book.cls:\newcommand\tablename{Table}
book.cls:\newcommand\partname{Part}
book.cls:\newcommand\chaptername{Chapter}
book.cls:\newcommand\appendixname{Appendix}
\EndVerbatim\EndHPage{}]\fi

\Section{Sections and Like Sections}

\<book / report / article\><<<
\ifx \section\:UnDef\else  
   |<html late sections|>
\fi
>>>

\<html late sections\><<<
\let\no@section|=\section
\Def:Section\section{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesection \fi}{#1} 
\let\no:section|=\section
\def\section{\rdef:sec{section}}
\Def:Section\likesection{}{#1} 
\let\:likesection|=\likesection
\let\likesection|=\:UnDef
>>>

\SubSection{Configurations}

%\Configure{sectionTITLE+}{\ifnum \c:secnumdepth>\c@secnumdepth
%    \else \thesection \space \fi#1}

\Section{SubSections}

\<book / report / article\><<<
|<subsections for book / report / article|>
>>>

\<subsections for book / report / article\><<<
\let\no@subsection|=\subsection
\Def:Section\subsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsection \fi}{#1}
\let\no:subsection|=\subsection
\def\subsection{\rdef:sec{subsection}}
\Def:Section\likesubsection{}{#1} 
\let\:likesubsection|=\likesubsection
\let\likesubsection|=\:UnDef
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Configurations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% \Configure{subsectionTITLE+}
%   {\ifnum \c:secnumdepth>\c@secnumdepth
%    \else \thesubsection \space \fi#1}

\Section{SubSubSections}

\<book / report / article\><<<
|<subsubsections for book / report / article|>
>>>

\<subsubsections for book / report / article\><<<
\let\no@subsubsection|=\subsubsection
\Def:Section\subsubsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsubsection \fi}{#1}
\let\no:subsubsection|=\subsubsection
\def\subsubsection{\rdef:sec{subsubsection}}
\Def:Section\likesubsubsection{}{#1} 
\let\:likesubsubsection|=\likesubsubsection
\let\likesubsubsection|=\:UnDef
>>>

\SubSection{Configurations}

\`'<H5>' might use too small chars

% \Configure{subsubsectionTITLE+}
%   {\ifnum \c:secnumdepth>\c@secnumdepth
%    \else \thesubsubsection \space \fi#1}

\Section{Paragraphs and Sub-Paragraphs}

\<book / report / article\><<<
|<paragraphs for book / report / article|>
>>>

\<paragraphs for book / report / article\><<<
\let\no@paragraph|=\paragraph
\Def:Section\paragraph{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \theparagraph \fi}{#1}
\let\no:paragraph|=\paragraph
\def\paragraph{\rdef:sec{paragraph}}
\Def:Section\likeparagraph{}{#1} 
\let\:likeparagraph|=\likeparagraph
\let\likeparagraph|=\:UnDef
>>>

\<paragraphs for book / report / article\><<<
\let\no@subparagraph|=\subparagraph
\Def:Section\subparagraph{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubparagraph \fi}{#1}
\let\no:subparagraph|=\subparagraph
\def\subparagraph{\rdef:sec{subparagraph}}
\Def:Section\likesubparagraph{}{#1} 
\let\:likesubparagraph|=\likesubparagraph
\let\likesubparagraph|=\:UnDef
>>>

\SubSection{Configurations}

\<latex shared div config\><<<
\ifx\bf\:UnDef 
   \def\bf{\normalfont\bfseries}
\fi
>>>

\Section{Options 1, 2, 3 for LaTeX}

\''\:tempa' is everywhere, so we use it to conditionally call
to \''\tableofcontents' throug attachments points when tex4ht
any of the options is on.

\<latex options 1, 2, 3\><<<
\NewConfigure{tableofcontents*}[1]{%
   \def\:tempa{#1}\ifx\empty\:tempa
      \ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
   \else
      \edef\auto:toc{#1}%
         \ifx \au:StartSec\:UnDef
            \let\au:StartSec|=\:StartSec   
            \def\:StartSec{\:tableofcontents
               \global\let\auto:toc|=\:UnDef \global\let\:StartSec\au:StartSec\:StartSec}%
            \append:def\tableofcontents{\gdef\:StartSec{\au:StartSec}}%
   \fi  \fi
}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Encodings}
%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%
\Section{t2benc}
%%%%%%%%%%%%%%%%%%

\<t2benc.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% t2benc.4ht                            |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{t2benc}
\endinput
>>>        \AddFile{8}{t2benc}

%%%%%%%%%%%%%%%%%%
\Section{ot4enc}
%%%%%%%%%%%%%%%%%%

\<ot4enc.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ot4enc.4ht                            |version %
% Copyright (C) |CopyYear.2005.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{ot4enc}
\endinput
>>>        \AddFile{9}{ot4enc}

%%%%%%%%%%%%%%%%%%
\Section{pd1enc}
%%%%%%%%%%%%%%%%%%

\<pd1enc.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% pd1enc.4ht                            |version %
% Copyright (C) |CopyYear.2005.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{pd1enc}
\endinput
>>>        \AddFile{9}{pd1enc}

%%%%%%%%%%%%%%%%%%%%%
\Section{inputenc}
%%%%%%%%%%%%%%%%%%%%%

\<inputenc.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% inputenc.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\def\temp#1{\o:IeC:{\protect#1}}
\HLet\IeC=\temp

\Hinput{inputenc}
\endinput
>>>        \AddFile{4}{inputenc}

Needed in, for instance, the definition \''\IeC {\^\i }' of \^i under
\''\edef'.

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{More LaTeX}
%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{/listoffigures and /listoftables}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<html report, article, book\><<<
\let\:tempc|=\listoffigures
\pend:def\:tempc{\begingroup \a:listoffigures
   \def\@starttoc{\:tableofcontents[lof]\:gobble}}
\append:def\:tempc{\b:listoffigures \endgroup}
\HLet\listoffigures|=\:tempc
\let\:tempc|=\listoftables
\pend:def\:tempc{\begingroup \a:listoftables
   \def\@starttoc{\:tableofcontents[lot]\:gobble}}
\append:def\:tempc{\b:listoftables \endgroup}
\HLet\listoftables|=\:tempc
>>>

\<latex report,... shared config\><<<
\NewConfigure{listoffigures}{2} 
\NewConfigure{listoftables}{2}  
>>>

\Section{Newline and Vspace}

Latex uses vrule for vertical spaces within paragraph.  In orser
not to break paragraphs, we put line breaks.  So, for instance, 
centered paragraphs retain their shapes.

\`'\\[...]' and \''\\*[...]', in normal mode, are
 implied from \''\@xnewline', and in turn on \`'\newline' and \''\vspace'.
More recent definitions of latex rely on \''\@gnewline'.

\Verbatim
\documentclass{article}  
\begin{document}  
  
Try \\[1mm]| this.
  
\end{document}  
\EndVerbatim

\<latex 1999\><<<
\ifx \@gnewline\:UnDef
   \append:def\newline{\ifhmode \a:newline\fi}
   \def\@newline[#1]{\ifhmode\unskip
          \tmp:dim=#1\relax
          \ifdim \tmp:dim>0.98\smallskipamount \a:newline\fi
      \fi\vspace{#1}\newline}
\else   
   \let\:tempc\@gnewline
   \pend:defI\:tempc{\ht:special{t4ht@[}}
   \append:defI\:tempc{\ht:special{t4ht@]}\ifhmode \a:newline\fi}
   \HLet\@gnewline\:tempc
   \def\:temp[#1]{{\ifhmode\unskip
          \tmp:dim=#1\relax
          \ifdim \tmp:dim>0\smallskipamount \a:newline\fi  
          \let\a:newline|=\empty
      \fi\vspace{#1}\o:@newline:[#1]}}
   \HLet\@newline|=\:temp
\fi
>>>

The recent latex.ltx file introduced the code

\Verbatim
   \global\let\if@newlist\@@if@newlist
\EndVerbatim

at the end of the \''\@outputpage' macro.  In the case of plain latex, I
suspect, the task of this code is to avoid extra vertical space before
a list which starts at the top of a page.  This effect is achieved by
having the \''\if@newlist' changing to false from true at the page break.

In the case of tex4ht, the side effect of losing the list header
caused also the loss of the code \''<ul>'.

Latex 200 introduces \`'\global\let\if@newlist\@@if@newlist' at the
end of the \''\@outputpage' routine.
Without the following, we loose start of new lists at top of pages. 

\<latex 2000\><<<
\ifx \@@if@newlist\:UnDef \else
  \pend:def\@outputpage{\expandafter\global \expandafter\let
      \expandafter\@@if@newlist\csname if@newlist\endcsname}
\fi
>>>

\<config latex.ltx utilities\><<<
\NewConfigure{newline}{1}
>>>

We can't play with the following because we may get extra \''<BR>'s
for paragraph breaks \''<P>'.

\Verbatim
    \let\:vspace|=\@vspace
    \let\:vspacer|=\@vspacer
    \def\@vspace#1{\vsp:br{#1}\:vspace{#1}}
    \def\@vspacer#1{\vsp:br{#1}\:vspacer{#1}}
    \def\vsp:br#1{\ifhmode 
          \ifdim #1>0.98\smallskipamount \HCode{<BR>}\fi
       \fi }
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Title Page}
%%%%%%%%%%%%%%%%%%%%%%%%

%      \Configure{@classz}{}{}{}{}%

\<redefine maketitle\><<<
\let\o:maketitle:|=\maketitle
\def\maketitle{\bgroup 
   |<adjust minipageNum for setcounter footnote 0|>%
   \ifx \EndPicture\:UnDef  
      \def\sec:typ{title}%
      \Configure{HtmlPar}{}{}{}{}%
      \Configure{newpage}{}%
      \ConfigureEnv{center}{\empty}{}{\empty}{\empty}
      |<maketable save tabular|>%
      \Configure{HBorder}{}{}{}{}{}{}{}{}{}{}%
      \Configure{tabular}{}{}{}{\e:mktl}
        {\bgroup |<maketable recall tabular|>}{\egroup}
      \ConfigureEnv{tabular}{\empty}{}{}{}%
      |<title for TITLE|>%
      \pend:def\@title{\a:ttl}\append:def\@title{\b:ttl}%
      \pend:def\@date{\a:date}\append:def\@date{\b:date}%
      \pend:def\@author{\a:author}\append:def\@author{\b:author}%
      |</and for maketitle|>%
   \fi 
   \pic:gobble\a:mktl  \o:maketitle:  \pic:gobble\b:mktl
   \egroup \let\maketitle|=\empty}
>>>

\<maketable save tabular\><<<
\let\a:tabular:sv|=\a:tabular \let\b:tabular:sv|=\b:tabular
\let\c:tabular:sv|=\c:tabular \let\d:tabular:sv|=\d:tabular
\let\e:tabular:sv|=\e:tabular \let\f:tabular:sv|=\f:tabular
\let\before:begintabular:sv|=\before:begintabular
>>>

\<maketable recall tabular\><<<
\let\a:tabular|=\a:tabular:sv \let\b:tabular|=\b:tabular:sv
\let\c:tabular|=\c:tabular:sv \let\d:tabular|=\d:tabular:sv
\let\e:tabular|=\e:tabular:sv \let\f:tabular|=\f:tabular:sv
\let\before:begintabular|=\before:begintabular:sv
>>>

Old latex files need \''\no:fonts', but not new ones.---wrong, as far as writing to toc in 0.0?

\</and for maketitle\><<<
\def\and{\a:and}
>>>

\<redefine maketitle\><<<
\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
   \c:def\a:ttl{#3}\c:def\b:ttl{#4}}
\NewConfigure{thanks author date and}[8]{%
   \c:def\a:thanks{#1}\c:def\b:thanks{#2}\c:def\a:author{#3}\c:def\b:author{#4}%
   \c:def\a:date{#5}\c:def\b:date{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}
>>>

\`'<H..>' with nested fonts doesn't work nicely in NetScape.

\ifHtml[\HPage{more}\Verbatim
\documentstyle{article}

\title{A B and C}
\author{X \and Y}

\input tex4ht.sty \Preamble{html}
        \begin{document}
     \EndPreamble

 \maketitle

\end{document}
\EndVerbatim\EndHPage{}]\fi

\Section{Multi Columns}

\SubSection{xx}

\Verbatim
\CssFile
P.border {  clear: both ; }
span.tcgroup { width: 80\% ; display: block ; float: left ; }
span.title {  padding-left: 10\% ;  width: 100\% ; }
span.nodisp {display: none ; }
span.jrnl {   padding-left: 20\% ;  width: 100\% ; }
span.altgroup {   width: 18\% ;  display: block ;  float: right }
.filesize {   width: 100\% ;  font-style: italic ;  float: left ; }
.artlinks {   width: 100\% ;  clear: left ; }
\EndCssFile

\HCode{
<P class="border">
  <span class="author">xx, xx<span class="nodisp">,</span></span>
  <span class="tcgroup">
  <span class="title"><span class="nodisp">"</span>Toward a 
       xyz<span class="nodisp">,"</span></span>
  <span class="jrnl">74 <cite>abc.</cite> (1969): 12-51<span class="nodisp">.</span></span>
</span>
<span class="altgroup">
   <span 
       class="filesize"><em>107k</em></span><span class="nodisp">,</span>
   <span class="artlinks">[<A HREF=uuu.html>HTML</A>]\ [<A 
      HREF=foo.rtf>RTF</A>]</span>
</span>
</P>
}

\EndVerbatim

\SubSection{xx}

\Verbatim

DIV.left
     {                        
      width: 33%;
      float: left;
      text-align: left;
      padding:  0 1em 0 1em;
          
     }
DIV.middle
     {
      width: 33%;
      float: left;
      text-align: left;
      padding: 0 1em 0 1em;
     }
DIV.right
     {
      width: 33%;
      float: left;
      text-align: left;
      padding: 0 1em 0 1em;
     }
\EndVerbatim

%%%%%%%%%%%%%%
\Part{LaTeX Classes}
%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Book.cls, Report.cls, Article.cls}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<book / report / article\><<<
  |<html report, article, book|>
  |<latex report,... shared config|>
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{memoir}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{memoir}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<memoir.4ht\><<<
% memoir.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2003. Eitan M. Gurari
% Copyright 2003-2024 TeX Users Group
|<TeX4ht copywrite|>
\input book.4ht
\input verse.4ht
\let\columnlines\empty

|<memoir cfg|>
\ifx \memgobble\:UnDef
   |<memoir pre 2008|>
\else 
   |<memoir 2008|>
   |<mempatch cfg|>
\fi
|<latex caption index optional|>
\Hinput{memoir}
\endinput
>>>        \AddFile{8}{memoir}

\<memoir cfg\><<<
\let\rm\empty
\let\sf\empty
\let\tt\empty
\let\bf\empty
\let\it\empty

\renewcommand*{\@memoldfonterr}[3]{}
\renewcommand*{\@memoldfontwarn}[3]{}


\def\@chapter[#1]#2{%
   |<adjust minipageNum for setcounter footnote 0|>%
   {\SkipRefstepAnchor \let\addcontentsline\:gobbleIII\no@chapter[#1]{}%
    \global\let\f@rtoc\f@rtoc
    \ifx\f@rtoc\empty\gdef\f@rtoc{#2}\fi
    \global\let\f@rhdr\f@rhdr  }%
   \HtmlEnv   \Toc:Title{\f@rtoc}\:chapter{#2}}
>>>

Memoir supports starred version ot the TOC command

\<memoir cfg\><<<
\def\:tempc{\@ifstar\o:tableofcontents:\o:tableofcontents:}
\HLet\tableofcontents\:tempc
>>>

Support for the \Verb=\book= command
\<memoir cfg\><<<
\Def:Section\book{\thebook}{#1}
>>>

Memoir reimplements abstract.sty 

\<memoir cfg\><<<
|<abstract.sty conf|>
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{abstract}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<abstract.4ht\><<<
% abstract.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
|<abstract.sty conf|>
\Hinput{abstract}
\endinput
>>> \AddFile{8}{abstract}

\<abstract.sty conf\><<<
\NewConfigure{abstracttitle}{2}
\newenvironment{abstracttitle4ht}{\a:abstracttitle}{\b:abstracttitle\par\noindent}
% get rid of all extra <span> elements introduced by smaller font size
% \renewcommand{\abstracttextfont}{\normalfont}
% \renewcommand{\abstractnamefont}{\normalfont}
% use our dummy environment to insert tags around the abstract title
\renewcommand{\absnamepos}{abstracttitle4ht}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{verse}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<verse.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% verse.4ht                             |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<verse cfg|>
\Hinput{verse}
\endinput
>>>        \AddFile{8}{verse}

\<verse cfg\><<<
\def\@vsptitle[#1]#2{%
  |<memoir verse title|>%
  \a:poemtitle
  \addcontentsline{toc}{\poemtoc}{#1}
  \poemtitlemark{#1}%
  \b:poemtitle
  \@vstypeptitle{#2}%
  \c:poemtitle
  \@afterheading}
\def\@vssptitle#1{%
  \a:likepoemtitle
  \@vstypeptitle{#1}%
  \b:likepoemtitle
  \@afterheading}
\NewConfigure{poemtitle}{3}
\NewConfigure{likepoemtitle}{2}
>>>

\<verse cfg\><<<   
\pend:def\@vscentercr{%
   \let\incr:vsline\incr@vsline
   \def\incr@vsline{\let\incr@vsline\incr:vsline}%
}
\pend:def\start@vsline{\a:verseline  \incr@vsline}
\renewcommand{\@vsifbang}[1]{\@ifnextchar !{%
   \b:verseline\incr@vsline \@firstoftwo{#1}}}
\expand:after{\let\sv:verse}\csname \string\verse\endcsname
\expandafter\def\csname \string\verse\endcsname[#1]{%
   \let\:temp\refstepcounter
   \def\refstepcounter##1\let{\let\refstepcounter\:temp\let}%
   \sv:verse[#1]%
   \a:verseline  |<memoir verse counter|>%
   \setcounter{poemline}{0}%
   \setcounter{vslineno}{1}%
   \incr@vsline
}
\NewConfigure{verseline}{2}
>>>

\<memoir verse counter\><<<
\expandafter\ifx \csname c@verse\endcsname\relax \else
   \refstepcounter{verse}%
\fi
>>>

\<memoir verse title\><<<
\csname phantomsection\endcsname
>>>

\<verse cfg\><<<   
\pend:defI\flagverse{\a:flagverse}
\append:defI\flagverse{\b:flagverse}
\NewConfigure{flagverse}{2}
>>>

\<memoir pre 2008\><<<
\pend:defI\getthelinenumber{%
   \let\sv:thepoemline\thepoemline
   \pend:def\thepoemline{\a:poemline}%
   \append:def\thepoemline{\b:poemline}}
\append:defI\getthelinenumber{\let\thepoemline\sv:thepoemline}
>>>

\<memoir 2008\><<<
\pend:defII\getthelinenumber{%
   \let\sv:thepoemline\thepoemline
   \pend:def\thepoemline{\a:poemline}%
   \append:def\thepoemline{\b:poemline}}
\append:defII\getthelinenumber{\let\thepoemline\sv:thepoemline}
>>>

\<memoir cfg\><<<
\NewConfigure{poemline}{2}
>>>

\<memoir cfg\><<<
\NewConfigure{legend}{2}
\renewcommand\legend[1]{\a:legend #1\b:legend}
>>>

There is a clash between Memoir and Hyperref, as it uses the
Hfootnote counter, which isn't declared. 

\<memoir cfg\><<<
\@ifpackageloaded{hyperref}{%
\ifHy@hyperfootnotes
\Hy@hyperfootnotesfalse
\newcounter{Hfootnote}
\fi
}{}
>>>

Indexing support for Memoir. It supports split index like functionality,
but quite complicatedly using aux files. This version produces idx file
in the format expected by make4ht for the splitindex support.

PS: I had to double the \''|' characters in the macro definition, otherwise
they were stripped by the literate programming system. 

\<memoir cfg\><<<
\def\:tempa#1||#2||#3\\{%
  \html:addr\hbox{\Link-{}{dx\last:haddr}\EndLink}%
  \expandafter\protected@write\csname \jobname @idxfile\endcsname{}{\string\beforeentry{\RefFileNumber\FileNumber}{dx\last:haddr}{}}%
  \expandafter\protected@write\csname \jobname @idxfile\endcsname{}{\string\indexentry[\@idxfile]{#1}{\thepage}}%
  \endgroup%
  \@esphack%
}
\HLet\@@wrindexhyp\:tempa
\HLet\@@wrspindexhyp\:tempa

% we use make4ht's splitindex functionality, which produces .ind files in the form of \jobname-idxname.ind
\renewcommand{\printindex}[1][\jobname]{\@input@{\jobname-#1.ind}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{mempatch}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<mempatch.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% mempatch.4ht                          |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<mempatch cfg|>
\Hinput{mempatch}
\endinput
>>>        \AddFile{8}{mempatch}

\<mempatch cfg\><<<
\let\no@Msect\M@sect
\NewConfigure{@sec @ssect}[1]{%
   \def\rdef:sec##1{#1\csname no@##1\endcsname}}
\:CheckOption{sections-}     \if:Option
   \Configure{@sec @ssect}{}
\else
   \Configure{@sec @ssect}{%
      |<sv Sc, sec, ssec|>\let\:Sc|=\:gobble
      |<redf memior sec|>%
      |<redf sec|>%
      |<redf ssec|>\IgnorePar}
\fi
>>>

\<redf memior sec\><<<
\def\M@sect##1##2##3##4##5##6[##7][##8]##9{%
   |<disable @seccntformat|>%
   \let\M@sect\no@Msect   \xdef\c:secnumdepth{##2}%
   {\SkipRefstepAnchor \let\addcontentsline\:gobbleIII \let\mark\:gobble
    \no@Msect{##1}{##2}{##3}{##4}{##5}{##6}[{##7}][{##8}]{}}%
   |<recall Sc, sec, ssec|>%
   |<restore @seccntformat|>%
   \HtmlEnv    \Toc:Title{##8}\csname no:#1\endcsname{##9}}%
>>>

\<sv Sc, sec, ssec\><<<
\let\sv:Msect|=\M@sect
>>>

\<recall Sc, sec, ssec\><<<
\let\M@sect|=\sv:Msect
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{memhfixc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<memhfixc.4ht\><<<
% memhfixc.4ht (|version), generated from |jobname.tex 
|<TeX4ht copywrite|>
|<memhfixc nameref|>
\Hinput{memhfixc}
\endinput
>>>        \AddFile{8}{memhfixc}

Memoir redefines the nameref command in a way that it prints ref number instead
of the desired title. This should fix that, and in addition it should fix the
titleref command.

\<memhfixc nameref\><<<
\@ifpackageloaded{nameref}{
\HLet\@mem@titlerefnolink\@namerefstar
\HLet\@mem@titleref\T@nameref
}{}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{revtex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[ftp://ftp.aip.org/revtex]{}{}REVTeX 3.0 from the American Institute of Physics,\EndLink,
\Link[http://publish.aps.org/revtex4/]{}{}REVTeX 4 Home Page\EndLink

\<revtex4.4ht\><<<
% revtex4.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2002. Eitan M. Gurari
|<TeX4ht copywrite|>
|<revtex4 configs|>
\Hinput{revtex4}
\endinput
>>>        \AddFile{9}{revtex4}

\<aps.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% aps.4ht                               |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<aps configs|>
\Hinput{aps}
\endinput
>>>        \AddFile{9}{aps}

\<revsymb.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% revsymb.4ht                           |version %
% Copyright (C) |CopyYear.2009.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<revsymb configs|>
\Hinput{revsymb}
\endinput
>>>        \AddFile{9}{revsymb}

\<revsymb configs\><<<
\MathSymbol\mathrel{REV@lesssim } 
\MathSymbol\mathrel{REV@gtrsim } 
\MathSymbol\mathord{openone } 
\MathSymbol\mathrel{altsuccsim } 
\MathSymbol\mathrel{altprecsim } 
\MathSymbol\mathrel{corresponds } 
>>>

\<revtex4 configs\><<<
|<@array@array@new group|>
|<@array@ltx group|>
>>>

\List{}

\item{@array@array@new group}

\Verbatim
 \let\@array    \@array@array@new 
 \let\@@array   \@array 
 \let\@tabular  \@tabular@array@new 
 \let\@tabarray \@tabarray@array@new 
 \let\array     \array@array@new 
 \let\endarray  \endarray@array@new 
 \let\endtabular\endtabular@array@new 
 \let\@mkpream  \@mkpream@array@new 
 \let\@classx   \@classx@array@new 
 \let\@arrayacol\@arrayacol@ltx 
 \let\@tabacol  \@tabacol@ltx 
 \let\insert@column\insert@column@array@new 
 \expandafter\let\csname endtabular*\endcsname\endtabular 
 \let\@arraycr  \@arraycr@new 
 \let\@xarraycr \@xarraycr@new 
 \let\@xargarraycr\@xargarraycr@new 
 \let\@yargarraycr\@yargarraycr@new 
\EndVerbatim

\item{@array@ltx group}

\Verbatim
 \let\@array\@array@ltx 
 \let\multicolumn\multicolumn@ltx 
 \let\@tabular\@tabular@ltx 
 \let\@tabarray\@tabarray@ltx 
 \let\array\array@ltx 
 \let\endarray\endarray@ltx 
 \let\endtabular\endtabular@ltx 
 \let\@mkpream\@mkpream@ltx 
 \let\@addamp\@addamp@ltx 
 \let\@arrayacol\@arrayacol@ltx 
 \let\@tabacol\@tabacol@ltx 
 \let\@arrayclassz\@arrayclassz@ltx 
 \let\@tabclassiv\@tabclassiv@ltx 
 \let\@arrayclassiv\@arrayclassiv@ltx 
 \let\@tabclassz\@tabclassz@ltx 
 \let\@classv\@classv@ltx 
 \let\hline\hline@ltx 
 \let\@tabularcr\@tabularcr@ltx 
 \let\@xtabularcr\@xtabularcr@ltx 
 \let\@xargarraycr\@xargarraycr@ltx 
 \let\@yargarraycr\@yargarraycr@ltx
\EndVerbatim

\EndList

\<@array@array@new group\><<<
\def\:tempc[#1]#2{%
%\hshow{@array@array@new--222}%
  |<init conds for @mkpream|>% 
  \@tempdima\ht\strutbox 
  \advance\@tempdima by\extrarowheight 
  \setbox\@arstrutbox\hbox{}% 
  \begingroup 
     \@mkpream{#2}% 
     \xdef\@preamble{%
        |<ialign for html @array|>}%     
     |<globalize ar:cnt for array.sty|>%
  \endgroup 
  \@arrayleft 
  \@nameuse{@array@align@#1}% 
     \def\v:TBL{#1}%
     \m@th 
     \let\\\@arraycr \let\tabularnewline\\\let\par\@empty 
     \ifx \EndPicture\:UnDef
       \SaveMkHalignConfig 
       |<@array configuration for MkHalign|>%
       |<modefied @array config|>%
     \else \let\@sharp|=##\fi  
     \set@typeset@protect 
     \lineskip\z@\baselineskip\z@ 
     \@preamble\array@row@pre
}
\HLet\@array@array@new\:tempc
>>>

\<@array@ltx group\><<<
\def\:tempc[#1]#2{%
%\hshow{@array@ltx-22}% 
  |<init conds for @mkpream|>%
  \setbox\@arstrutbox\hbox{}%  
  \@nameuse{@array@align@#1}% 
     \@mkpream{#2}% 
     \expandafter\tmp:toks\expandafter=\expandafter{\@preamble}%
     \edef\@preamble{%
       \everycr{}\tabskip\z@skip\noexpand\MkHalign\noexpand\@sharp
       {\the\tmp:toks \tabskip\z@skip}%
     }%     
     \def\v:TBL{#1}%
     \let\tabularnewline\\\let\par\@empty 
     \ifx \EndPicture\:UnDef
       \SaveMkHalignConfig 
       |<@array configuration for MkHalign|>%
       |<modefied @array config|>%
     \else \let\@sharp|=##\fi  
     \set@typeset@protect 
     \lineskip\z@skip\baselineskip\z@skip 
     \ifhmode \@preamerr\z@ \@@par\fi 
     \@preamble\array@row@pre
}
\HLet\@array@ltx\:tempc
>>>

\<@array@array@new group \><<<
\def\:tempc{%
%\hshow{@tabular@array@new--22}%
  |<set hooks of tabular|>%
  \o:@tabular@array@new:
}
\HLet\@tabular@array@new\:tempc
>>>

\<@array@ltx group \><<<
\def\:tempc{% 
  |<set hooks of tabular|>%
%\hshow{@tabular@ltx--22}%
  \o:@tabular@ltx:
}
\HLet\@tabular@ltx\:tempc
>>>

\<@array@array@new group\><<<
\def\:tempc{%
%\hshow{array@array@new--22}%
   |<set hooks of array|>%
   \o:array@array@new:} 
\HLet\array@array@new=\:tempc 
\def\:tempc{\relax \ifnum\HCol=1 \a:endarray\fi
   \enda:rray}
\HLet\endarray@array@new\:tempc
>>>

\<@array@ltx group\><<<
\def\:tempc{%
%\hshow{array@ltx-2}%
   |<set hooks of array|>%
   \o:array@ltx:} 
\HLet\array@ltx=\:tempc
\def\:tempc{\relax 
   \ifx \HCol\:UnDef \else \ifnum\HCol=1 \a:endarray\fi \fi
   \crcr\ifx \EndPicture\:UnDef \EndMkHalign
   \else \egroup\fi \egroup}
\HLet\endarray@ltx\:tempc
>>>

\<@array@ltx group\><<<
\long\def\:temp#1#2#3{\multispan{#1}\a:multicolumn \begingroup  
%\hshow{multicolumn@ltx--2}%
  |<add Row.Col<-> to new:span|>%
  \def\@sharp{\c:multicolumn#3\d:multicolumn}\set@typeset@protect
  \let\@startpbox\@@startpbox\let\@endpbox\@@endpbox
  \@arstrut \@preamble\hbox{}\endgroup \b:multicolumn \ignorespaces}
\HLet\multicolumn@ltx|=\:temp
>>>

\<@array@ltx group\><<<
\def\:temp{\a:hline}
\HLet\hline@ltx|=\:temp
>>>

\<revtex4 configs\><<<
\let\twocolumngrid\onecolumngrid   
\let\@twocolumntrue\@twocolumnfalse   
\@booleanfalse\twocolumn@sw    
>>>

\<revtex4 configs\><<<
\def\titleblock@produce{% 
 \a:mktl \par
 \begingroup 
     \pend:def\frontmatter@above@affilgroup{%
        \pend:def\@AAC@list{\a:author}%
        \append:def\@AAC@list{\b:author}%
     }%
     \ifx \@date\empty\else
        \pend:def\@date{\a:date}%
        \append:def\@date{\b:date}%
     \fi
     \ifx \@received\empty\else
        \pend:def\@received{\a:received}%
        \append:def\@received{\b:received}%
     \fi
     \ifx \@revised\empty\else
        \pend:def\@revised{\a:revised}%
        \append:def\@revised{\b:revised}%
     \fi
     \ifx \@accepted\empty\else
        \pend:def\@accepted{\a:accepted}%
        \append:def\@accepted{\b:accepted}%
     \fi
     \ifx \@accepted\empty\else
        \pend:def\@published{\a:published}%
        \append:def\@published{\b:published}%
     \fi
  \let\footnote\footnote@latex 
  \let\@makefnmark\@makefnmark@latex 
  \let\@footnotemark\@footnotemark@latex 
  \let\thefootnote\frontmatter@thefootnote 
  \global\c@footnote\z@ 
  \let\@makefnmark\frontmatter@makefnmark 
  \frontmatter@setup 
  \thispagestyle{titlepage}%
  \par \a:ttl \label{FirstPage}\par 
  \frontmatter@title@produce 
  \b:ttl \par
  \groupauthors@sw{% 
   \frontmatter@author@produce@group 
  }{% 
   \frontmatter@author@produce@script 
  }% 
  \par \a:RRAPformat\par
  \frontmatter@RRAPformat{% 
   \expandafter\produce@RRAP\expandafter{\@date}% 
   \expandafter\produce@RRAP\expandafter{\@received}% 
   \expandafter\produce@RRAP\expandafter{\@revised}% 
   \expandafter\produce@RRAP\expandafter{\@accepted}% 
   \expandafter\produce@RRAP\expandafter{\@published}% 
  }% 
  \par\b:RRAPformat
  \frontmatter@abstract@produce
  \showPACS@sw{%
     \pend:defI\@pacs@produce{\par\a:pacs\par}%
     \append:defI\@pacs@produce{\par\b:pacs\par}%
  }{}% 
  \@pacs@produce\@pacs 
  \showKEYS@sw{%
     \pend:defI\@keywords@produce{\par\a:keywords\par}%
     \append:defI\@keywords@produce{\par\b:keywords\par}%
  }{}% 
  \@keywords@produce\@keywords 
  \par 
  \a:frontpagefootnote
  \minipagefootnote@here
  \b:frontpagefootnote
  \par
  \frontmatter@finalspace 
  |<adjust minipageNum for setcounter footnote 0|>%
 \endgroup 
 \b:mktl \par
}% 
>>>

\<revtex4 configs\><<<
\append:def\minipagefootnote@pick{%
  |<adjust minipageNum for setcounter footnote 0|>%
}
\append:def\ruledtabular{%
  |<adjust minipageNum for setcounter footnote 0|>%
}
>>>

\<revtex4 configs\><<<
\NewConfigure{RRAPformat}{2}
\NewConfigure{received}{2}
\NewConfigure{revised}{2}
\NewConfigure{accepted}{2}
\NewConfigure{published}{2}
\NewConfigure{pacs}{2}
\NewConfigure{keywords}{2}
\NewConfigure{frontpagefootnote}{4}
>>>

\<revtex4 configs\><<<
\NewConfigure{maketitle}[4]{\def\a:mktl{#1}\def\b:mktl{#2}%
   \def\a:ttl{#3}\def\b:ttl{#4}}
\NewConfigure{thanks author date and}[8]{%
   \c:def\a:thanks{#1}\c:def\b:thanks{#2}%
   \c:def\a:author{#3}\c:def\b:author{#4}%
   \c:def\a:date{#5}\c:def\b:date{#6}%
   \c:def\a:and{#7}\c:def\e:mktl{#8}}
>>>

\<revtex4 configs\><<<
\append:def\abstract{\a:abstract}
\pend:def\endabstract{\b:abstract}
\NewConfigure{abstract}{2}
>>>

\<revtex4 configs\><<<
\def\:tempc#1#2#3{\o:doauthor:{\a:doauthor#1\b:doauthor}{#2}{#3}}
\HLet\doauthor\:tempc
\NewConfigure{doauthor}{2}
>>>

\<revtex4 configs\><<<
\def\do@affil@fromgroup#1#2{% 
  \@ifx{\relax#2}{}{% 
    \count@#2\relax 
    \@ifnum{\count@=\z@}{}{\a:affil#1\b:affil}% 
    \do@affil@fromgroup#1% 
}}
\NewConfigure{affil}{2} 
>>>

\<revtex4 configs\><<<
\def\:temp{% 
  \@ifhmode{\skip@\lastskip\unskip\unpenalty\break
            \a:centercr\hskip\skip@}{}% 
}
\HLet\frontmatter@addressnewline\:temp
>>>

\<revtex4 configs\><<<
\def\@doendnote#1#2{\bibitem{#1}\a:endnote #2\b:endnote}
\NewConfigure{endnote}{2}
>>>

\<revtex4 configs\><<<
\def\NAT@bibsetnum#1{% 
   \setlength{\topsep}{\z@}% 
   \let\sv:rEfLiNK \rEfLiNK 
   \let\rEfLiNK \@secondoftwo 
   \NATx@bibsetnum{\ref{LastBibItem}}% 
   \let\rEfLiNK \sv:rEfLiNK 
}
\long\def\frontmatter@makefntext#1{% 
 \parindent 1em
 \c:frontpagefootnote \a:footnotetext 
 \noindent 
 \Hy@raisedlink{\hyper@anchorstart{frontmatter@\the
                                   \c@footnote}\hyper@anchorend}% 
 \@makefnmark 
 \b:footnotetext \a:footnotebody 
 #1% 
 \b:footnotebody \c:footnotetext \d:frontpagefootnote
}
>>>

\<revtex4 configs\><<<
\let\no@ssect@ltx=\@ssect@ltx
\def\@ssect@ltx#1#2#3#4#5{\:Sc3
   \no@ssect@ltx{#1}{#2}{#3}{#4}{\:Sc4#5\:Sc2}\HtmlEnv}
\let\no@sect@ltx=\@sect@ltx
\def\@sect@ltx#1#2#3#4#5#6[#7]#8{%
   \xdef\c:secnumdepth{#2}\:Sc3
   \no@sect@ltx{#1}{#2}{#3}{#4}{#5}{#6}[#7]{\:Sc4#8\:Sc2}\HtmlEnv}

\:CheckOption{sections-}     \if:Option 
   \Configure{@sec @ssect}{}
\else      
   \Configure{@sec @ssect}{%
      |<revtex4: sv Sc, sec, ssec|>\let\:Sc|=\:gobble
      |<revtex4: redf sec|>%
      |<revtex4: redf ssec|>\IgnorePar}
\fi

>>>

\<revtex4: redf sec\><<<
\def\@sect@ltx##1##2##3##4##5##6[##7]##8{%
   |<disable @seccntformat|>%
   \let\@sect@ltx=\no@sect@ltx   \xdef\c:secnumdepth{##2}%
   {\SkipRefstepAnchor \let\addcontentsline|=\:gobbleIII \let\mark|=\:gobble
    \no@sect@ltx{##1}{##2}{##3}{##4}{##5}{##6}[{##7}]{}}%
   |<revtex4: recall Sc, sec, ssec|>%
   |<restore @seccntformat|>%
   \HtmlEnv    \Toc:Title{##7}\csname no:#1\endcsname{##8}}%
>>>

\<revtex4: redf ssec\><<<
\def\@ssect@ltx##1##2##3##4##5##6[##7]##8{%
   |<star sec title|>%
   \let\@ssect@ltx=\no@ssect@ltx
   {\def\addcontentsline####1####2####3{}%
    \no@ssect@ltx{##1}{##2}{##3}{##4}{##5}{##6}[{##7}]{}}%
   |<revtex4: recall Sc, sec, ssec|>%
   \HtmlEnv   \csname :like#1\endcsname{##8}}%
>>>

\<revtex4: sv Sc, sec, ssec\><<<
\let\sv:Sc=\:Sc \let\sv:sect=\@sect@ltx \let\sv:ssect@ltx=\@ssect@ltx
>>>

\<revtex4: recall Sc, sec, ssec\><<<
\let\:Sc=\sv:Sc \let\@sect@ltx=\sv:sect \let\@ssect@ltx=\sv:ssect@ltx
>>>

\<revtex4 configs\><<<
|<html late parts|>
|<html late sections|>
|<subsections for book / report / article|>
|<subsubsections for book / report / article|>
|<paragraphs for book / report / article|>
>>>

\<revtex4 configs\><<<
\def\@array@align@c{% 
  \leavevmode\@ifmmode{\vcenter\bgroup}{\vbox\bgroup\aftergroup\relax}}% 
\def\@array@align@v{% 
 \@ifmmode{% 
  \@badmath 
  \vcenter\bgroup 
 }{% 
  \@ifinner{% 
   \vbox\bgroup 
  }{% 
   \@@par\bgroup 
  }% 
 }% 
}% 
>>>

\<revtex4 configs\><<<
\let\widetext\empty
\let\endwidetext\empty
>>>

\<revtex4 configs\><<<
\def\@xfloat #1[#2]{% 
    \def \@captype {#1}% 
   \:clearpage \bf:float \:clearpage 
   \begingroup 
      \expandafter\ifx\csname end#1\endcsname\o:end@float: 
         \expandafter\let\csname end#1\endcsname\float@end 
         \expandafter\let\csname end#1*\endcsname\float@dblend 
      \fi 
      \@parboxrestore 
      \reset@font  
      \normalsize   
      \everypar{\HtmlPar}% 
      \@xfloat@prep 
      \@nameuse{fp@proc@#2}% 
} 
\def\end@float{\endgroup  \:clearpage \af:float  \minipagefootnote@here} 
\let\end@dblfloat=\end@float 
>>>

\<revtex4 configs\><<<
\long\def\@makecaption#1#2{% 
  \par 
  \begingroup 
     \small\rmfamily 
     \flushing 
     \let\footnote\@footnotemark@gobble 
   {\cptA: \cap:ref{#1}\if :#1:\else\cptB:\fi}{\cptC:{#2}\cptD:}
  \endgroup 
  \par
}
\pend:def\caption{\SkipRefstepAnchor}
\NewConfigure{caption}[4]{\c:def\cptA:{#1}\c:def\cptB:{#2}%
   \c:def\cptC:{#3}\c:def\cptD:{#4}}
>>>

\<revtex4 configs\><<<
\pend:def\frontmatter@abstractheading{\a:abstractheading}
\append:def\frontmatter@abstractheading{\b:abstractheading}
\NewConfigure{abstractheading}{2}
\def\preprint#1{\a:preprint #1\b:preprint}
\NewConfigure{preprint}{2}
>>>

\<revtex4 configs\><<<
\def\p@subsection     {\thesection} 
\def\p@subsubsection  {\thesection\thesubsection} 
\def\p@paragraph      {\thesection\thesubsection\thesubsubsection} 
>>>

\<aps configs\><<<
\def\bib@device#1#2{% 
  \hb@xt@#1{\hfil \phantomsection 
     \addcontentsline {toc}{section}{\protect\numberline{}\refname}}}
>>>

\<aps configsNO\><<<
|<revtex3 aps math|>
|<revtex3 aps title page|>
|<revtex3 aps sections|>
|<revtex3 prabib 4ht|>
>>>

\<revtex3 prabib 4ht\><<<
\pend:def\references{\ifpreprintsty\else \ShowPar \par\noindent\fi}
>>>

\<revtex3 aps math\><<<
\def\no:make@eqnnum{\let\make@eqnnum=\empty}
\append:def\equation{%
   \def\:@currentlabel{\the\c@equation}%
   \anc:lbl r{equation}%
   \pend:def\endequation{%
     \aftergroup\aftergroup
     \aftergroup\aftergroup
     \aftergroup\aftergroup
     \aftergroup\no:make@eqnnum}}
>>>

\<revtex3 aps title page\><<<
\def\:authoraddress{%
   \let\aps:centering=\centering
   \def\centering##1\par{\aps:centering\a:address##1\b:address\par}%
   \def\nointerlineskip{\def\centering####1\par{%
          \aps:centering\a:author####1\b:author\par}}}

\NewConfigure{address}{2}

\let\o:maketitle:\maketitle
\def\maketitle{\bgroup
      |<adjust minipageNum for setcounter footnote 0|>%
      \def\sec:typ{title}%
      \Configure{HtmlPar}{}{}{}{}%
      \Configure{newpage}{}%
      \pend:def\@title{\a:ttl}\append:def\@title{\b:ttl\vskip2.5pt}%
      \pend:def\@date{\a:date}\append:def\@date{\b:date}%
      \pend:def\@authoraddress{\bgroup\:authoraddress }%
      \append:def\@authoraddress{\egroup }%
      \def\and{\a:and}
     \pend:def\@maketitle{\a:mktl}%
     \append:def\@maketitle{\b:mktl}%
     \o:maketitle: 
   \egroup}

\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
   \c:def\a:ttl{#3}\c:def\b:ttl{#4}}
\NewConfigure{thanks author date and}[8]{%
   \c:def\a:thanks{#1}\c:def\b:thanks{#2}\c:def\a:author{#3}\c:def\b:author{#4}%
   \c:def\a:date{#5}\c:def\b:date{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}
>>>

\<revtex3 aps sections\><<<
   \def\@part[#1]#2{%
    \ifnum \c@secnumdepth >-2\relax
      \SkipRefstepAnchor \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    }
\let\:tempb\part
\Def:Section\part{\thepart}{#1}
\let\:part\part
\let\part\:tempb
\let\no@part\@part
\def\@part[#1]#2{%
   {\let\addcontentsline\:gobbleIII\no@part[#1]{}}%
   \HtmlEnv   \Toc:Title{#1}\:part{#2}%
   \csname @endpart\endcsname%
 }
\Def:Section\likepart{}{#1}
\let\:likepart\likepart
\let\likepart\:UnDef
\let\no@spart\@spart
\def\@spart#1{%
   {\let\addcontentsline\:gobbleIII\no@spart{}}%
   \HtmlEnv   \:likepart{#1}%
   \csname @endpart\endcsname%
 }

   \let\no@section\section
\Def:Section\section{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesection \fi}{\uppercase{#1}}
\let\no:section\section
\def\section{\rdef:sec{section}}
\Def:Section\likesection{}{\uppercase{#1}}
\let\:likesection\likesection
\let\likesection\:UnDef

\let\asp:@sect\no@sect
\def\no@sect#1#2#3#4#5{\asp:@sect{#1}{#2}{#3}{#4}{#5\let\@svsec=\empty}}

\let\no@subsection\subsection
\Def:Section\subsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsection \fi}{#1}
\let\no:subsection\subsection
\def\subsection{\rdef:sec{subsection}}
\Def:Section\likesubsection{}{#1}
\let\:likesubsection\likesubsection
\let\likesubsection\:UnDef

\let\no@subsubsection\subsubsection
\Def:Section\subsubsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsubsection \fi}{#1}
\let\no:subsubsection\subsubsection
\def\subsubsection{\rdef:sec{subsubsection}}
\Def:Section\likesubsubsection{}{#1}
\let\:likesubsubsection\likesubsubsection
\let\likesubsubsection\:UnDef

\let\no@paragraph\paragraph
\Def:Section\paragraph{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \theparagraph \fi}{#1}
\let\no:paragraph\paragraph
\def\paragraph{\rdef:sec{paragraph}}
\Def:Section\likeparagraph{}{#1}
\let\:likeparagraph\likeparagraph
\let\likeparagraph\:UnDef
\let\no@subparagraph\subparagraph
\Def:Section\subparagraph{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubparagraph \fi}{#1}
\let\no:subparagraph\subparagraph
\def\subparagraph{\rdef:sec{subparagraph}}
\Def:Section\likesubparagraph{}{#1}
\let\:likesubparagraph\likesubparagraph
\let\likesubparagraph\:UnDef

\def\tableofcontents{%
   \ifx\contentsname\empty \else
      \ifx\contentsname\:UnDef \else
         %
\section*{\contentsname}%
         %
%
   \fi\fi
   \:tableofcontents}

\ConfigureToc{likeparagraph} {}{\empty}{}{\newline}
\ConfigureToc{likepart} {}{\empty}{}{\newline}
\ConfigureToc{likesection} {}{\empty}{}{\newline}
\ConfigureToc{likesubparagraph} {}{\empty}{}{\newline}
\ConfigureToc{likesubsection} {}{\empty}{}{\newline}
\ConfigureToc{likesubsubsection} {}{\empty}{}{\newline}
\ConfigureToc{paragraph} {\empty}{\ }{}{\newline}
\ConfigureToc{part} {\empty}{\ }{}{\newline}
\ConfigureToc{section} {\empty}{\ }{}{\newline}
\ConfigureToc{subparagraph} {\empty}{\ }{}{\newline}
\ConfigureToc{subsection} {\empty}{\ }{}{\newline}
\ConfigureToc{subsubsection} {\empty}{\ }{}{\newline}

\edef\:TOC{%
   \noexpand\ifx [\noexpand\:temp
      \noexpand\expandafter\noexpand\:TableOfContents
   \noexpand\else
      \noexpand\Auto:ent{\ifnum \c@tocdepth >-2 part,\fi
\expandafter\ifx \csname @chapter\endcsname\relax
   \ifnum \c@tocdepth >\z@  section,\fi
\else
   \ifnum \c@tocdepth >\m@ne chapter,appendix,\fi
   \ifnum \z@>\c@tocdepth\else section,\fi
\fi
\ifnum 1>\c@tocdepth \else subsection,\fi
\ifnum 2>\c@tocdepth \else subsubsection,\fi
\ifnum 3>\c@tocdepth \else paragraph,\fi
\ifnum 4>\c@tocdepth \else subparagraph,\fi
UnDFexyz}%
   \noexpand\fi}
\def\:tableofcontents{\futurelet\:temp\:TOC}
\def\Auto:ent#1{%
   \edef\auto:toc{\noexpand\:TableOfContents[\ifx \auto:toc\:UnDef
      #1\else \auto:toc \fi]}  \auto:toc
   \global\let\auto:toc\:UnDef }

\def\:tocs{\noexpand\:tableofcontents}
\pend:defIII\addcontentsline{%
   \def\:temp{##1}\def\:tempa{toc}\ifx \:temp\:tempa
   \gHAdvance\TitleCount  1 \fi }
\def\@dottedtocline#1#2#3#4#5{\hbox{\def\numberline##1{\e:listof
                ##1\f:listof}\c:listof#4\d:listof}\ignorespaces}
\def\@starttoc#1{%
  \begingroup
    \makeatletter   \Configure{cite}{}{}{}{}%
    \def\:temp{#1}\def\:tempa{toc}%
    \a:listof\par
    \@input{\jobname.\ifx \:temp\:tempa 4ct\else #1\fi}%
    \b:listof
    \if@filesw
      \expandafter\expandafter\csname
          newwrite\endcsname\csname tf@#1\endcsname
      \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
    \fi
    \global\@nobreakfalse
  \endgroup}

\NewConfigure{tableofcontents*}[1]{%
   \def\:tempa{#1}\ifx\empty\:tempa
      \ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
   \else
      \edef\auto:toc{#1}%
         \ifx \au:StartSec\:UnDef
            \let\au:StartSec\:StartSec
            \def\:StartSec{\:tableofcontents
               \global\let\auto:toc\:UnDef \:StartSec}%
            \pend:def\:tableofcontents{\gdef\:StartSec{\au:StartSec}}%
   \fi  \fi
}
>>>

%%%%%%%%%%%%%%%
\Chapter{Polish: mwart.cls, mwrep.cls, mwbk.cls}
%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%
\Section{mwart.cls}
%%%%%%%%%%%%%%%

\<mwart.4ht\><<<
% mwart.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2003. Eitan M. Gurari
|<TeX4ht copywrite|>
  |<mwcls configs|>
  |<mwcls maketitle|>
  |<mwcls divs|>
  |<mwcls tocs|>
  |<mwart tocs|>
\Hinput{mwart}
\endinput
>>>        \AddFile{7}{mwart}

\<mwcls divs\><<<
\let\:o:mw@normalheading\mw@normalheading
\pend:def\mw@normalheading{\def\mw@HeadingBreakBefore{00}}
>>>

\<mwcls divs\><<<
\let\mw:sectionx\mw@sectionx
\def\mw@sectionx{\everypar{\HtmlPar}\mw:sectionx}
\append:def\mw@runinheading{%
  \expandafter\everypar\expandafter{\the\everypar
    \edef\:temp{\the\everypar}\ifx \:temp\empty \everypar{\HtmlPar}\fi
  }%
  \expandafter\everypar\expandafter{\expandafter\HtmlPar\the\everypar}%
}
>>>

\<mwcls divs\><<<
\let\no:section\section
\Def:Section\section{\thesection}{#1}
  \let\:temp\no:section
  \let\no:section\section
  \let\section=\:temp
  \let\section:head\section@head
\Def:Section\likesection{}{#1}
  \let\:likesection\likesection
  \let\likesection\:UnDef
\def\section@head{\ifHeadingNumbered
   \expandafter\no:section \else \expandafter\:likesection\fi{\HeadingText}}
>>>

\<mwcls divs\><<<
\let\no:subsection\subsection
\Def:Section\subsection{\thesubsection}{#1}
  \let\:temp\no:subsection
  \let\no:subsection\subsection
  \let\subsection=\:temp
  \let\subsection:head\subsection@head
\Def:Section\likesubsection{}{#1}
  \let\:likesubsection\likesubsection
  \let\likesubsection\:UnDef
\def\subsection@head{\ifHeadingNumbered \expandafter\no:subsection \else 
   \expandafter\:likesubsection\fi{\HeadingText}}
>>>

\<mwcls divs\><<<
\let\no:subsubsection\subsubsection
\Def:Section\subsubsection{\thesubsubsection}{#1}
  \let\:temp\no:subsubsection
  \let\no:subsubsection\subsubsection
  \let\subsubsection=\:temp
  \let\subsubsection:head\subsubsection@head
\Def:Section\likesubsubsection{}{#1}
  \let\:likesubsubsection\likesubsubsection
  \let\likesubsubsection\:UnDef
\def\subsubsection@head{\ifHeadingNumbered
   \expandafter\no:subsubsection \else \expandafter\:likesubsubsection\fi{\HeadingText}}
>>>

\<mwcls divs\><<<
\let\no:paragraph\paragraph
\Def:Section\paragraph{\theparagraph}{#1}
  \let\:temp\no:paragraph
  \let\no:paragraph\paragraph
  \let\paragraph=\:temp
  \let\paragraph:head\paragraph@head
\Def:Section\likeparagraph{}{#1}
  \let\:likeparagraph\likeparagraph
  \let\likeparagraph\:UnDef
\def\paragraph@head{\ifHeadingNumbered
   \expandafter\no:paragraph \else 
   \expandafter\:likeparagraph\fi{\HeadingText}}
>>>

\<mwcls divs\><<<
\let\no:subparagraph\subparagraph
\Def:Section\subparagraph{\thesubparagraph}{#1}
  \let\:temp\no:subparagraph
  \let\no:subparagraph\subparagraph
  \let\subparagraph=\:temp
  \let\subparagraph:head\subparagraph@head
\Def:Section\likesubparagraph{}{#1}
  \let\:likesubparagraph\likesubparagraph
  \let\likesubparagraph\:UnDef
\def\subparagraph@head{\ifHeadingNumbered
  \expandafter\no:subparagraph \else 
  \expandafter\:likesubparagraph\fi {\HeadingText}}
>>>

\<mwcls divs\><<<
\let\no:part\part
\Def:Section\part{\thepart}{#1}
  \let\:temp\no:part
  \let\no:part\part
  \let\part=\:temp
  \let\part:head\part@head
\Def:Section\likepart{}{#1}
  \let\:likepart\likepart
  \let\likepart\:UnDef
\def\part@head{\ifHeadingNumbered
   \expandafter\no:part \else \expandafter\:likepart\fi{\HeadingText}}
>>>

\<mwcls divs\><<<
\Configure{UndefinedSec}{likepart}
\Configure{UndefinedSec}{likechapter}
\Configure{UndefinedSec}{likesection}
\Configure{UndefinedSec}{likesubsection}
>>>


MW classes redefine caption when hyperref is active. This doesn't really provide 
useful value for the HTML export, it even provides unfortunate side effect that
it introduces an error in the .xref file for each caption used in the document.
\<mwcls divs\><<<
\let\mw@caption@hyperref\@caption
>>>

\<mwart tocs\><<<
\let\mw@markandtoc=\empty
\def\tableofcontents{%
   \ifx\contentsname\empty \else
      \ifx\contentsname\:UnDef \else
         \Configure{toToc}{}{likesection}%
         \section*{\contentsname}%
         \Configure{toToc}{?}{likesection}%
   \fi\fi
   \:tableofcontents}
>>>

\<entries for mwart tocs\><<<
\ifnum \c@tocdepth >-2 part,likepart,\fi
\ifnum \c@tocdepth >\z@  section,likesection,\fi
\ifnum 1>\c@tocdepth \else subsection,likesubsection,\fi
\ifnum 2>\c@tocdepth \else subsubsection,likesubsubsection,\fi
\ifnum 3>\c@tocdepth \else paragraph,likeparagraph,\fi
\ifnum 4>\c@tocdepth \else subparagraph,likesubparagraph,\fi
UnDFexyz>>>

\<mwart tocs\><<<
\edef\:TOC{%
   \noexpand\ifx [\noexpand\:temp
      \noexpand\expandafter\noexpand\:TableOfContents
   \noexpand\else
      \noexpand\Auto:ent{|<entries for mwart tocs|>}%
   \noexpand\fi}
>>>

\<mwcls tocs\><<<
\def\:tableofcontents{\futurelet\:temp\:TOC}
\def\Auto:ent#1{%
   \edef\auto:toc{\noexpand\:TableOfContents[\ifx \auto:toc\:UnDef
      #1\else \auto:toc \fi]}  \auto:toc
   \global\let\auto:toc\:UnDef }
\def\:tocs{\noexpand\:tableofcontents}
\pend:defIII\addcontentsline{%
   \def\:temp{##1}\def\:tempa{toc}\ifx \:temp\:tempa
   \gHAdvance\TitleCount  1 \fi }
\def\@dottedtocline#1#2#3#4#5{\hbox{\def\numberline##1{\e:listof
                ##1\f:listof}\c:listof#4\d:listof}\ignorespaces}
\def\@starttoc#1{%
  \begingroup
    \makeatletter   \Configure{cite}{}{}{}{}%
    \def\:temp{#1}\def\:tempa{toc}%
    \a:listof\par
    \@input{\jobname.\ifx \:temp\:tempa 4ct\else #1\fi}%
    \b:listof
    \if@filesw
      \expandafter\expandafter\csname
          newwrite\endcsname\csname tf@#1\endcsname
      \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
    \fi
    \global\@nobreakfalse
  \endgroup}
\NewConfigure{tableofcontents*}[1]{%
   \def\:tempa{#1}\ifx\empty\:tempa
      \ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
   \else
      \edef\auto:toc{#1}%
         \ifx \au:StartSec\:UnDef
            \let\au:StartSec\:StartSec
            \def\:StartSec{\:tableofcontents
               \global\let\auto:toc\:UnDef \:StartSec}%
            \pend:def\:tableofcontents{\gdef\:StartSec{\au:StartSec}}%
   \fi  \fi
}
>>>

\<mwcls maketitle\><<<
\let\o:maketitle:\maketitle
\def\maketitle{\bgroup
   |<adjust minipageNum for setcounter footnote 0|>%
   \ifx \EndPicture\:UnDef
      \def\sec:typ{title}%
      \Configure{HtmlPar}{}{}{}{}%
      \Configure{newpage}{}%
      \ConfigureEnv{center}{\empty}{}{\empty}{\empty}
      \let\a:tabular:sv\a:tabular \let\b:tabular:sv\b:tabular
\let\c:tabular:sv\c:tabular \let\d:tabular:sv\d:tabular
\let\e:tabular:sv\e:tabular \let\f:tabular:sv\f:tabular
\let\before:begintabular:sv\before:begintabular
%
      \Configure{tabular}{}{}{}{\e:mktl}
        {\bgroup \let\a:tabular\a:tabular:sv \let\b:tabular\b:tabular:sv
\let\c:tabular\c:tabular:sv \let\d:tabular\d:tabular:sv
\let\e:tabular\e:tabular:sv \let\f:tabular\f:tabular:sv
\let\before:begintabular\before:begintabular:sv
}{\egroup}
      \ConfigureEnv{tabular}{\empty}{}{}{}%
      %
      \pend:def\@title{\a:ttl}\append:def\@title{\b:ttl}%
      \pend:def\@date{\a:date}\append:def\@date{\b:date}%
      \pend:def\@author{\a:author}\append:def\@author{\b:author}%
      \def\and{\a:and}
%
   \fi
   \pic:gobble\a:mktl  \o:maketitle:  \pic:gobble\b:mktl
   \egroup \let\maketitle\empty}
\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
   \c:def\a:ttl{#3}\c:def\b:ttl{#4}}
\NewConfigure{thanks author date and}[8]{%
   \c:def\a:thanks{#1}\c:def\b:thanks{#2}\c:def\a:author{#3}\c:def\b:author{#4}%
   \c:def\a:date{#5}\c:def\b:date{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}
>>>

\<mwcls configs\><<<
\NewConfigure{caption}[4]{\c:def\cptA:{#1}\c:def\cptB:{#2}%
   \c:def\cptC:{#3}\c:def\cptD:{#4}}
\long\def\@makecaption#1#2{%   
   {\cptA: \cap:ref{#1}%
 \if :#1:\else\cptB:\fi}{\cptC:{#2}\cptD:}}

\pend:def\caption{\SkipRefstepAnchor}

\append:def\quote{\par\@totalleftmargin\z@}

|<book-report-article idx|>

\append:def\quotation{\a:quotation\par\@totalleftmargin\z@}
\NewConfigure{quotation}{1}
\NewConfigure{listof}{6}
     

% We removed this code from base class declarations, so we can disable it here as well
% \ifx \@openbib@code\:UnDef \else
%  \pend:def\@openbib@code{\labelsep\z@}
% \fi
% \def\:temp#1#2!*?: {\def\:temp{#1}}
% \expandafter\:temp\usepackage!*?: 
% \def\:tempa{\@latex@e@error}
% \ifx \:temp\:tempa \else
%    \def\:tempa#1#2#3#4{\tmp:toks{#1{#2}}%
%    \long\expandafter\edef\csname #4 \endcsname{\the\tmp:toks
%         {\expandafter\noexpand
%    \csname o:\expandafter\:gobble\string #3:\endcsname}}}
% \def\:temp#1{%
%   \expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}}
% \:temp{rm}
% \:temp{sf}
% \:temp{tt}
% \:temp{bf}
% \:temp{it}

% \fi

  \let\:tempc\listoffigures
\pend:def\:tempc{\begingroup \a:listoffigures
   \def\@starttoc{\:tableofcontents[lof]\:gobble}}
\append:def\:tempc{\b:listoffigures \endgroup}
\HLet\listoffigures\:tempc
\let\:tempc\listoftables
\pend:def\:tempc{\begingroup \a:listoftables
   \def\@starttoc{\:tableofcontents[lot]\:gobble}}
\append:def\:tempc{\b:listoftables \endgroup}
\HLet\listoftables\:tempc

  \NewConfigure{listoffigures}{2}
\NewConfigure{listoftables}{2}
>>>

%%%%%%%%%%%%%%%
\Section{mwrep.cls}
%%%%%%%%%%%%%%%

\<mwrep.4ht\><<<
% mwrep.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2003. Eitan M. Gurari
|<TeX4ht copywrite|>
  |<mwcls configs|>
  |<mwcls maketitle|>
  |<mwcls divs|>
  |<mwrep,mwbk divs|>
  |<mwcls tocs|>
  |<mwrep,mwbk tocs|>
\Hinput{mwrep}
\endinput
>>>        \AddFile{7}{mwrep}

\<mwrep,mwbk tocs\><<<
\let\mw@markandtoc=\empty
\def\tableofcontents{%
   \ifx\contentsname\empty \else
      \ifx\contentsname\:UnDef \else
         \Configure{toToc}{}{likechapter}%
         \chapter*{\contentsname}%
         \Configure{toToc}{?}{likechapter}%
   \fi\fi
   \:tableofcontents}
>>>

\<mwrep,mwbk divs\><<<
\let\no:chapter\chapter
\Def:Section\chapter{\thechapter}{#1}
  \let\:temp\no:chapter
  \let\no:chapter\chapter
  \let\chapter=\:temp
  \let\chapter:head\chapter@head
\Def:Section\likechapter{}{#1}
  \let\:likechapter\likechapter
  \let\likechapter\:UnDef
\def\chapter@head{\ifHeadingNumbered
   \expandafter\no:chapter \else \expandafter\:likechapter\fi{\HeadingText}}
>>>

\<entries for mw rep/bk tocs\><<<
\ifnum \c@tocdepth >-2 part,likepart,\fi
\ifnum \c@tocdepth >\m@ne chapter,likechapter,appendix,\fi
\ifnum \z@>\c@tocdepth\else section,likesection,\fi
\ifnum 1>\c@tocdepth \else subsection,likesubsection,\fi
\ifnum 2>\c@tocdepth \else subsubsection,likesubsubsection,\fi
\ifnum 3>\c@tocdepth \else paragraph,likeparagraph,\fi
\ifnum 4>\c@tocdepth \else subparagraph,likesubparagraph,\fi
UnDFexyz>>>

\<mwrep,mwbk tocs\><<<
\edef\:TOC{%
   \noexpand\ifx [\noexpand\:temp
      \noexpand\expandafter\noexpand\:TableOfContents
   \noexpand\else
      \noexpand\Auto:ent{|<entries for mw rep/bk tocs|>}%
   \noexpand\fi}
>>>

%%%%%%%%%%%%%%%
\Section{mwbk.cls}
%%%%%%%%%%%%%%%

\<mwbk.4ht\><<<
% mwbk.4ht (|version), generated from |jobname.tex
% Copyright (C) |CopyYear.2003. Eitan M. Gurari
|<TeX4ht copywrite|>
  |<mwcls configs|>
  |<mwcls maketitle|>
  |<mwcls divs|>
  |<mwrep,mwbk divs|>
  |<mwcls tocs|>
  |<mwrep,mwbk tocs|>
\Hinput{mwbk}
\endinput
>>>        \AddFile{7}{mwbk}

%%%%%%%%%%%%%%%
\Chapter{aa.cls}
%%%%%%%%%%%%%%%

\Link[http://www.astro.uu.nl/\string~rutten/rrtex/manuals/aa/]{}{}%
 LaTeX document class for Astronomy and Astrophysics main journal\EndLink

\<aa.4ht\><<<
% aa.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>

\onecolumn           
|<aa sections|>
|<aa maketitle|>
|<book-report-article caption|>
|<configure aa|>
\Hinput{aa}
\endinput
>>>        \AddFile{9}{aa}

%%%%%%%%%%%%%%%%%%%
\Section{Maketitle}

\<aa maketitle\><<<
\NewConfigure{subtitle institute}[7]{%
   \c:def\a:sbttl{#1}\c:def\b:sbttl{#2}%
   \c:def\a:institute{#3}\c:def\b:institute{#4}%
   \c:def\c:institute{#5}\c:def\d:institute{#6}%
   \c:def\b:and{#7}%
}
\NewConfigure{headnote}{2}

\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
   \c:def\a:ttl{#3}\c:def\b:ttl{#4}}
\NewConfigure{thanks author date and}[8]{%
   \c:def\a:thanks{#1}\c:def\a:thanks{#2}%
   \c:def\a:author{#3}\c:def\b:author{#4}\c:def\a:date{#5}%
   \c:def\b:date{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}

\def\inst#1{\unskip$\sp{#1}$}
\def\fnmsep{\unskip$\sp,$}

\let\o:maketitle:=\@maketitle
\def\@maketitle{%
   |<adjust minipageNum for setcounter footnote 0|>%
  \def\sec:typ{title}%       
  \Tag{)title)}{\@title}%
  \makeheadbox \let\makeheadbox=\empty
  \def\andname{\a:and}%
  \def\lastandname{, \a:and} 
  \if!\@headnote!\else 
    \pend:def\@headnote{\a:headnote\ignorespaces}%
    \append:def\@headnote{\b:headnote}%
  \fi
  \pend:def\@title{\a:ttl\ignorespaces}%
  \if!\@subtitle!\append:def\@title{\b:ttl}\else  
     \pend:def\@subtitle{\a:sbttl\ignorespaces}%
     \append:def\@subtitle{\b:sbttl\b:ttl}%
  \fi
  \pend:def\@author{\a:author\ignorespaces}%
  \append:def\@author{\b:author}%
  \let\o:institutename=\institutename
  \def\institutename{\a:institute  
    \pend:def\@institute{\pend:def\and{\b:and}}%
    \pend:def\theinst{\c:institute}\append:def\theinst{\d:institute}%
    \o:institutename \b:institute 
 \if!\@dedic!\else
    \pend:def\@dedic{\a:dedic}\append:def\@dedic{\b:dedic}%
 \fi
    \pend:def\@date{\a:date}\append:def\@date{\b:date}}%
  \Configure{newline}{\e:mktl}\a:mktl\o:maketitle:\b:mktl
  \relax\if!\@mail!\else
      \pend:def\@mail{\a:mail\ignorespaces}%
      \append:def\@mail{\b:mail}%
      \global\let\@mail=\@mail
  \fi
}
\let\strich|=\empty
\NewConfigure{mail}{2}
\NewConfigure{makeheadbox}{5}
\def\makeheadbox{{%
   \a:makeheadbox{\bf\@journalname\ manuscript no.}
   \b:makeheadbox{\bf Your thesaurus codes are:}
   \c:makeheadbox{\@thesaurus}
   \d:makeheadbox{\AALogo}\e:makeheadbox}}

\def\AALogo{ASTRONOMY AND ASTROPHYSICS}
>>>

\Section{Sectioning}

\<aa sections\><<<
|<book / report / article cut points|>

|<html late parts|>
|<html late sections|>
|<subsections for book / report / article|>
|<subsubsections for book / report / article|>
|<paragraphs for book / report / article|>

>>>

% 
% 
% |<config article.sty utilities|>

%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{latex2man.cls}
%%%%%%%%%%%%%%%%%%%%%%%%

\<latex2man.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% latex2man.4ht                         |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<latex2man defs|>
\Hinput{latex2man}
\endinput
>>>        \AddFile{9}{latex2man}

\<latex2man defs\><<<
\renewcommand{\SP}{~}  
\renewcommand{\Email}[1]{\Link[mailto:#1]{}{}\texttt{#1}\EndLink}
\renewcommand{\URL}[1]{\Link[#1]{}{}\texttt{#1}\EndLink}
>>>

\Chapter{texinfo.cls}

\Link[http://www.dina.kvl.dk/DinaUnix/Info/texi/texi\string
   _toc.html]{}{}Manual\EndLink

Search for `*.texi' on my pc to find files.

Compile the following with \`'tex latex2e.texi':
\Link[ftp://ctan.tug.org/tex-archive/info/latex2e-help-texinfo/latex2e.texi]{}{}info/latex2e-help-texinfo\EndLink. 

From texinfo.tex:

\Verbatim
%   tex foo.texi
%   texindex foo.??
%   tex foo.texi
%   tex foo.texi
\EndVerbatim

Other examples:
\List{*}
\item
\Link[http://ilm.mech.unsw.edu.au/tex-archive/macros/texinfo/texinfo/doc/]{}{}texinfo/doc\EndLink
\item
\Link[ftp://ftp.lip6.fr/pub/gnu/Manuals/]{}{}gnu/Manuals\EndLink
\EndList

\<texinfo.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% texinfo.4ht                           |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\let\:temp|=\o:end
        \let\o:end|=\ptexend
                \let\ptexend|=\end
                          \let\end|=\:temp
\chardef\hat|=`\^       
\let\c|=\comment
|<texinfo env|>
|<texinfo lists|>
|<texinfo titlepage|>
|<texinfo sections|>
|<texinfo index|>
|<texinfo other|>
|<texinfo tables|>
|<texinfo verbatim|>
\ifx\parseargx\:UnDef
   |<texinfo 2009|>
\else
   |<texinfo pre 2009|>
\fi
\Hinput{texinfo}
\endinput
>>>        \AddFile{9}{texinfo}

\<texinfo pre 2009\><<<
\def\parsearg#1{%
  \let\next = #1%
  \begingroup
    \o:obeylines:
    \futurelet\temp\parseargx
}
>>>

\<texinfo 2009\><<<
\def\parseargusing#1#2{% 
  \def\argtorun{#2}% 
  \begingroup 
    \o:obeylines: 
    \spaceisspace 
    #1% 
    \parseargline\empty} 
>>>

\<texinfo pre 2009\><<<
\pend:defII\dosetq{\hbox{\Link{}{##1}\EndLink}}
>>>

\<texinfo verbatim\><<<
\NewConfigure{group}{2}
\def\group{\a:group\begingroup
  \ifnum\catcode13=\active \else
    \errhelp = \groupinvalidhelp
    \errmessage{@group invalid in context where filling is enabled}%
  \fi
  \def\Egroup{\egroup \endgroup \b:group }%
  \vtop\bgroup
    \everypar = {\HtmlPar}%
    \offinterlineskip
    \ifx\par\lisppar   
      \edef\par{\leavevmode \par}%
      \obeylines
    \fi
    \comment
}
>>>

\<texinfo tables\><<<
\NewConfigure{multitable}{6}
\pend:def\multitable{\a:multitable}
\def\dotable#1{\bgroup
  \let\sv:HRow=\HRow  \def\HRow{0}%
  \vskip\parskip  \setmultitablespacing    
  \let\item\crcr
  \global\colcount=0
  \def\Emultitable{\global\setpercentfalse\cr\egroup 
       \d:multitable \global\let\HRow=\sv:HRow \egroup \b:multitable}%
  \setuptable#1 \endsetuptable \edef\HCols{\the\colcount}%
  \everycr{\o:noalign:{\global\colcount=0\relax}}%  
  \TeXhalign\bgroup&\global\advance\colcount by 1\relax
    \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
     \IgnorePar
     \noindent
     \ifnum \colcount=1 \gHAdvance\HRow by 1
        \ifnum \HRow>1 \d:multitable\fi
        \c:multitable
     \fi
     \e:multitable\ignorespaces##\f:multitable\unskip\multistrut}\cr
}
>>>

The following is to protec the \''\code' command in immediate
environments, such as section titles submitted to toc.

\<texinfo other\><<<
\NewConfigure{example}{2}
\def\example{\a:example \begingroup
   \def\Eexample{\nonfillfinish\endgroup\b:example}\lisp} 
\NewConfigure{smalldisplay}{2}
\def\smalldisplay{\a:smalldisplay \begingroup
   \def\Esmalldisplay{\nonfillfinish\endgroup \b:smalldisplay}\display}
\NewConfigure{smallexample}{2}
\def\smallexample{\a:smallexample \begingroup
   \def\Esmallexample{\nonfillfinish\endgroup \b:smallexample}\lisp}
\NewConfigure{smallformat}{2}
\def\smallformat{\a:smallformat \begingroup
   \def\Esmallformat{\nonfillfinish\endgroup \b:smallformat}\format}
\NewConfigure{smalllisp}{2}
\def\smalllisp{\a:smalllisp \begingroup
   \def\Esmalllisp{\nonfillfinish\endgroup \b:smalllisp}\lisp}
\NewConfigure{flushleft}{2}
\def\flushleft{\a:flushleft \begingroup
   \def\Eflushleft{\nonfillfinish\endgroup \b:flushleft}\format} 
>>>

\<texinfo other\><<<
\let\o:code:=\code
\def\code{\Protect\o:code:}
\NewConfigure{pdfurl}{1}
\def\pdfurl#1{\bgroup
   \def~{\string~}\def\@{@}\let\*=\empty%
   \edef\:temp{\egroup \noexpand\a:pdfurl \noexpand\Link[#1]{}{}}\:temp
}
\def\endlink{\EndLink}
\pend:defII\refx{\Link{##1}{}}
>>>

\<texinfo env\><<<
\def\:tempc#1{\csname env:#1\endcsname\o:beginxxx:{#1}}
\HLet\beginxxx|=\:tempc
\def\:tempc#1{%
   \bgroup 
      \removeactivespaces{#1}%
      \xdef\end:thing{\the\toks0}%
   \egroup
   \o:endxxx:{#1}%
   \csname E:\end:thing\endcsname
   \csname endenv:\end:thing\endcsname}
\HLet\endxxx|=\:tempc
\long\def\ConfigureEnv#1#2#3{\expandafter\def\csname env:#1\endcsname{#2}%
  \expandafter\def\csname endenv:#1\endcsname{#3}}
>>>

\<texinfo lists\><<<
\NewConfigure{itemizeitem}{2}
\def\itemizeitem{%
   \advance\itemno by 1   {\let\par=\endgraf \smallbreak}%
   \ifhmode \errmessage{In hmode at itemizeitem}\fi
   \csname a:itemizeitem\l:st\endcsname
   {\itemcontents}\csname b:itemizeitem\l:st\endcsname}
\let\l:st|=\empty
>>>

\<texinfo lists\><<<
\NewConfigure{enumerate}[2]{%
   \def\a:enumerate{\def\l:st{en}#1}\def\E:enumerate{#2\let\l:st=\empty}%
   \Configure{itemizeitemen}}
\NewConfigure{itemizeitemen}{2}
\pend:def\enumerate{\a:enumerate}
\let\DeleteMark|=\:gobble
\Configure{enumerate}{}{}{}{}
>>>

\<texinfo lists\><<<
\NewConfigure{itemizeitemit}{2}
\NewConfigure{itemize}[2]{%
   \def\a:itemize{\def\l:st{it}#1}\def\E:itemize{#2\let\l:st=\empty}%
   \Configure{itemizeitemit}}
\pend:def\itemize{\a:itemize}
\Configure{itemize}{}{}{}{}
>>>

\<texinfo lists\><<<
\def\:tempc#1#2#3#4#5#6{%
   \o:tablez:{#1}{#2}{#3}{#4}{#5}{#6}\a:table \aftergroup\b:table
}
\HLet\tablez|=\:tempc
\pend:defI\itemzzz{\c:table}
\append:defI\itemzzz{\d:table}
\NewConfigure{table}{4}
>>>

\<texinfo titlepage\><<<
\def\:tempc{%
   \a:titlepage  \o:titlepage:
   \def\titlezzz##1{\a:title\leftline{\titlefonts\rm ##1}%
                    \b:title        \finishedtitlepagefalse}%
   \pend:defI\subtitlezzz{\a:subtitle}%
   \append:defI\subtitlezzz{\b:subtitle}%
   \pend:defI\authorzzz{\a:author}%
   \append:defI\authorzzz{\b:author}%
}
\HLet\titlepage=\:tempc

\append:def\Etitlepage{\b:titlepage}

\NewConfigure{titlepage}{2}
\NewConfigure{title}{2}
\NewConfigure{subtitle}{2}
\NewConfigure{author}{2}

\def\:temp{%
   \vskip\titlepagebottomglue
   \finishedtitlepagetrue
}
\HLet\finishtitlepage=\:temp
>>>

\<texinfo sections\><<<
\def\:tempd#1#2{%
   \expandafter\let\csname #1\endcsname=\:UnDef
   \expandafter\Def:Section\csname #1\endcsname{#2}{##1}%
   \expand:after{\expandafter\let\csname no:#1\endcsname=}\csname #1\endcsname
   \expandafter\outer\expandafter\def
      \csname #1\endcsname{\expandafter\parsearg\csname #1yyy\endcsname}%
   \def\:tempc##1{%     
     \let\sectionheading=\:gobbleIII
     \let\unnumbchapmacro=\:gobble
     \let\chapmacro=\:gobbleII 
     \let\centerchapmacro=\:gobble
     \csname o:#1zzz:\endcsname{##1}\csname no:#1\endcsname{##1}}
   \expandafter\HLet\csname #1zzz\endcsname=\:tempc}

\:tempd{chapter}{\the\chapno}
\:tempd{appendix}{\appendixletter}
\:tempd{unnumbered}{}
\:tempd{numberedsec}{\the\chapno.\the\secno}
\let\numberedsecyyy=\secyyy
\let\o:numberedseczzz:=\seczzz
\let\seczzz=\numberedseczzz

\:tempd{appendixsec}{\appendixletter.\the\secno}
\:tempd{unnumberedsec}{}
\:tempd{numberedsubsec}{\the\chapno.\the\secno.\the\subsecno}
\:tempd{appendixsubsec}{\appendixletter.\the\secno.\the\subsecno}
\:tempd{appendixsubsec}{\appendixletter.\the\secno.\the\subsecno}
\:tempd{unnumberedsubsec}{}
\:tempd{numberedsubsubsec}{\the\chapno.\the\secno
                      .\the\subsecno.\the\subsubsecno}
\:tempd{appendixsubsubsec}{\appendixletter.\the\secno
                          .\the\subsecno.\the\subsubsecno}
\:tempd{appendixsubsubsec}{\appendixletter.\the\secno
                          .\the\subsecno.\the\subsubsecno}
\:tempd{unnumberedsubsubsec}{}
\setcontentsaftertitlepagetrue
\NewConfigure{contents}{2}
\def\contents{\a:contents{\catcode`\\=0 
  \:TableOfContents[|<toc entries|>]}\b:contents}
>>>

\<toc entries\><<<
chapter,%
appendix,%
unnumbered,%
numberedsec,%
appendixsec,%
unnumberedsec,%
numberedsubsec,%
appendixsubsec,%
appendixsubsec,%
unnumberedsubsec,%
numberedsubsubsec,%
appendixsubsubsec,%
appendixsubsubsec,%
unnumberedsubsubsec%
>>>

\<texinfo index\><<<
\HAssign\cnt:idx=0
\def\dosubind#1#2#3{%
  \ifx\SETmarginindex\relax\else
    \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
  \fi
  {%
    \count255=\lastpenalty
    {%
      \indexdummies  \escapechar=`\\
      {%
        \let\folio = 0%
        \def\rawbackslashxx{\indexbackslash}% 
        \def\thirdarg{#3}%
        \ifx\thirdarg\emptymacro    \let\subentry = \empty
        \else                       \def\subentry{ #3}%
        \fi
        {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
        \toks0 = {#2}%
        \ifx\thirdarg\emptymacro \else
          \toks0 = \expandafter{\the\toks0 \space #3}%
        \fi
        \edef\temp{%
          \write\csname#1indfile\endcsname{%
            \realbackslash entry{\indexsorttmp}{\folio}{%
                   \string\Link[\FileName]{idx-\cnt:idx}{}\the\toks0
                   \string\EndLink}}%
        }%
        \iflinks
          \ifvmode
            \skip0 = \lastskip
            \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
          \fi
          %
          \temp \hbox{\Link-{}{idx-\cnt:idx}\EndLink  }%
          \gHAdvance\cnt:idx by 1
          \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
        \fi
      }%
    }%
    \penalty\count255
  }%
}
\def\:tempc#1{\begingroup 
   \pend:def\begindoublecolumns{\a:index}%
   \append:def\enddoublecolumns{\b:index}%
   \o:doprintindex:{#1}\endgroup}
\HLet\doprintindex=\:tempc

\def\entry#1#2{\begingroup  \parindent=0pt
  \par \c:index #1\d:index  \par \endgroup}
\NewConfigure{index}{4}
>>>

%%%%%%%%%%%%%%%%%%%%%%
\Chapter{LaTeX Documentation}
%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{doc.cls}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<doc.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% doc.4ht                               |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>



|<doc.sty|>
\Hinput{doc}
\endinput
>>>        \AddFile{9}{doc}

We have issue with catcode of the hat character, so we need to turn off
TeX4ht code for this character when the package is processed.

\<add to usepackage\><<<
\AddToHook{package/doc/before}{\SUPOff}
\AddToHook{package/doc/after}{\SUPOn}
>>>

\<doc.sty\><<<
\:CheckOption{no^} \if:Option \else
   \catcode`\^^M|=13    \def\hat:A#1^^M{\egroup}    \catcode`\^^M|=5  %
   \def\hhat:A{\bgroup \catcode`\^^M|=13 \hat:A} 
   \Configure{\string^\string^}{A}{\hhat:A}
\fi
>>>

\<doc.sty\><<<
\def\:temp{{\rmfamily B\textsc{ib}\TeX}}
\HLet\BibTeX\:temp
\def\:temp{\textsc{Plain}\TeX}
\HLet\PlainTeX\:temp
>>>

\<doc.sty\><<<
\bgroup
   \let\:temp\StopEventually
   \OnlyDescription
   \ifx \:temp\StopEventually
      \let\:temp=\empty
   \else                                   |% \AlsoImplementation |%
      \def\:temp{\long\def\StopEventually##1{##1}}    
   \fi
\expandafter \egroup \:temp
>>>

\<doc.styNO\><<<
\bgroup
   \let\:temp\StopEventually
   \OnlyDescription
   \ifx \:temp\StopEventually
      \let\:temp=\empty
   \else                                  |% \AlsoImplementation |%
      \def\:temp{\let\StopEventually=\relax }%    
   \fi
\expandafter \egroup \:temp
>>>

% \def\:temp{\leavevmode\hbox{$\mathcal A\hbox{$\mathcal M$}\mathcal S$-\TeX}}
% \HLet\AmSTeX\:temp
% \def\:temp{{\rmfamily SL{\scshape i}\TeX}}
% \HLet\SliTeX\:temp

\<doc.sty\><<<
\HRestore\maketitle
>>>

\<doc.sty\><<<
\:CheckOption{broken-index} \if:Option 
  |<doc warning|>
  \pend:defI\codeline@wrindex{\if@filesw
     \title:chs{\html:addr
              \hbox{\Link-{}{|<haddr prefix|>\last:haddr}\EndLink}}{}%
      \immediate\write\@indexfile{\string \beforeentry{\RefFileNumber
           \FileNumber}{\title:chs{|<haddr prefix|>\last:haddr}{\cur:th
           \:currentlabel}}{\a:makeindex}}\fi}
\else  
  \def\warn:idx#1{%
    \expandafter\ifx \csname #1warn:idx\endcsname\relax
       \expandafter\global
           \expandafter\let \csname #1warn:idx\endcsname\def
       \:warning{If not done so, the index is to be processed by
        ^^J\space\space  makeindex -o #1.ind #1.idx
       }%
       {\Configure{Needs}{File: #1.4idx}\Needs{}}%
    \fi}
\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{hypdoc.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

We don't need configuration file for the hypdoc package, but we need
to fix catcode issues with the hat character.


\<add to usepackage\><<<
\AddToHook{package/hypdoc/before}{\SUPOff}
\AddToHook{package/hypdoc/after}{\SUPOn}
>>>


%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{holtxdoc.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<holtxdoc.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% holtxdoc.4ht                          |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<holtxdoc configs|>
\Hinput{holtxdoc}
\endinput
>>>        \AddFile{9}{holtxdoc}

\<holtxdoc configs\><<<
\pend:defI\HistVersion{\begingroup
   \let\sv:subsection=\subsection
   \def\subsection####1####2{####2}%
   \let\sv:addcontentsline=\addcontentsline
   \def\addcontentsline####1####2####3{%
      \sv:addcontentsline{####1}{####2}{####3}%
      \sv:subsection*}%
   \:gobble
}
>>>

%%%%%%%%%%%%%%%%%%
\Chapter{src art/rep/book}
%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%
\Section{scrlayer}
%%%%%%%%%%%%%%%%%%
\<scrlayer.4ht\><<<
% scrlayer.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group 
|<TeX4ht copywrite|>
\def\pagestyle#1{\edef\currentpagestyle{#1}}
\Hinput{scrlayer}
\endinput
>>>     \AddFile{9}{scrlayer}

%%%%%%%%%%%%%%%%%%
\Section{scrbook}
%%%%%%%%%%%%%%%%%%

See report at screnggu.tex

\<scrbook.4ht\><<<
% scrbook.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>
\let\o:maketitle:|=\maketitle
|<general scrbook|>
|<addchap confic|>
|<scr artcl, reprt, book|>
\HRestore\maketitle
|<scrbook post scr@v@2.97d|>
\Hinput{scrbook}
\endinput
>>>        \AddFile{9}{scrbook}

\<scrbook post scr@v@2.97d\><<<
\renewcommand*\thesection{% 
  \ifnum \scr@compatibility>\@nameuse{scr@v@2.97d}\space
    \if@mainmatter\thechapter.\fi 
  \else 
  \thechapter.% 
  \fi 
  \@arabic\c@section 
} 
\renewcommand*\theequation{% 
  \ifnum \scr@compatibility>\@nameuse{scr@v@2.97d}\space
    \if@mainmatter\thechapter.\fi 
  \else 
  \thechapter.% 
  \fi 
  \@arabic\c@equation 
} 
\renewcommand*\thefigure{% 
  \ifnum \scr@compatibility>\@nameuse{scr@v@2.97d}\space 
    \if@mainmatter\thechapter.\fi 
  \else 
  \thechapter.% 
  \fi 
  \@arabic\c@figure 
} 
\renewcommand*\thetable{% 
  \ifnum \scr@compatibility>\@nameuse{scr@v@2.97d}\space
    \if@mainmatter\thechapter.\fi 
  \else 
  \thechapter.% 
  \fi 
  \@arabic\c@table 
} 
>>>

\<scr artcl, reprt, book\><<<
\Def:Section\minisec{}{#1}  
\let\:minisec=\minisec 
\def\minisec#1{\:minisec{#1}\@afterheading}
>>>

%%%%%%%%%%%%%%%%%%
\Section{srcartcl}

\<scrartcl.4ht\><<<
% scrartcl.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>
|<scr old fonts|>
\input article.4ht
|<scr artcl, reprt, book|>
|<scr artcl subtitle|>
\Hinput{scrartcl}
\endinput
>>>        \AddFile{9}{scrartcl}

%%%%%%%%%%%%%%%%%%
\Section{scrbook}

\<scrreprt.4ht\><<<
% scrreprt.4ht (|version), generated from |jobname.tex
% Copyright (C) |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>
|<general scrreprt|>
|<addchap confic|>
|<scr artcl, reprt, book|>
\Hinput{scrreprt}
\endinput
>>>        \AddFile{9}{scrreprt}

%%%%%%%%%%%%%%%%%%
\Section{maketitle}
%%%%%%%%%%%%%%%%%%

\<general scrreprt\><<<
|<redefine maketitle|>
|<scrreprt title page|>
>>>

\<general scrbook\><<<
|<redefine maketitle|>
|<scrbook title page|>
>>>

\<scrreprt title page\><<<
\pend:def\titlepage{%
   \cfg:maketitle
}
\def\cfg:maketitle{%
   \global\let\cfg:maketitle\empty   
   \ifx\@dedication\@empty \else
      \pend:def\@dedication{\a:dedication}%
      \append:def\@dedication{\b:dedication}%
   \fi
   |<scr def subtitle|>
}
\NewConfigure{dedication}{2}
>>>

\<scrbook title page\><<<
\pend:def\titlepage{%
   \cfg:maketitle
}
\def\cfg:maketitle{%
   \global\let\cfg:maketitle\empty   
   \ifx\@dedication\@empty \else
      \pend:def\@dedication{\a:dedication}%
      \append:def\@dedication{\b:dedication}%
   \fi
   \pend:def\@title{\a:ttl}\append:def\@title{\b:ttl}%
   \pend:def\@author{\a:author}\append:def\@author{\b:author}%
   \pend:def\@date{\a:date}\append:def\@date{\b:date}%
   \def\and{\a:and}
   |<scr def subtitle|>
}
\NewConfigure{dedication}{2}
>>>

Support for subtitles:

\<scr artcl, reprt, book\><<<
\NewConfigure{subtitle}{2}
>>>

\<scr artcl subtitle\><<<
\pend:def\maketitle{%
  |<scr def subtitle|>
}
>>>

\<scr def subtitle\><<<
  \pend:def\@subtitle{\a:subtitle}
  \append:def\@subtitle{\b:subtitle}
>>>

%%%%%%%%%%%%%%%%%%
\Section{TOC}
%%%%%%%%%%%%%%%%%%%

\<scrbook toc\><<<
|<book et al tocs|>
\edef\:TOC{%
   \noexpand\ifx [\noexpand\:temp
      \noexpand\expandafter\noexpand\:TableOfContents
   \noexpand\else
      \noexpand\Auto:ent{\ifnum \c@tocdepth >-2 part,\fi
\expandafter\ifx \csname @chapter\endcsname\relax
   \ifnum \c@tocdepth >\z@  section,\fi
\else
   \ifnum \c@tocdepth >\m@ne chapter,appendix,addchap,\fi
    \ifnum \c@tocdepth>0 section,\fi
\fi
\ifnum \c@tocdepth>1 subsection,\fi
\ifnum \c@tocdepth>2 subsubsection,\fi
\ifnum \c@tocdepth>3 paragraph,\fi
\ifnum \c@tocdepth>4 subparagraph,\fi
UnDFexyz}%
   \noexpand\fi}
\def\:tableofcontents{\futurelet\:temp\:TOC}
\def\Auto:ent#1{%
   \edef\auto:toc{\noexpand\:TableOfContents[\ifx \auto:toc\:UnDef
      #1\else \auto:toc \fi]}  \auto:toc
   \global\let\auto:toc\:UnDef }

\def\:tocs{\noexpand\:tableofcontents}
\pend:defIII\addcontentsline{%
   \def\:temp{##1}\def\:tempa{toc}\ifx \:temp\:tempa
   \gHAdvance\TitleCount  1 \fi }
\def\@dottedtocline#1#2#3#4#5{\hbox{\def\numberline##1{\e:listof
                ##1\f:listof}\c:listof#4\d:listof}\ignorespaces}
\def\@starttoc#1{%
  \begingroup
    \makeatletter   \Configure{cite}{}{}{}{}%
    \def\:temp{#1}\def\:tempa{toc}%
    \a:listof\par
    \@input{\jobname.\ifx \:temp\:tempa 4ct\else #1\fi}%
    \b:listof
    \if@filesw
      \expandafter\expandafter\csname
          newwrite\endcsname\csname tf@#1\endcsname
      \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
    \fi
    \global\@nobreakfalse
  \endgroup}

\NewConfigure{tableofcontents*}[1]{%
   \def\:tempa{#1}\ifx\empty\:tempa
      \ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
   \else
      \edef\auto:toc{#1}%
         \ifx \au:StartSec\:UnDef
            \let\au:StartSec\:StartSec
            \def\:StartSec{\:tableofcontents
               \global\let\auto:toc\:UnDef \:StartSec}%
            \pend:def\:tableofcontents{\gdef\:StartSec{\au:StartSec}}%
   \fi  \fi
}
>>>

%%%%%%%%%%%%%%%%%
\Section{other}
%%%%%%%%%%%%%%%%%%%

\<scr artcl, reprt, book\><<<
\pend:defI\@makefntext{\IgnorePar}
>>>

It seems that we got the error message about old font commands again. Probably because
TeX4ht now loads before class files. We reuse the code used in Koma classes
\<scr artcl, reprt, book\><<<
\let\scr@defineobsoletefonts\thr@@
>>>

\<general scrbook\><<<
\Configure{UndefinedSec}{likepart}
\Configure{UndefinedSec}{likechapter}
\Configure{UndefinedSec}{likesection}
\Configure{UndefinedSec}{likesubsection}
|<<book et al tocs|>

\let\:tempb\chapter
\Def:Section\chapter{\thechapter}{#1}
\let\:chapter\chapter
\let\chapter\:tempb
\def\@makechapterhead#1{}
\let\no@chapter\@chapter
\def\@chapter[#1]#2{%
   |<adjust minipageNum for setcounter footnote 0|>%
   {\SkipRefstepAnchor \let\addcontentsline\:gobbleIII\no@chapter[#1]{}}%
   \HtmlEnv   \Toc:Title{#1}\:chapter{#2}}
\Def:Section\likechapter{}{#1}
\let\:likechapter\likechapter
\let\likechapter\:UnDef
\let\no@schapter\@schapter
\def\@schapter#1{%
   {\let\addcontentsline\:gobbleIII\no@schapter{}}%
   \HtmlEnv   \:likechapter{#1}}
\let\no@appendix\appendix
\Def:Section\appendix{\thechapter}{#1}
\let\:appendix\appendix
\def\appendix{%
   \def\@chapter[##1]##2{%
      |<adjust minipageNum for setcounter footnote 0|>%
      {\def\addcontentsline####1####2####3{}\no@chapter[##1]{}}%
      \HtmlEnv \Toc:Title{##1}\:appendix{##2}}%
   \no@appendix}
|<scrbook toc|>
     
\ifx \@openbib@code\:UnDef \else
 \pend:def\@openbib@code{\labelsep\z@}
\fi
|<scr old  fonts|>
  \let\:tempc\listoffigures
\pend:def\:tempc{\begingroup \a:listoffigures
   \def\@starttoc{\:tableofcontents[lof]\:gobble}}
\append:def\:tempc{\b:listoffigures \endgroup}
\HLet\listoffigures\:tempc
\let\:tempc\listoftables
\pend:def\:tempc{\begingroup \a:listoftables
   \def\@starttoc{\:tableofcontents[lot]\:gobble}}
\append:def\:tempc{\b:listoftables \endgroup}
\HLet\listoftables\:tempc

  \NewConfigure{listoffigures}{2}
\NewConfigure{listoftables}{2}

\ifx \part\:UnDef\else
   \def\@part[#1]#2{%
    \ifnum \c@secnumdepth >-2\relax
      \SkipRefstepAnchor \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    }
\let\:tempb\part
\Def:Section\part{\thepart}{#1}
\let\:part\part
\let\part\:tempb
\let\no@part\@part
\def\@part[#1]#2{%
   {\let\addcontentsline\:gobbleIII\no@part[#1]{}}%
   \HtmlEnv   \Toc:Title{#1}\:part{#2}%
   \csname @endpart\endcsname%
 }
\Def:Section\likepart{}{#1}
\let\:likepart\likepart
\let\likepart\:UnDef
\let\no@spart\@spart
\def\@spart#1{%
   {\let\addcontentsline\:gobbleIII\no@spart{}}%
   \HtmlEnv   \:likepart{#1}%
   \csname @endpart\endcsname%
 }

\fi
\ifx \section\:UnDef\else
   \let\no@section\section
\Def:Section\section{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesection \fi}{#1}
\let\no:section\section
\def\section{\rdef:sec{section}}
\Def:Section\likesection{}{#1}
\let\:likesection\likesection
\let\likesection\:UnDef

\fi
\let\no@subsection\subsection
\Def:Section\subsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsection \fi}{#1}
\let\no:subsection\subsection
\def\subsection{\rdef:sec{subsection}}
\Def:Section\likesubsection{}{#1}
\let\:likesubsection\likesubsection
\let\likesubsection\:UnDef

\let\no@subsubsection\subsubsection
\Def:Section\subsubsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsubsection \fi}{#1}
\let\no:subsubsection\subsubsection
\def\subsubsection{\rdef:sec{subsubsection}}
\Def:Section\likesubsubsection{}{#1}
\let\:likesubsubsection\likesubsubsection
\let\likesubsubsection\:UnDef

\let\no@paragraph\paragraph
\Def:Section\paragraph{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \theparagraph \fi}{#1}
\let\no:paragraph\paragraph
\def\paragraph{\rdef:sec{paragraph}}
\Def:Section\likeparagraph{}{#1}
\let\:likeparagraph\likeparagraph
\let\likeparagraph\:UnDef
\let\no@subparagraph\subparagraph
\Def:Section\subparagraph{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubparagraph \fi}{#1}
\let\no:subparagraph\subparagraph
\def\subparagraph{\rdef:sec{subparagraph}}
\Def:Section\likesubparagraph{}{#1}
\let\:likesubparagraph\likesubparagraph
\let\likesubparagraph\:UnDef

\NewConfigure{caption}[4]{\c:def\cptA:{#1}\c:def\cptB:{#2}%
   \c:def\cptC:{#3}\c:def\cptD:{#4}}
\long\def\@makecaption#1#2{%   
   {\cptA: \cap:ref{#1}%
 \if :#1:\else\cptB:\fi}{\cptC:{#2}\cptD:}}

\pend:def\caption{\SkipRefstepAnchor}
\append:def\quote{\par\@totalleftmargin\z@}
|<book-report-article idx|>

\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
   \c:def\a:ttl{#3}\c:def\b:ttl{#4}}
\NewConfigure{thanks author date and}[8]{%
   \c:def\a:thanks{#1}\c:def\b:thanks{#2}%
   \c:def\a:author{#3}\c:def\b:author{#4}%
   \c:def\a:date{#5}\c:def\b:date{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}

\append:def\quotation{\a:quotation\par\@totalleftmargin\z@}
\NewConfigure{quotation}{1}
\NewConfigure{listof}{6}

\ConfigureToc{likeparagraph} {}{\empty}{}{\newline}
\ConfigureToc{likepart} {}{\empty}{}{\newline}
\ConfigureToc{likesection} {}{\empty}{}{\newline}
\ConfigureToc{likesubparagraph} {}{\empty}{}{\newline}
\ConfigureToc{likesubsection} {}{\empty}{}{\newline}
\ConfigureToc{likesubsubsection} {}{\empty}{}{\newline}
\ConfigureToc{paragraph} {\empty}{\ }{}{\newline}
\ConfigureToc{part} {\empty}{\ }{}{\newline}
\ConfigureToc{section} {\empty}{\ }{}{\newline}
\ConfigureToc{subparagraph} {\empty}{\ }{}{\newline}
\ConfigureToc{subsection} {\empty}{\ }{}{\newline}
\ConfigureToc{subsubsection} {\empty}{\ }{}{\newline}

\ConfigureToc{appendix} {\empty}{\ }{}{\newline}
\ConfigureToc{chapter} {\empty}{\ }{}{\newline}
\ConfigureToc{likechapter} {}{\empty}{}{\newline}
>>>

\<general scrreprt\><<<
\Configure{UndefinedSec}{likepart}
\Configure{UndefinedSec}{likechapter}
\Configure{UndefinedSec}{likesection}
\Configure{UndefinedSec}{likesubsection}
|<book et al tocs|>

\let\:tempb\chapter
\Def:Section\chapter{\thechapter}{#1}
\let\:chapter\chapter
\let\chapter\:tempb
\def\@makechapterhead#1{}
\let\no@chapter\@chapter
\def\@chapter[#1]#2{%
   |<adjust minipageNum for setcounter footnote 0|>%
   {\SkipRefstepAnchor \let\addcontentsline\:gobbleIII\no@chapter[#1]{}}%
   \HtmlEnv   \Toc:Title{#1}\:chapter{#2}}
\Def:Section\likechapter{}{#1}
\let\:likechapter\likechapter
\let\likechapter\:UnDef
\let\no@schapter\@schapter
\def\@schapter#1{%
   {\let\addcontentsline\:gobbleIII\no@schapter{}}%
   \HtmlEnv   \:likechapter{#1}}
\let\no@appendix\appendix
\Def:Section\appendix{\thechapter}{#1}
\let\:appendix\appendix
\def\appendix{%
   \def\@chapter[##1]##2{%
      |<adjust minipageNum for setcounter footnote 0|>%
      {\def\addcontentsline####1####2####3{}\no@chapter[##1]{}}%
      \HtmlEnv \Toc:Title{##1}\:appendix{##2}}%
   \no@appendix}

\NewConfigure{caption}[4]{\c:def\cptA:{#1}\c:def\cptB:{#2}%
   \c:def\cptC:{#3}\c:def\cptD:{#4}}
\long\def\@makecaption#1#2{%   
   {\cptA: \cap:ref{#1}%
 \if :#1:\else\cptB:\fi}{\cptC:{#2}\cptD:}}

\pend:def\caption{\SkipRefstepAnchor}
\append:def\quote{\par\@totalleftmargin\z@}
|<book-report-article idx|>
\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
   \c:def\a:ttl{#3}\c:def\b:ttl{#4}}
\NewConfigure{thanks author date and}[8]{%
   \c:def\a:thanks{#1}\c:def\b:thanks{#2}%
   \c:def\a:author{#3}\c:def\b:author{#4}%
   \c:def\a:date{#5}\c:def\b:date{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}

\append:def\quotation{\a:quotation\par\@totalleftmargin\z@}
\NewConfigure{quotation}{1}
\NewConfigure{listof}{6}

|<scrreprt toc|>
     
\ifx \@openbib@code\:UnDef \else
 \pend:def\@openbib@code{\labelsep\z@}
\fi
|<scr old fonts|>
  \let\:tempc\listoffigures
\pend:def\:tempc{\begingroup \a:listoffigures
   \def\@starttoc{\:tableofcontents[lof]\:gobble}}
\append:def\:tempc{\b:listoffigures \endgroup}
\HLet\listoffigures\:tempc
\let\:tempc\listoftables
\pend:def\:tempc{\begingroup \a:listoftables
   \def\@starttoc{\:tableofcontents[lot]\:gobble}}
\append:def\:tempc{\b:listoftables \endgroup}
\HLet\listoftables\:tempc

  \NewConfigure{listoffigures}{2}
\NewConfigure{listoftables}{2}

\ifx \part\:UnDef\else
   \def\@part[#1]#2{%
    \ifnum \c@secnumdepth >-2\relax
      \SkipRefstepAnchor \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    }
\let\:tempb\part
\Def:Section\part{\thepart}{#1}
\let\:part\part
\let\part\:tempb
\let\no@part\@part
\def\@part[#1]#2{%
   {\let\addcontentsline\:gobbleIII\no@part[#1]{}}%
   \HtmlEnv   \Toc:Title{#1}\:part{#2}%
   \csname @endpart\endcsname%
 }
\Def:Section\likepart{}{#1}
\let\:likepart\likepart
\let\likepart\:UnDef
\let\no@spart\@spart
\def\@spart#1{%
   {\let\addcontentsline\:gobbleIII\no@spart{}}%
   \HtmlEnv   \:likepart{#1}%
   \csname @endpart\endcsname%
 }

\fi
\ifx \section\:UnDef\else
   \let\no@section\section
\Def:Section\section{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesection \fi}{#1}
\let\no:section\section
\def\section{\rdef:sec{section}}
\Def:Section\likesection{}{#1}
\let\:likesection\likesection
\let\likesection\:UnDef
\fi
\let\no@subsection\subsection
\Def:Section\subsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsection \fi}{#1}
\let\no:subsection\subsection
\def\subsection{\rdef:sec{subsection}}
\Def:Section\likesubsection{}{#1}
\let\:likesubsection\likesubsection
\let\likesubsection\:UnDef
\let\no@subsubsection\subsubsection
\Def:Section\subsubsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsubsection \fi}{#1}
\let\no:subsubsection\subsubsection
\def\subsubsection{\rdef:sec{subsubsection}}
\Def:Section\likesubsubsection{}{#1}
\let\:likesubsubsection\likesubsubsection
\let\likesubsubsection\:UnDef
\let\no@paragraph\paragraph
\Def:Section\paragraph{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \theparagraph \fi}{#1}
\let\no:paragraph\paragraph
\def\paragraph{\rdef:sec{paragraph}}
\Def:Section\likeparagraph{}{#1}
\let\:likeparagraph\likeparagraph
\let\likeparagraph\:UnDef
\let\no@subparagraph\subparagraph
\Def:Section\subparagraph{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubparagraph \fi}{#1}
\let\no:subparagraph\subparagraph
\def\subparagraph{\rdef:sec{subparagraph}}
\Def:Section\likesubparagraph{}{#1}
\let\:likesubparagraph\likesubparagraph
\let\likesubparagraph\:UnDef
\ConfigureToc{likeparagraph} {}{\empty}{}{\newline}
\ConfigureToc{likepart} {}{\empty}{}{\newline}
\ConfigureToc{likesection} {}{\empty}{}{\newline}
\ConfigureToc{likesubparagraph} {}{\empty}{}{\newline}
\ConfigureToc{likesubsection} {}{\empty}{}{\newline}
\ConfigureToc{likesubsubsection} {}{\empty}{}{\newline}
\ConfigureToc{paragraph} {\empty}{\ }{}{\newline}
\ConfigureToc{part} {\empty}{\ }{}{\newline}
\ConfigureToc{section} {\empty}{\ }{}{\newline}
\ConfigureToc{subparagraph} {\empty}{\ }{}{\newline}
\ConfigureToc{subsection} {\empty}{\ }{}{\newline}
\ConfigureToc{subsubsection} {\empty}{\ }{}{\newline}
\ConfigureToc{appendix} {\empty}{\ }{}{\newline}
\ConfigureToc{chapter} {\empty}{\ }{}{\newline}
\ConfigureToc{likechapter} {}{\empty}{}{\newline}
>>>

\<scrreprt toc\><<<
|<book et al tocs|>
\edef\:TOC{%
   \noexpand\ifx [\noexpand\:temp
      \noexpand\expandafter\noexpand\:TableOfContents
   \noexpand\else
      \noexpand\Auto:ent{\ifnum \c@tocdepth >-2 part,\fi
   \ifnum \c@tocdepth >\m@ne chapter,appendix,addchap,\fi
   \ifnum \c@tocdepth>0 section,\fi
   \ifnum \c@tocdepth>1 subsection,\fi
\ifnum \c@tocdepth>2 subsubsection,\fi
\ifnum \c@tocdepth>3 paragraph,\fi
\ifnum \c@tocdepth>4 subparagraph,\fi
UnDFexyz}%
   \noexpand\fi}
\def\:tableofcontents{\futurelet\:temp\:TOC}
\def\Auto:ent#1{%
   \edef\auto:toc{\noexpand\:TableOfContents[\ifx \auto:toc\:UnDef
      #1\else \auto:toc \fi]}  \auto:toc
   \global\let\auto:toc\:UnDef }
\def\:tocs{\noexpand\:tableofcontents}
\pend:defIII\addcontentsline{%
   \def\:temp{##1}\def\:tempa{toc}\ifx \:temp\:tempa
   \gHAdvance\TitleCount  1 \fi }
\def\@dottedtocline#1#2#3#4#5{\hbox{\def\numberline##1{\e:listof
                ##1\f:listof}\c:listof#4\d:listof}\ignorespaces}
\def\@starttoc#1{%
  \begingroup
    \makeatletter   \Configure{cite}{}{}{}{}%
    \def\:temp{#1}\def\:tempa{toc}%
    \a:listof\par
    \@input{\jobname.\ifx \:temp\:tempa 4ct\else #1\fi}%
    \b:listof
    \if@filesw
      \expandafter\expandafter\csname
          newwrite\endcsname\csname tf@#1\endcsname
      \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
    \fi
    \global\@nobreakfalse
  \endgroup}
\NewConfigure{tableofcontents*}[1]{%
   \def\:tempa{#1}\ifx\empty\:tempa
      \ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
   \else
      \edef\auto:toc{#1}%
         \ifx \au:StartSec\:UnDef
            \let\au:StartSec\:StartSec
            \def\:StartSec{\:tableofcontents
               \global\let\auto:toc\:UnDef \:StartSec}%
            \pend:def\:tableofcontents{\gdef\:StartSec{\au:StartSec}}%
   \fi  \fi
}
>>>

% we disabled this in the base classes, so it isn't necessary anymore
% \<scr old fonts\><<<
% \def\:temp#1#2!*?: {\def\:temp{#1}}
% \expandafter\:temp\usepackage!*?: 
% \def\:tempa{\@latex@e@error}
% \ifx \:temp\:tempa \else
%    \def\popthree#1#2#3#4{#4}
%    \def\:tempa#1#2#3#4{\tmp:toks{#1{#2}}%
%    \long\expandafter\edef\csname #4 \endcsname{\the\tmp:toks
%         {\expandafter\noexpand
%   \csname o:\expandafter\expandafter\:gobble\expandafter\string \popthree#3:\endcsname}}}
% \def\:temp#1{%
%   \expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}}
% \:temp{rm}
% \:temp{sf}
% \:temp{tt}
% \:temp{bf}
% \:temp{it}

% \fi
% >>>

\<addchap confic\><<<
\ifx \@@maybeautodot\:UnDef
   |<pre 2001 addchap|>
\else
   |<2001 addchap|>
\fi
\let\:makeschapterhead=\@makeschapterhead
\def\::makeschapterhead#1{\:makeschapterhead{\normalfont\normalsize
    \:addchap {#1}}}
\pend:def\addchap{\let\@makeschapterhead\::makeschapterhead}
\pend:def\chapter{\let\@makeschapterhead\:makeschapterhead}
\let\:tempb=\addchap
\Def:Section\addchap{}{#1} 
\let\:addchap=\addchap
\let\addchap=\:tempb
\ConfigureToc{addchap} {\empty}{\ }{}{\newline}
>>>

\<pre 2001 addchap\><<<
\let\add:chap=\@addchap
\def\@addchap{%
   \let\chap:addcontentsline=\addcontentsline
   \def\addcontentsline{\let\addcontentsline\chap:addcontentsline
       \:gobbleIII }%
  \add:chap}
>>>

\<2001 addchap\><<<
\let\no@addchap\@addchap
\def\@addchap[#1]#2{%
   \HtmlEnv \Toc:Title{#1}\:addchap{#2}}
>>>

%%%%%%%%%%%%%%%%%%
\Chapter{juramisc}
%%%%%%%%%%%%%%%%%%

Classes in the Juramisc bundle

\<jurabook.4ht\><<<
% jurabook.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht copywrite|>
|<jurabook subsections|>
|<jurabook toc|>
|<jurabook footnotes|>
\Hinput{jurabook}
>>>        \AddFile{9}{jurabook}

\<juraurtl.4ht\><<<
% juraurtl.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht copywrite|>
\Hinput{juraurtl}
>>>        \AddFile{9}{juraurtl}

\<juraovw.4ht\><<<
% juraovw.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht copywrite|>
\Hinput{juraovw}
>>>        \AddFile{9}{juraovw}

\Section{Jurabook sections}

Jurabook defines lot of extra sectioning commands, so we need to 
define them. Other than that, it reuses classic LaTeX classes, so 
other sectioning commands should work out of the box.

\<jurabook subsections\><<<
\let\no@subthreesection\subthreesection
\Def:Section\subthreesection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubthreesection \fi}{#1}
\let\no:subthreesection\subthreesection
\def\subthreesection{\rdef:sec{subthreesection}}

\let\no@subfoursection\subfoursection
\Def:Section\subfoursection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubfoursection \fi}{#1}
\let\no:subfoursection\subfoursection
\def\subfoursection{\rdef:sec{subfoursection}}

\let\no@subfivesection\subfivesection
\Def:Section\subfivesection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubfivesection \fi}{#1}
\let\no:subfivesection\subfivesection
\def\subfivesection{\rdef:sec{subfivesection}}

\let\no@subsixsection\subsixsection
\Def:Section\subsixsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsixsection \fi}{#1}
\let\no:subsixsection\subsixsection
\def\subsixsection{\rdef:sec{subsixsection}}


\let\no@subsevensection\subsevensection
\Def:Section\subsevensection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsevensection \fi}{#1}
\let\no:subsevensection\subsevensection
\def\subsevensection{\rdef:sec{subsevensection}}


\let\no@subeightsection\subeightsection
\Def:Section\subeightsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubeightsection \fi}{#1}
\let\no:subeightsection\subeightsection
\def\subeightsection{\rdef:sec{subeightsection}}
>>>

We need to include these sectionins in the TOC

\<jurabook toc\><<<
\NewConfigure{tableofcontents*}[1]{%
   \def\:tempa{#1}\ifx\empty\:tempa
      \ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
   \else
      \edef\auto:toc{#1}%
         \ifx \au:StartSec\:UnDef
            \let\au:StartSec\:StartSec
            \def\:StartSec{\:tableofcontents
               \global\let\auto:toc\:UnDef \global\let\:StartSec\au:StartSec\:StartSec}%
            \append:def\tableofcontents{\gdef\:StartSec{\au:StartSec}}%
   \fi  \fi
}

\Configure{tableofcontents*}{part,chapter,section,subsection,subsubsection,subthreesection,subfoursection,subfivesection,subsixsection,subsevensection,subeightsection}
>>>

This code is a copy from jurabook.cls. It rewrites the default version used by
Jurabook, which starts a list environment. This leads to HTML tag mismatches
and is unnecessary in general.

The \`'\@makefntext' command will be redefined again in book.4ht, so we don't need to
insert TeX4ht hooks in this  version.

\<jurabook footnotes\><<<
 \renewcommand{\@makefntext}[1]{%
   \stepcounter{totalfootnotes}%
   \renewcommand{\baselinestretch}{\@ne}% (nur) dieses hinzugefuegt fuer einzeilige Ausgabe
   \parindent 1em%
   \noindent%
   \@infootnotetrue%
   \hb@xt@1.8em{\hss\@makefnmark}#1%
 \@infootnotefalse}
>>>

%%%%%%%%%%%%%%%%%%%
\Chapter{letter}
%%%%%%%%%%%%%%%%%

\<letter.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% letter.4ht                            |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<letter class|>
\Hinput{letter}
\endinput
>>>                        \AddFile{6}{letter}

\<letter class\><<<
\def\:temp#1{\a:opening
   \ifx \@empty \fromaddress\else
      \pend:def\fromaddress{\a:address}%
      \append:def\fromaddress{\b:address}%
   \fi
   \ifx \@empty \toaddress\else
      \pend:def\toaddress{\a:toaddress}%
      \append:def\toaddress{\b:toaddress}%
   \fi
   \ifx \@empty \toname\else
      \pend:def\toname{\a:toname}%
      \append:def\toname{\b:toname}%
   \fi
   \pend:def\@date{\a:date}%
   \append:def\@date{\b:date}%
     \o:opening:{\a:dear#1\b:dear}%
   \b:opening}
\HLet\opening\:temp
\def\:temp#1{%
   \ifx\@empty\fromsig\else 
      \pend:def\fromsig{\a:signature}%
      \append:def\fromsig{\b:signature}%
   \fi
   \a:closing
   \o:closing:{\a:sincerely#1\b:sincerely}%
   \b:closing}
\HLet\closing\:temp
>>>

\<letter class\><<<
\pend:defI\cc{\a:cc}
\append:defI\cc{\b:cc}
\pend:defI\encl{\a:encl}
\append:defI\encl{\b:encl}
\AtBeginDocument{\let\@mlabel\@gobbletwo}
>>>

\<letter class\><<<
\NewConfigure{address}{2}
\NewConfigure{cc}{2}
\NewConfigure{closing}{2}
\NewConfigure{date}{2}
\NewConfigure{dear}{2}
\NewConfigure{encl}{2}
\NewConfigure{opening}{2}
\NewConfigure{signature}{2}
\NewConfigure{sincerely}{2}
\NewConfigure{toaddress}{2}
\NewConfigure{toname}{2}
>>>

\<letter class\><<<
\long\def\:tempc{\@roman \c@enumiii}
\ifx \theenumiii\:tempc
   \def\:tempc{\a:enumiii\@roman\c@enumiii\b:enumiii}
   \HLet\theenumiii\:tempc
\fi
\NewConfigure{enumiii}{2}
>>>

%%%%%%%%%%%%%%%%%%%
\Chapter{elseart}
%%%%%%%%%%%%%%%%%

\Link[http://ctan.tug.org/ctan/tex-archive/macros/latex/contrib/supported/elsevier/]{}{}elsevier\EndLink

\<elsart.4ht\><<<
% elsart.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>
\edef\@ptsize{\ifdim \normalbaselineskip>14pt 2\else
   \ifdim \normalbaselineskip>13pt 2\else 0\fi\fi}
\input article.4ht
|<elsevier cls|>
\Hinput{elsart}
\endinput
>>>        \AddFile{9}{elsart}

\<elsevier cls\><<<
\@twocolumnfalse \@TwoColumnfalse
\let\endtable|=\end@float
\let\endalgorithm|=\end@float
\let\endfigure|=\end@float
|<elsart sup|>
\def\@makecaption{\@makefigurecaption}
\long\def\@makefigurecaption#1#2{%  
{\cptA: |<caption and ref/tag|>\if :#1:\else\cptB:\fi}{\cptC:{#2}\cptD:}}
\long\def\@maketablecaption#1#2{\@tablecaptionsize
    \global \@minipagefalse
\hbox{{\cptA: |<caption and ref/tag|>\if :#1:\else\cptB:\fi}{\cptC:{#2}\cptD:}}}
>>>

\<elsart sup\><<<
\def\@mpmakefnmark{\,\hbox{$\sp{\mathrm{\@thefnmark}}$}}
\long\def\@mpmakefntext#1{\noindent
                     \hbox{$\sp{\mathrm{\@thefnmark}}$} #1}
\def\itnuc#1#2{\setbox\@tempboxa=\hbox{\scriptsize\it #1}
  \def\@tempa{{}\sp{\box\@tempboxa}\!\protect\text{\it #2}}\relax
  \ifmmode \@tempa \else $\@tempa$\fi}
>>>

\<elsart sup\><<<
\def\address@fmt#1#2#3#4{\@newelemtrue
  \if@Elproofing\def\@eltag{#4}\else\def\@eltag{\theaddress}\fi
  \ifnum\prev@elem=\e@address \@newelemfalse \fi
  \if@newelem \address@fmt@init \fi
  \noindent \bgroup \@addressstyle
  \a:address
  \ifnum#1=\z@
    #3\,$\sp{\mathrm{#2}}$\space%
  \else
    \ifnum#1=\m@ne
      $\sp{\phantom{\mathrm{\@eltag}}}$\space #3\,$\sp{\mathrm{#2}}$%
    \else
      $\sp{\mathrm{\@eltag}}\space$#3\,$\sp{\mathrm{#2}}$%
    \fi
  \fi
  \b:address
  \par \egroup}
\NewConfigure{address}{2}
>>>

\<elsart sup\><<<
\def\collab@fmt#1#2#3{\@newelemtrue
  \ifnum\prev@elem=\e@collab \global\@newelemfalse \fi
  \if@newelem \collab@fmt@init \fi
  \par                                 % Start new paragraph
  {\large #3\,$\sp{\mathrm{#2}}$}}
\def\@makefnmark{\,\hbox{$\sp{\fn@presym\mathrm{\@thefnmark}}$}\,}
\def\nuc#1#2{\relax\ifmmode{\HCode{}}\sp{#1}{\protect\text{#2}}\else
    ${\HCode{}}\sup{#1}$#2\fi}
|<elsart titles|>
>>>

\<elsart titles\><<<
\def\title@fmt#1#2{%
\@ifundefined{@runtitle}{\global\def\@runtitle{#1}}{}%
 \vspace*{12pt}             
  {\@titlesize\a:ttl #1\,\hbox{$\sp{#2}$}\b:ttl\par}%
  \vskip\@undertitleskip
\vskip24\p@  % Vertical space below title
  }
\def\subtitle@fmt#1#2{%               % No vertical space above sub-title
  {\@titlesize \a:subtitle#1\b:subtitle\,\hbox{$\sp{#2}$}}\par}
\NewConfigure{subtitle}{2}
>>>

\<elsevier cls\><<<
\pend:def\open@fm{\:gobbleIV}
\pend:def\close@fm{\gdef\:temp{\global\setbox\fm@box=\vbox{}}}
\def\endfrontmatter{%
  \ifx\@runauthor\relax
   \global\let\@runauthor\@runningauthor
  \fi
  \global\n@author=\c@author
  \global\n@collab=\c@collab \@writecount
  \global\@topnum\z@
  \thispagestyle{copyright}%            % Format rest of front matter:
  \if@preface \else                     % IF not preface THEN
  \vskip \@overhistoryskip
  \history@fmt                          % print history (received, ...)
  \newcount\c@sv@footnote
  \global\c@sv@footnote=\c@footnote     % save current footnote number
  \if@hasabstract                       % IF abstract/ keywords THEN
   \vskip \@preabstractskip     % Space above rule
%  \hrule height 0.4\p@                 % Rule above abstract/keywords
    \vskip 8\p@
    \unvbox\t@abstract                  % print abstract, if any
  \fi
  \if@haskeywords                       % IF keywords THEN
    \vskip \@overkeywordskip
    \unvbox\t@keyword                   % Keyword abstract, if any
  \fi                                   % FI
  \vskip 10\p@
%  \hrule height 0.4\p@                 % rule below abstract/keywords
  \dedicated@fmt                        % print dedication
  \vskip \@belowfmskip                  % Vertical space below frontmatter
\fi                                   % FI
  \close@fm                             % Close front matter material.
   \output@glob@notes  % Put notes at bottom of 1st page
  \global\c@footnote=\c@sv@footnote     % restore footnote number
  \global\@prefacefalse
  \global\leftskip\z@                   % Restore the normal values of
  \global\@rightskip\z@                 % \leftskip,
  \global\rightskip\@rightskip          % \rightskip and
  \global\mathsurround\sv@mathsurround  % \mathsurround.
  \let\title\relax       \let\author\relax
  \let\collab\relax      \let\address\relax
  \let\frontmatter\relax \let\endfrontmatter\relax
  \let\@maketitle\relax  \let\@@maketitle\relax
  \normal@text
}
|<elsevier thankref|>
|<elsevier abstract|>
|<elsevier keywords|>
>>>

\<elsevier abstract\><<<
\def\:temp{%
    \let\no:indent\noindent
    \def\noindent{%
       \global\let\noindent\no:indent 
       \append:def\abstractname{\aftergroup\b:abstract}%
       \a:abstract \noindent}%
    \pend:def\endabstract{\c:abstract}\o:@abstract:}
\HLet\@abstract|=\:temp
\NewConfigure{abstract}{3}
>>>

\<elsevier keywords\><<<
\def\:temp{%
    \let\no:indent\noindent
    \def\noindent{%
       \global\let\noindent\no:indent 
       \a:keyword \noindent}%
    \pend:def\endkeyword{\b:keyword}\o:keyword:}
\HLet\keyword|=\:temp
\NewConfigure{keyword}{2}
>>>

\<elsevier thankref\><<<
\def\thanks{\@ifnextchar[{\@tempswatrue
  \thanks@optarg}{\@tempswafalse\thanks@optarg[]}}
\def\thanks@optarg[#1]#2{\SkipRefstepAnchor
  \refstepcounter{footnote}
  \if@tempswa\label{#1}\else\relax\fi
  \add@tok\t@glob@notes{\els:footnotetext}%
  \add@xtok\t@glob@notes{{#1}[\the\c@footnote]}%
  \add@tok\t@glob@notes{{#2}}}
\def\els:footnotetext#1[#2]#3{%
   \footnotetext[#2]{{\def\rEfLiNK##1##2{\Link{}{##1}\EndLink}%
   \ref{#1}}#3}}
\def\author@fmt#1#2#3{\@newelemtrue
  \a:author
  \if@firstauthor
  \first@author \global\@firstauthorfalse \fi
  \ifnum\prev@elem=\e@author \global\@newelemfalse \fi
  \if@newelem \author@fmt@init \fi
  \edef\@tempb{#2}\ifx\@tempb\@empty
    \hbox{{\author@font #3}}\else
    \hbox{{\author@font #3}\,$\sp{\mathrm{#2}}$}%
  \fi
  \b:author}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Chapter{American Psychological Association (APA)}
%%%%%%%%%%%%%%%%%%%%%

\<apa.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% apa.4ht                               |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\let\apa:Hinput=\Hinput
\def\Hinput#1{%
   \apa:Hinput{#1}%
   \def\:temp{#1}\def\:tempa{article}\ifx \:temp\:tempa
      \let\Hinput=\apa:Hinput
      \input apa-a.4ht
   \fi
}
\endinput
>>>        \AddFile{9}{apa}

\<apa-a.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% apa-a.4ht                             |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<apa code|>
\Hinput{apa}
\endinput
>>>        \AddFile{9}{apa-a}

\<apa code\><<<
\append:def\maketitle{\egroup}
\pend:def\maketitle{%
  \bgroup  
  \ConfigureEnv{figure}{\def\makebox[########1]########2{}}{}{}{}%
  \@ifundefined{@abstract}{}{%
     \pend:def\@abstract{\a:abstract}%
     \append:def\@abstract{\b:abstract}%
  }%
  \@ifundefined{@note}{}{%
     \pend:def\@note{\a:note}%
     \append:def\@note{\b:note}%
  }%
  |<apa authors|>%
}
\NewConfigure{abstract}{2}
\NewConfigure{note}{2}
\NewConfigure{affil}{2}
>>>

\<apa authors\><<<
\@ifundefined{@author}{}{%
   \pend:def\@affil{\a:affil}%
   \append:def\@affil{\b:affil}%  
}%
\@ifundefined{@authorOne}{}{%
   \pend:def\@authorOne{\a:author}%
   \append:def\@authorOne{\b:author}%
   \pend:def\@affilOne{\a:affil}%
   \append:def\@affilOne{\b:affil}% 
}%
\@ifundefined{@authorTwo}{}{%
   \pend:def\@authorTwo{\a:author}%
   \append:def\@authorTwo{\b:author}%
   \pend:def\@affilTwo{\a:affil}%
   \append:def\@affilTwo{\b:affil}%  
}%
\@ifundefined{@authorFour}{}{%
   \pend:def\@authorFour{\a:author}%
   \append:def\@authorFour{\b:author}%
   \pend:def\@affilFour{\a:affil}%
   \append:def\@affilFour{\b:affil}%  
}%
>>>

\<apa code\><<<
\def\appendix{%
  \appendixtrue
  \apaappfig                      
  \apaapptab                      
  \ifapamodejou{}{\clearpage}
  \let\old@apa@section=\leveltwo
  \newlength{\app@t@width}
  \setlength{\app@t@width}{\columnwidth}
  \addtolength{\app@t@width}{-8em}%
  \long\def\leveltwo##1{%
     \ifapamodeman{%
       \clearpage
       \setcounter{postfig}{0}
       \setcounter{posttbl}{0}
       \efloat@condopen{fff}
       \efloat@iwrite{fff}{\string\addtocounter{appendix}{1}}
       \efloat@iwrite{fff}{\string\setcounter{figure}{0}}
       \efloat@condopen{ttt}
       \efloat@iwrite{ttt}{\string\addtocounter{appendix}{1}}
       \efloat@iwrite{ttt}{\string\setcounter{table}{0}}%
      }{%
       \setcounter{figure}{0}%
       \setcounter{table}{0}%
      }%
      \refstepcounter{appendix}%
      \ifnum\c@appendix>1 \immediate\write
               \@auxout{\global\string\oneappendixfalse}\fi%
      \old@apa@section{%
             \appendixname\ifoneappendix\else~\theappendix\fi\\
             ##1%
      }%
  }%
} 
>>>

\<apa code\><<<
\append:def\seriate{\a:seriate
   \pend:def\item{\c:seriate
      \let\sp:ce=\space
      \def\space{\d:seriate\let\space=\sp:ce \space}%
}}%
\pend:def\endseriate{\b:seriate}
\NewConfigure{seriate}{4}
\def\s@title{}
\def\shorttitle#1{}
\AtBeginDocument{\def\rheadname{}}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Chapter{csbulletin.cls}
%%%%%%%%%%%%%%%%%%%%%

CSTUG bulletin. 

\<csbulletin.4ht\><<< 
% csbulletin.4ht (|version), generated from |jobname.tex 
% Copyright 2022 TeX Users Group 
|<TeX4ht license text|> 
|<csbulletin code|>
\Hinput{csbulletin}
\endinput
>>> \AddFile{9}{csbulletin}

We need to fix support for titles and authors.

\<csbulletin code\><<<
\def\author#1{\def\auth@r{#1}%
       \def\@author{#1}%
       \setbox\authb@x=\hbox{#1}
       \global\autkn@wntrue%
}

\def\title#1{\def\t@tle{#1}\def\@title{#1}}

\renewcommand\maketitle[1][\z@]{%
   \begingroup%
     \def\footnote##1{\footnotemark%
       \xdef\ZW@f@@tmark{\c@footnote}%
       \gdef\ZW@f@@tnote{\footnotetext[\ZW@f@@tmark]{##1}}%
       \gdef\ZW@footnote{\aftergroup\ZW@f@@tnote}%
       \aftergroup\ZW@footnote}%
     \parindent\z@%
     \a:ttl\t@tle\b:ttl%
   \endgroup\def\and{\a:and}%
      \@@line{\ifautkn@wn\a:author\@author\b:author\fi}%
  \thispagestyle{csbuldoi}\ClanekToc%
  \@afterindentfalse \@afterheading}
>>>



%%%%%%%%%%%%%%%%%%%%%
\Chapter{JHEP.cls}
%%%%%%%%%%%%%%%%%%%%%

\Link[http://jhep.sissa.it/]{}{}http://jhep.sissa.it/\EndLink

\<JHEP.4ht\><<<
% JHEP.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2001. Eitan M. Gurari
|<TeX4ht copywrite|>
   |<config JHEP|>
\Hinput{JHEP}
\endinput
>>>        \AddFile{9}{JHEP}

\<config JHEP\><<<
|<html late parts|>
|<html late sections|>
|<subsections for book / report / article|>
|<subsubsections for book / report / article|>
|<paragraphs for book / report / article|>
\let\acm:sect|=\no@sect
\def\no@sect#1#2#3{\acm:sect{#1}{#2}{#3\relax\let\@svsec|=\empty}}
>>>

\<config JHEP\><<<
\def\@maketitle{%
\if@preprint
  \a:preprint{\tiny Preprint typeset in JHEP style. -  
    \if@hyper{HYPER VERSION}   \else{PAPER VERSION}\fi }
  \normalsize\hfill
  \begin{tabular}[t]{r}\@preprint\end{tabular}% 
  \b:preprint  
\else      
\if@proc  
   \a:conference \copy\conf@box \b:conference \logo {\tiny PROCEEDINGS}
\else
  \a:received \unhbox\rece@box \b:received
  \a:accepted \unhbox\acce@box \b:accepted  \logo
  {\tiny \if@hyper{HYPER VERSION}\else{PAPER VERSION}\fi}
\fi\fi\null
   \a:title   {\LARGE \sffamily \bfseries \@title}\b:title
   \a:author{\normalsize \bfseries \sffamily \@author }\b:author
   \ifvoid\abstract@box \else
      \a:abstract\vbox{\unhbox\abstract@box}\b:abstract
   \fi
   \a:keywords\@keywords\b:keywords 
   \ifx\dedic@box\:UnDef\else \a:dedicated\dedic@box\b:dedicated \fi
}
>>>

\<config JHEP\><<<
\def\auto:maketitle{{%   
  \global\let\auto:maketitle=\empty
  \def\JHEP:toc{\setcounter{footnote}{0}%
     \if@todotoc \tableofcontents \fi
     \@todotocfalse \@preprintfalse
     \gdef\tableofcontents{}%
     \pend:def\@author{\a:author}\append:def\@author{\b:author}%
  }%
  \pend:def\@maketitle{\aftergroup\JHEP:toc}%
  |<auto@maketitle footnotes|>%
  \auto:mktitle
  \global\let\auto:mktitle=\empty
}}
\let\auto:mktitle=\auto@maketitle
\let\auto@maketitle=\empty
\NewConfigure{@BODY}[1]{\concat:config\a::@BODY{#1}}  
\let\a::@BODY=\a:@BODY
\def\a:@BODY{\a::@BODY \auto:maketitle }
>>>

\<auto@maketitle footnotes\><<<
\let\JHEP:sva=\begingroup
\def\begingroup{\let\begingroup=\JHEP:sva
  \begingroup 
    \let\JHEP:sva=\@makefnmark
    \let\JHEP:svb=\@makefntext
    \let\JHEP:svc=\newpage
    \def\newpage{%
       \let\@makefnmark=\JHEP:sva
       \let\@makefntext=\JHEP:svb
       \let\newpage=\JHEP:svc
       \newpage  }}
>>>

\<config JHEP\><<<
\NewConfigure{abstract}{2}
\NewConfigure{accepted}{2}
\NewConfigure{author}{2}
\NewConfigure{conference}{2}
\NewConfigure{dedicated}{2}
\NewConfigure{keywords}{2}
\NewConfigure{preprint}{2}
\NewConfigure{received}{2}
\NewConfigure{title}{2}
\renewcommand{\href}[2]{\bgroup\let~\H@tilde
                        \if@hyper\Link-[#1]{}{}\fi
                        {#2}\egroup\if@hyper\EndLink\fi}
\renewcommand{\name}[1]{\if@hyper\Link-{}{#1}\EndLink\fi}
\renewcommand{\base}[1]{\if@hyper\bgroup\let~\H@tilde
                        \HCode{<base href="#1" />}\egroup\fi}
>>>

\<config JHEP\><<<
\pend:defI\label{\bgroup\@hyperfalse}
\append:defI\label{\egroup}
\pend:defI\ref{\bgroup\@hyperfalse}
\append:defI\ref{\egroup}
\pend:defI\pageref{\bgroup\@hyperfalse}
\append:defI\pageref{\egroup}
>>>

%%%%%%%%%%%%%%%
\Chapter{TextBook}
%%%%%%%%%%%%%%%%

 
By Igor A. Kotelnikov. Not available in the public domain?

%%   \OutputCodE\<TextBook.4ht\>

\<TextBook.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% TextBook.4ht                          |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\def\thesection {\@arabic\c@section}
\def\@seccntformat#1{\S\csname the#1\endcsname\quad}
\input book.4ht

\ConfigureToc{section}
  {\HCode{<span class="sectionToc">}\S}
  {~}
  {}
  {\HCode{</span><br\xml:empty>}}
\ConfigureToc{subsection}
  {\HCode{<span class="subsectionToc">}~~\S}
  {~}
  {}
  {\HCode{</span><br\xml:empty>}}
\ConfigureToc{subsubsection}
  {\HCode{<span
       class="subsubsectionToc">}~~~~\S}
  {~}
  {}
  {\HCode{</span><br\xml:empty>}}

\Hinput{TextBook}
\endinput
>>>        \AddFile{9}{TextBook}

%%%%%%%%%%%%%%%
\Chapter{combine}
%%%%%%%%%%%%%%%%

\<combine.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% combine.4ht                           |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<combine cfg|>
\Hinput{combine}
\endinput
>>>        \AddFile{9}{combine}

\<combine cfg\><<<
\append:def\setuppapers{%
   \expandafter\let\csname :ref\endcsname\c@lbref
   \expandafter\let\csname o:ref\endcsname\c@lbref
   \def\ref{\expandafter\Protect\csname ::ref\endcsname}%
}
\def\c@lblabel#1{\@bsphack
  \bgroup
  \a:@newlabel
  \protected@write\@auxout{}%
    {\string\newlabel{#1}{{\csname a:newlabel\endcsname
     \@currentlabel}{\csname a:newlabel\endcsname \thecolpage}}}%
  \egroup
  \@esphack}
>>>

\<combine cfg\><<<
\long\def\:tempc#1{%
   \PushMacro\at:docend    \let\at:docend=\empty
   \PushMacro\export:hook  \let\export:hook\empty
   \gHAdvance\:mpNum by 1
   \HAssign\minipageNum=\:mpNum \relax 
   \o:import:{#1}%
   \PopMacro\at:docend  
   \PopMacro\export:hook
}
\HLet\import\:tempc
>>>

%%%%%%%%%%%%%%%
\Chapter{letters}
%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%
\Section{g-brief}
%%%%%%%%%%%%%

\<g-brief.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% g-brief.4ht                            |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<g-brief hooks|>
\Hinput{g-brief}
\endinput
>>>        \AddFile{9}{g-brief}

\<g-brief hooks\><<<
\def\ps@firstpage{%
  \ifcase \@ptsize\relax \normalsize \or \small \or \footnotesize \fi
  \def\@oddhead{|<g-brief head|>}
  \def\@oddfoot{|<g-brief foot|>}}
\NewConfigure{letterfoot}{3}
\NewConfigure{letterhead}{5}
>>>

\<g-brief head\><<<
\a:letterhead
  \ifklassisch \textsl{\quad\name}\else \textsc{\quad\name}\fi
\b:letterhead
  \normalsize 
  \ifklassisch 
     \begin{tabular}{r} \textsl{\strasse} \quad \\ 
       \ifx \zusatz\empty \else \textsl{\zusatz}\quad \\\fi 
       \textsl{\ort}\quad 
       \ifx \land\empty \else \\ \textsl{\land}\quad \fi
     \end{tabular} 
  \else 
     \begin{tabular}{r} 
       \textsc{\strasse}\quad \\ 
       \ifx \zusatz\empty \else \textsc{\zusatz}\quad \\ \fi 
       \textsc{\ort}\quad 
       \ifx \land\empty \else \\ \textsc{\land}\quad \fi 
     \end{tabular}%
  \fi
\c:letterhead
 \bgroup
 \scriptsize \ifx \retouradresse\empty
          \textrm{\name\ $\cdot$\ \strasse\ $\cdot$\ \ort \ifx
              \land\empty \else \ $\cdot$\ \land \fi } \else
            \textrm{\retouradresse} \fi
 \egroup
\d:letterhead
 \ifx \postvermerk\empty
          \else \textbf{\postvermerk} \par  \fi
\adresse
\e:letterhead
>>>

\<g-brief foot\><<<
\def\istsprache{german}
\a:letterfoot
\bgroup   \footnotesize
   \begin{tabular}{ll}
     \ifx \telefon\empty \else \telefontex & \telefon \\ \fi \ifx
     \telefax\empty \else \telefaxtext & \telefax \\ \fi \ifx
     \telex\empty \else \telextext & \telex \\ \fi \ifx
     \email\empty \else \emailtext & \email \\ \fi \ifx
     \http\empty \else \httptext & \http \\ \fi \
   \end{tabular}%
\egroup
\b:letterfoot
   \begin{tabular}{ll}
     \ifx \bank\empty \else \ifx \blz\empty \else \ifx
     \konto\empty \else \banktext & \bank \\ & \blztext \space \blz
     \\ & \kontotext \space \konto \\ \ \fi \fi \fi
   \end{tabular}%
\c:letterfoot
>>>

\<insert g-brief head\><<<
\ifx\zusatz\empty\else
   \pend:def\zusatz{\a:zusatz}
   \append:def\zusatz{\b:zusatz}
\fi
\ifx\land\empty\else
   \pend:def\land{\a:land}
   \append:def\land{\b:land}
\fi
\ifx\strasse\empty\else
   \pend:def\strasse{\a:strasse}
   \append:def\strasse{\b:strasse}
\fi

\ifx\ort\empty\else
   \pend:def\ort{\a:ort}
   \append:def\ort{\b:ort}
\fi

\ifx\postvermerk\empty\else
   \pend:def\postvermerk{\a:postvermerk}
   \append:def\postvermerk{\b:postvermerk}
\fi
\ifx\retouradresse\empty\else
   \pend:def\retouradresse{\a:retouradresse}
   \append:def\retouradresse{\b:retouradresse}
\fi
\par \ps@firstpage \@oddhead \let\@oddhead=\empty
>>>  

\<insert g-brief foot\><<<
\ifx\email\empty\else
   \pend:def\email{\a:email}
   \append:def\email{\b:email}
\fi
\ifx\telefon\empty\else
   \pend:def\telefon{\a:telefon}
   \append:def\telefon{\b:telefon}
\fi
\ifx\telefax\empty\else
   \pend:def\telefax{\a:telefax}
   \append:def\telefax{\b:telefax}
\fi
\ifx\telex\empty\else
   \pend:def\telex{\a:telex}
   \append:def\telex{\b:telex}
\fi
\ifx\http\empty\else
   \pend:def\http{\a:http}
   \append:def\http{\b:http}
\fi
\ifx\bank\empty\else
   \pend:def\bank{\a:bank}
   \append:def\bank{\b:bank}
\fi
\ifx\blz\empty\else
   \pend:def\blz{\a:blz}
   \append:def\blz{\b:blz}
\fi
\ifx\konto\empty\else
   \pend:def\konto{\a:konto}
   \append:def\konto{\b:konto}
\fi
\par \ps@firstpage \@oddfoot\let\@oddfoot=\empty
>>>  

\<g-brief hooks\><<<
\expandafter\pend:def\csname g-brief\endcsname{%
 \bgroup |<insert g-brief head|>\egroup
   \csname a:g-brief\endcsname
   \ifx \betreff\empty \else 
      \pend:def\betreff{\a:betreff}%
      \append:def\betreff{\b:betreff}%
   \fi
   \ifx \anrede\empty \else
      \pend:def\anrede{\a:anrede}%
      \append:def\anrede{\b:anrede}%
   \fi
}
\expandafter\append:def\csname g-brief\endcsname{%
   \csname b:g-brief\endcsname
}
>>>

\<g-brief hooks\><<<
\expandafter\pend:def\csname endg-brief\endcsname{%
   \csname c:g-brief\endcsname
   |<hooks for g-brief tail|>}
\expandafter\append:def\csname endg-brief\endcsname{%
   \csname d:g-brief\endcsname
   \bgroup |<insert g-brief foot|>\egroup
}
\NewConfigure{g-brief}{4}
>>>

\<hooks for g-brief tail\><<<
\ifx\gruss\empty \else
   \pend:def\gruss{\a:gruss}%
   \append:def\gruss{\b:gruss}%
\fi
\ifx\unterschrift\empty \else
   \pend:def\unterschrift{\a:unterschrift}%
   \append:def\unterschrift{\b:unterschrift}%
\fi
\ifx\anlagen\empty \else
   \pend:def\anlagen{\a:anlagen}%
   \append:def\anlagen{\b:anlagen}%
\fi
\ifx\verteiler\empty \else
   \pend:def\verteiler{\a:verteiler}%
   \append:def\verteiler{\b:verteiler}%
\fi
>>>

\<g-brief hooks\><<<
\pend:def\datumtext{\a:datumtext}
\append:def\datumtext{\b:datumtext}
\NewConfigure{datumtext}{2}

\pend:def\datum{\a:datum}
\append:def\datum{\b:datum}
\NewConfigure{datum}{2}

\NewConfigure{anrede}{2}
\NewConfigure{betreff}{2}

\pend:def\sprache{\a:sprache}
\append:def\sprache{\b:sprache}                        

\NewConfigure{gruss}{2}
\NewConfigure{unterschrift}{2}
\NewConfigure{anlagen}{2}
\NewConfigure{verteiler}{2}
 
\NewConfigure{sprache}{2}

\pend:def\telefontex{\a:telefontex}
\append:def\telefontex{\b:telefontex}
\NewConfigure{telefontex}{2}

\pend:def\telefaxtext{\a:telefaxtext}
\append:def\telefaxtext{\b:telefaxtext}
\NewConfigure{telefaxtext}{2}

\pend:def\telextext{\a:telextext}
\append:def\telextext{\b:telextext}
\NewConfigure{telextext}{2}

\pend:def\emailtext{\a:emailtext}
\append:def\emailtext{\b:emailtext}
\NewConfigure{emailtext}{2}

\pend:def\httptext{\a:httptext}
\append:def\httptext{\b:httptext}
\NewConfigure{httptext}{2}

\pend:def\banktext{\a:banktext}
\append:def\banktext{\b:banktext}
\NewConfigure{banktext}{2}

\pend:def\blztext{\a:blztext}
\append:def\blztext{\b:blztext}
\NewConfigure{blztext}{2}

\pend:def\betrefftext{\a:betrefftext}
\append:def\betrefftext{\b:betrefftext}
\NewConfigure{betrefftext}{2}

\pend:def\ihrzeichentext{\a:ihrzeichentext}
\append:def\ihrzeichentext{\b:ihrzeichentext}
\NewConfigure{ihrzeichentext}{2}

\pend:def\ihrschreibentext{\a:ihrschreibentext}
\append:def\ihrschreibentext{\b:ihrschreibentext}
\NewConfigure{ihrschreibentext}{2}

\pend:def\meinzeichentext{\a:meinzeichentext}
\append:def\meinzeichentext{\b:meinzeichentext}
\NewConfigure{meinzeichentext}{2}

\pend:def\unserzeichentext{\a:unserzeichentext}
\append:def\unserzeichentext{\b:unserzeichentext}
\NewConfigure{unserzeichentext}{2}

\NewConfigure{anlagen}{2}
\NewConfigure{adresse}{2}
\NewConfigure{bank}{2}
\NewConfigure{blz}{2}
\NewConfigure{email}{2}
\NewConfigure{gruss}{2}
\NewConfigure{grussskip}{2}
\NewConfigure{http}{2}
\NewConfigure{ihrschreiben}{2}
\NewConfigure{ihrzeichen}{2}
\NewConfigure{konto}{2}
\NewConfigure{land}{2}
\NewConfigure{meinzeichen}{2}
\NewConfigure{name}{2}
\NewConfigure{ort}{2}
\NewConfigure{postvermerk}{2}
\NewConfigure{retouradresse}{2}
\NewConfigure{strasse}{2}
\NewConfigure{telefax}{2}
\NewConfigure{telefon}{2}
\NewConfigure{telex}{2}
\NewConfigure{unterschrift}{2}
\NewConfigure{verteiler}{2}
\NewConfigure{zusatz}{2}

\pend:def\name{\a:name}
\append:def\name{\b:name}
>>>

\<???\><<<
   \pend:def\meinzeichen{\a:meinzeichen}
   \append:def\meinzeichen{\b:meinzeichen}

   \pend:def\ihrzeichen{\a:ihrzeichen}
   \append:def\ihrzeichen{\b:ihrzeichen}

 
\ifx\anlagen\empty\else
   \pend:def\anlagen{\a:anlagen}
   \append:def\anlagen{\b:anlagen}
\fi

\ifx\adresse\empty\else
   \pend:def\adresse{\a:adresse}
   \append:def\adresse{\b:adresse}
\fi

\ifx\gruss\empty\else
   \pend:def\gruss{\a:gruss}
   \append:def\gruss{\b:gruss}
\fi

\ifx\grussskip\empty\else
   \pend:def\grussskip{\a:grussskip}
   \append:def\grussskip{\b:grussskip}
\fi

\ifx\ihrschreiben\empty\else
   \pend:def\ihrschreiben{\a:ihrschreiben}
   \append:def\ihrschreiben{\b:ihrschreiben}
\fi

\ifx\unterschrift\empty\else
   \pend:def\unterschrift{\a:unterschrift}
   \append:def\unterschrift{\b:unterschrift}
\fi
\ifx\verteiler\empty\else
   \pend:def\verteiler{\a:verteiler}
   \append:def\verteiler{\b:verteiler}
\fi
>>>

%%%%%%%%%%%%%%%
\Chapter{ltxguide}
%%%%%%%%%%%%%%%%

\<ltxguide.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ltxguide.4ht                          |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<ltxguide cfg|>
\Hinput{ltxguide}
\endinput
>>>        \AddFile{9}{ltxguide}

\<ltxguide cfg\><<<
\def\:tempc#1{\hbox {\a:m\it #1\b:m}}
\HLet\m\:tempc
\NewConfigure{m}{2}
\Configure{m} {$\langle $} {$\rangle $}
>>>

%%%%%%%%%%%%%%%
\Chapter{Ext article/book/report/proc/letter}
%%%%%%%%%%%%%%%%

\<extarticle.4ht\><<< 
% extarticle.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2005. Eitan M. Gurari
|<TeX4ht copywrite|>
  \input article.4ht
  |<extarticle cfg|> 
\Hinput{extarticle} \endinput 
>>>        \AddFile{9}{extarticle} 
 
\<extarticle cfg\><<< 
|<common extcls cfg|>
>>> 

\<extbook.4ht\><<< 
% extbook.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2005. Eitan M. Gurari
|<TeX4ht copywrite|> 
  \input book.4ht
  |<extbook cfg|> 
\Hinput{extbook} \endinput 
>>>        \AddFile{9}{extbook} 
 
\<extbook cfg\><<< 
|<common extcls cfg|>
>>> 

\<extletter.4ht\><<< 
% extletter.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2005. Eitan M. Gurari
|<TeX4ht copywrite|> 
  \input letter.4ht
  |<extletter cfg|> 
\Hinput{extletter} \endinput 
>>>        \AddFile{9}{extletter} 
 
\<extletter cfg\><<< 
|<common extcls cfg|>
>>> 

\<common extcls cfg\><<<
\ifnum\@ptsize>12\relax
\renewcommand\@ptsize{10}
\input{size\@ptsize.clo}
\fi
>>>

\<extproc.4ht\><<< 
% extproc.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2005. Eitan M. Gurari
|<TeX4ht copywrite|> 
  \input proc.4ht
  |<extproc cfg|> 
\Hinput{extproc} \endinput 
>>>        \AddFile{9}{extproc} 
 
\<extproc cfg\><<< 
 
>>> 

\<extreport.4ht\><<< 
% extreport.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2005. Eitan M. Gurari
|<TeX4ht copywrite|> 
  \input report.4ht
  |<extreport cfg|> 
\Hinput{extreport} \endinput 
>>>        \AddFile{9}{extreport} 
 
\<extreport cfg\><<< 
 
>>> 

%%%%%%%%%%%%%%%%
\Part{AMS}
%%%%%%%%%%%%%%%%

\Chapter{AMS ART, PROC, BOOK classes}

%----------------------------- amsart.cls -----------------------
\Section{amsart.cls}

Calls:
amsgen.sty,
amsmath.sty,
amstext.sty,
amsbsy.sty,
amsopn.sty,
amsfonts.sty,
and amsthm.sty.

\<amsart.4ht\><<<
% amsart.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
\pend:defII\@starttoc{\par}
|<config book-report-article utilities|>
|<ams art, proc, book|>
|<ams art, proc|>
|<ams art|>
|<redefine ams maketitle|>
|<title page of amsart.cls|>
|<sections of amsart.cls|>
|<table/figure of amsart.cls|>
|<tocs of amsart.cls|>
|<latex options 1, 2, 3|>     |%after tocs, divs, and cuts|%
\Hinput{amsart}
\endinput
>>>        \AddFile{5}{amsart}

\<ams art, proc, book\><<<
|<ams divisions|>
>>>

\<ams art, proc, book\><<<
\let\:setaddresses=\@setaddresses
\def\@setaddresses{\bgroup
   \pend:def\addresses{%
     |<ams addresses|>%
   }%
  \a:addresses \:setaddresses \b:addresses\egroup }
\NewConfigure{addresses}{2}
\NewConfigure{address}{3}
\NewConfigure{curraddr}{3}
\NewConfigure{email}{3}
\NewConfigure{urladdr}{3}
>>>

\<ams addresses\><<<
\let\:address=\address
\def\address########1########2{%
  \@ifnotempty{########2}{%
     \def\:temp{########1}\ifx \:temp\empty
        \:address{}{\a:address\b:address########2\c:address}%
     \else              
        \:address{\a:address 
              ########1}{\b:address########2\c:address}%
     \fi }}%
\let\:curraddr=\curraddr
\def\curraddr########1########2{%
  \@ifnotempty{########2}{\a:curraddr
      \:curraddr{########1}{\b:curraddr########2\c:curraddr}%
}}%
\let\:email=\email
\def\email########1########2{%
  \@ifnotempty{########2}{\a:email
      \:email{########1}{\b:email########2\c:email}%
}}%
\let\:urladdr=\urladdr
\def\urladdr########1########2{%
  \@ifnotempty{########2}{\a:urladdr
      \:urladdr{########1}{\b:urladdr########2\c:urladdr}%
}}%
>>>

\<ams art, proc, book\><<<
\pend:def\@settranslators{\a:translators\bgroup
   \def\and{\unskip{ } \d:translators and~\c:translators\ignorespaces}%
   \def\andify{\nxandlist{\unskip, }{\unskip{} \and}{\unskip, \and}}% 
   \pend:def\@translators{\c:translators}%
   \append:def\@translators{\d:translators}%
}
\append:def\@settranslators{\egroup\b:translators}
\NewConfigure{translators}{4}
>>>

The followwin applies only to amsart 2000/06/02 v2.07    and on

\<ams art + book + proc\><<<
\ifx \deferred@thm@head\:UnDef\else
   |<shared ams thm/cls|>
   |<ams 2000 art + book + proc|>
\fi
>>>

\<ams 2000 art + book + proc\><<<
\def\:tempc{\ifmmode \mathqed \else
    \leavevmode \a:qed\hbox {\qedsymbol}\b:qed\fi} 
\expandafter\HLet\csname qed \endcsname=\:tempc
\NewConfigure{qed}{2}
>>>

%   \def\:temp{\a:newtheorem \:thm}
%   \HLet\@thm=\:temp
%   \append:defI\deferred@thm@head{\b:newtheorem  
%      \ifx \c:newtheorem\empty\else
%         \:warning{amsart.4ht requires empty 3rd argument 
%             in \string\Configure{newtheorem}}%
%        \fi
%  %      \ignorespaces}
  
  
  
  % \HRestore\listoffigures
  % \HRestore\listoftables

\<table/figure of amsart.cls\><<<
\def\endtable{\end@float}
\def\endfigure{\end@float}
>>>

%----------------------------- amsbook.cls -----------------------
\Section{amsbook.cls}

Calls:
amsgen.sty,
amsmath.sty,
amstext.sty,
amsbsy.sty,
amsopn.sty,

and amsthm.sty.

\<amsbook.4ht\><<<
% amsbook.4ht |version, generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
   \pend:defII\@starttoc{\par}
|<config book-report-article utilities|>
|<ams art, proc, book|>
|<ams proc, book|>
|<ams book|>
|<redefine ams maketitle|>
|<title page of amsbook.cls|>
|<sections of amsbook.cls|>
|<table/figure of amsbook.cls|>
|<tocs of amsbook.cls|>
|<latex options 1, 2, 3|>     |%after tocs, divs, and cuts|%
\Hinput{amsbook}
\endinput
>>>        \AddFile{5}{amsbook}

% \HRestore\listoffigures
% \HRestore\listoftables

\<tocs of amsbook.cls\><<<
|<latex et al tocs|>
\edef\:TOC{%
   \noexpand\ifx [\noexpand\:temp
      \noexpand\expandafter\noexpand\:TableOfContents
   \noexpand\else
      \noexpand\Auto:ent{|<entries for tocs of amsbook.cls|>}\noexpand\fi}
|<report,book tocs|>
>>>

\<entries for tocs of amsbook.cls\><<<
\ifnum \c@tocdepth >-2 part,likepart,\fi
\ifnum \c@tocdepth >\m@ne chapter,likechapter,appendix,\fi
\ifnum \c@tocdepth >\z@ section,likesection,\fi
\ifnum \c@tocdepth >1 subsection,likesubsection,\fi
\ifnum \c@tocdepth >2 subsubsection,likesubsubsection,\fi
\ifnum \c@tocdepth >3 paragraph,\fi
\ifnum \c@tocdepth >4 subparagraph,\fi
UnDFexyz
>>>

\<table/figure of amsbook.cls\><<<
\def\endtable{\end@float}
\def\endfigure{\end@float}
>>>

%----------------------------- amsproc.cls -----------------------
\Section{amsproc.cls}

Calls:
amsgen.sty,
amsmath.sty,
amstext.sty,
amsbsy.sty,
amsopn.sty,

and amsthm.sty.

\<amsproc.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amsproc.4ht (|version), generated from |jobname.tex
% Copyright (C) |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>

|<config book-report-article utilities|>
|<ams art, proc, book|>
|<ams proc, book|>
|<ams art, proc|>
|<redefine ams maketitle|>
\pend:defII\@starttoc{\par}
|<title page of amsproc.cls|>
|<sections of amsproc.cls|>
|<table/figure of amsproc.cls|>
|<tocs of amsproc.cls|>
|<latex options 1, 2, 3|>     |%after tocs, divs, and cuts|%
\Hinput{amsproc}
\endinput
>>>        \AddFile{5}{amsproc}

\<tocs of amsproc.cls\><<<
|<latex et al tocs|>
|<article et al tocs|>
\edef\:TOC{%
   \noexpand\ifx [\noexpand\:temp
      \noexpand\expandafter\noexpand\:TableOfContents
   \noexpand\else
      \noexpand\Auto:ent{|<entries for tocs of amsproc.cls|>}\noexpand\fi}
|<article tocs|>
>>>

\<entries for tocs of amsproc.cls\><<<
\ifnum \c@tocdepth >\m@ne part,likepart,\fi
\ifnum \c@tocdepth >\z@ section,likesection,\fi
\ifnum \c@tocdepth >1 subsection,likesubsection,\fi
\ifnum \c@tocdepth >2 subsubsection,likesubsubsection,\fi
\ifnum \c@tocdepth >3 paragraph,\fi
\ifnum \c@tocdepth >4 subparagraph,\fi
UnDFexyz
>>>

\<table/figure of amsproc.cls\><<<
\def\endtable{\end@float}
\def\endfigure{\end@float}
>>>

\<title page of amsproc.clsNO\><<<
\pend:def\@maketitle{%
  \Configure{footnotetext}
    {\IgnorePar\HPage{\a:dagger}}%
    {\EndHPage{}}%
}
\NewConfigure{dagger}{1} 
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{Title Page}
%%%%%%%%%%%%%%%%%%%%

\<redefine ams maketitle\><<<
\let\o:maketitle:|=\maketitle
\def\maketitle{\bgroup 
   |<adjust minipageNum for setcounter footnote 0|>%
   \ifx \EndPicture\:UnDef  
      \def\sec:typ{title}%
      |<title for TITLE|>%
      |<maketitle defs|>%
   \fi 
   \pic:gobble\a:mktl  \o:maketitle:  \pic:gobble\b:mktl
   \egroup \let\maketitle|=\empty}
>>>

\<ams art + proc\><<<
\pend:def\@settitle{\a:ttl}       
\append:def\@settitle{\b:ttl\par}
>>>

\<ams book\><<<
\pend:def\@maketitle{%
   \pend:def\@title{\a:ttl}%    
   \append:def\@title{\b:ttl}%
}
>>>

\<ams art, proc, book\><<<
\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
   \c:def\a:ttl{#3}\c:def\b:ttl{#4}}
>>>

\<ams art\><<<
\pend:def\@maketitle{%
     \pend:def\newpage{\IgnorePar}%
     \let\after:maketitle=\empty
     |<@ maketitle art|>%
     |<@ maketitle defs|>}
>>>

\<ams proc, book\><<<
\pend:def\@maketitle{%
     \pend:def\newpage{\IgnorePar}%
     \let\after:maketitle=\empty
     |<@ maketitle defs|>}
>>>

\<ams art, proc, book\><<< 
\append:def\@maketitle{\a:@maketitle\after:maketitle\b:@maketitle}
\long\def\end:maketitle#1#2{\ifx #1\empty \else
   \expandafter\let\csname :\string #1\endcsname=#1
   \let#1=\empty
   \append:def\after:maketitle{\expand:after{\let#1=}\csname
        :\string #1\endcsname#2}\fi}
\NewConfigure{@maketitle}{2}
>>>

The tags \''\a:@maketitle' and \''\b:@maketitle' enclose setdate,
subjclass, keywords, addresses 

\<@ maketitle art\><<<
\ifx\@date\empty\else
  \end:maketitle\@date{\a:date\@setdate\b:date}\fi
>>>

\<ams art + proc\><<<
\pend:defI\@setauthors{\a:author \bgroup
   \def\andify{\nxandlist{\unskip, }{\unskip{} \and}{\unskip, \and}}%
   \def\@no@lnbk ########1[########2]{\a:newline}}
\append:defI\@setauthors{\egroup \b:author\par}
>>>

\<ams book\><<<
\pend:def\@maketitle{%
   \pend:def\authors{\a:author|</and for maketitle|>}%    
   \append:def\authors{\b:author}%
}
>>>

\<maketitle defs\><<<
\pend:def\@author{\a:author}\append:def\@author{\b:author}%
|</and for maketitle|>%
>>>

\<ams art, proc, book\><<<
\HRestore\thanks
\let\@adminfootnotes\relax
\def\:thanks#1{\par \a:thanks#1\@addpunct.\b:thanks}
\NewConfigure{thanks author date and}[8]{%
   \c:def\a:thanks{#1}\c:def\b:thanks{#2}\c:def\a:author{#3}\c:def\b:author{#4}%
   \c:def\a:date{#5}\c:def\b:date{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}
>>>

\<ams art, proc, book\><<<
\NewConfigure{subjclass}{2}
\NewConfigure{keywords}{2}
>>>

\<@ maketitle defs\><<<   |% order important |%
\end:maketitle\@subjclass{\a:subjclass\@setsubjclass\b:subjclass}%
\end:maketitle\@keywords{\a:keywords\@setkeywords\b:keywords}%
\end:maketitle\@setthanks{\let\thanks=\:thanks\thankses}%
>>>

\<ams art, proc, book\><<<
\pend:def\@setabstracta{\ifvoid\abstractbox
   \else\a:setabstract \fi}
\append:def\@setabstracta{\ifvoid\abstractbox
   \else\b:setabstract \fi}
\NewConfigure{setabstract}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{Sectioning}
%%%%%%%%%%%%%%%%%%%%

The latex classes use \`'\@sec' and \`'\@ssect' for defining sections
and starred sections.  The ams classes use only the first feature for
both types of classes, but assume negative depth \''\@m' for the depth
of starred sections (tex4ht records the level value in
\''\c:secnumdepth').  Hence, the \`'like' versions of the sectioning
comamnds are (currently?) not provided for the ams classes. The
\''\Configure{@sec @ssect}' is needed only for the \''@sec'; a
configuration for \''@ssect' is ignored.

\<sections of amsart.cls\><<<
|<ams art + book + proc|>
|<ams art + proc|>
|<ams no@sect|>
>>>

\<sections of amsbook.cls\><<<
|<ams art + book + proc|>
|<chapters for book / report|>
|<ams no@sect|>
>>>

\<sections of amsproc.cls\><<<
|<ams art + book + proc|>
|<ams art + proc|>
|<ams no@sect|>
>>>

\<ams no@sect\><<<
\def\no@sect#1#2#3#4#5#6[#7]#8{%
  \edef\@toclevel{\ifnum#2=\@m 0\else\number#2\fi}%
  \ifnum #2>\c@secnumdepth \let\@secnumber\@empty
  \else \@xp\let\@xp\@secnumber\csname the#1\endcsname
        \refstepcounter{#1}\fi
  \let\@svsec|=\empty
  \let\@svsechd|=\empty
  \global\@nobreaktrue
  \@xsect{#5}}
\let\@ssect=\relax 
>>>

\<ams art + proc\><<<
\let\no@part|=\part
\Def:Section\part{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thepart \fi}{#1} 
\let\no:part|=\part
\def\part{\rdef:sec{part}}
>>>

\<ams book\><<<
\let\:tempb\part
\Def:Section\part{\ifnum \c@secnumdepth >-2 \the\c@part\fi}{#1}
\let\:part\part
\let\part\:tempb
\let\no@part\@part
\def\@part[#1]#2{%
   \gdef\c:secnumdepth{-2}%
   \ifnum \c@secnumdepth >-2\relax \refstepcounter{part}\fi
   \HtmlEnv   \Toc:Title{#1}\:part{#2}}
\Def:Section\likepart{}{#1}
\let\:likepart\likepart
\let\likepart\:UnDef
\let\no@spart\@spart
\def\@spart#1{\HtmlEnv \:likepart{#1}}
>>>

\<ams divisions\><<<
\let\no@section|=\section
\Def:Section\section{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesection \fi}{#1} 
\let\no:section|=\section
\def\section{\rdef:sec{section}}
>>>

\<ams divisions\><<<
\let\no@subsection|=\subsection
\Def:Section\subsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsection \fi}{#1}
\let\no:subsection|=\subsection
\def\subsection{\rdef:sec{subsection}}
>>>

\<ams divisions\><<<
\let\no@subsubsection|=\subsubsection
\Def:Section\subsubsection{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubsubsection \fi}{#1}
\let\no:subsubsection|=\subsubsection
\def\subsubsection{\rdef:sec{subsubsection}}
>>>

\<ams divisions\><<<
\let\no@paragraph|=\paragraph
\Def:Section\paragraph{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \theparagraph \fi}{#1}
\let\no:paragraph|=\paragraph
\def\paragraph{\rdef:sec{paragraph}}
>>>

\<ams divisions\><<<
\let\no@subparagraph|=\subparagraph
\Def:Section\subparagraph{\ifnum \c:secnumdepth>\c@secnumdepth   \else
   \thesubparagraph \fi}{#1}
\let\no:subparagraph|=\subparagraph
\def\subparagraph{\rdef:sec{subparagraph}}
>>>

\<ams art, proc, book\><<<
\pend:defI\@seccntformat{%
  \def\@secnumpunct{\ifnum \c:secnumdepth>0
     \expandafter\ifx\csname the##1\endcsname\relax \else. \fi\fi}}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{Tables Of Contents}
%%%%%%%%%%%%%%%%%%%%

\<ams art, proc\><<<
\def\tableofcontents{%
   \ifx\contentsname\empty \else
      \ifx\contentsname\:UnDef \else
%         \Configure{toToc}{}{section}%
         |<protect from TocAt|>\section*{\contentsname}%
         |<end protect from TocAt|>%
%         \Configure{toToc}{?}{section}%
   \fi\fi
   \:tableofcontents}
>>>

\<ams book\><<<
\def\tableofcontents{%
   \ifx\contentsname\empty \else
%      \Configure{toToc}{}{likechapter}%
      |<protect from TocAt|>\chapter*{\contentsname}%
      |<end protect from TocAt|>%
%      \Configure{toToc}{?}{likechapter}%
   \fi
   \:tableofcontents}
>>>

\<tocs of amsart.cls\><<<
|<latex et al tocs|>
\edef\:TOC{%
   \noexpand\ifx [\noexpand\:temp
      \noexpand\expandafter\noexpand\:TableOfContents
   \noexpand\else
      \noexpand\Auto:ent{|<entries for tocs of amsart.cls|>}\noexpand\fi}
>>>

\<entries for tocs of amsart.cls\><<<
\ifnum \c@tocdepth >\m@ne part,\fi
\ifnum \c@tocdepth >\z@  section,\fi
\ifnum \c@tocdepth >1    subsection,\fi
\ifnum \c@tocdepth >2 subsubsection,\fi
\ifnum \c@tocdepth >3 paragraph,\fi
\ifnum \c@tocdepth >4 subparagraph,\fi
UnDFexyz
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{amsldoc.cls}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Calls:

\<amsldoc.4ht\><<<
% amsldoc.4ht (|version), , generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
\def\<#1>{\textit{$\mathord\langle$#1\/$\mathord\rangle$}}
|<qed symbol|>
\Hinput{amsldoc}
\endinput
>>>        \AddFile{5}{amsldoc}

\Chapter{amsdtx.cls}

\<amsdtx.4ht\><<<
% amsdtx.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2001. Eitan M. Gurari
|<TeX4ht copywrite|>
|<amsdtx hooks|>
\let\amsdtx:Hinput=\Hinput
\def\Hinput#1{%
   \let\Hinput=\amsdtx:Hinput \Hinput{#1}%
   |<restore amsdtx|>%
   \Hinput{amsdtx}}
\endinput
>>>        \AddFile{9}{amsdtx}

\<restore amsdtx\><<<
\let\maketitle\o:maketitle:
>>>

\<amsdtx hooks\><<<
\pend:def\@maketitle{\bgroup
   \ifx \EndPicture\:UnDef
      \def\sec:typ{title}%
      \Configure{HtmlPar}{}{}{}{}%
      \Configure{newpage}{}%
      \ConfigureEnv{center}{\empty}{}{\empty}{\empty}
      \Configure{tabular}{}{}{}{\e:mktl}{}{}%
      \ConfigureEnv{tabular}{\empty}{}{}{}%
      \pend:def\@title{\a:ttl}\append:def\@title{\b:ttl}%
      \pend:def\@date{\a:date}\append:def\@date{\b:date}%
      \pend:def\@author{\a:author}\append:def\@author{\b:author}%
      \def\and{\a:and}
   \fi
   \pic:gobble\a:mktl}
\append:def\@maketitle{\pic:gobble\b:mktl
   \egroup \let\maketitle\empty}
>>>

%----------------------------- amsthm.sty -----------------------
\Chapter{amsthm.sty}

\<amsthm.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amsthm.4ht                            |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<body of amsthm.sty|>
|<theorem in amsthm.sty|>
\Hinput{amsthm}
\endinput
>>>        \AddFile{5}{amsthm}

\<body of amsthm.sty\><<<
|<qed symbol|>
>>>

\<qed symbol\><<<
\def\qed:sym{%
  \leavevmode\Picture+[Q.E.D.]{}\o:qedsymbol:\EndPicture
  \SavePicture\qed:sym[Q.E.D.] }
\def\:temp{\qed:sym }
\MathSymbol\mathop{qedsymbol}
>>>

\<shared ams thm/cls\><<<  
\ifx \deferred@thm@head\:UnDef\else
   \expandafter\dth@everypar\expandafter{%
     \the\dth@everypar
     \edef\:temp{\the\ht:everypar}\ifx \:temp\empty
        \ht:everypar{\HtmlPar}\ShowPar
     \fi 
   }%
   |<revised begintheorem|>
\fi
>>>

\<revised begintheorem\><<<
\def\deferred@thm@head#1{%
  \if@inlabel \indent \par \fi |% eject a section head if one is pending|%
  \if@nobreak
    \adjust@parskip@nobreak
  \else
    \addpenalty\@beginparpenalty
    \addvspace\@topsep
    \addvspace{-\parskip}%
  \fi
  \global\@inlabeltrue
  \ht:everypar\dth@everypar
  \let\sv:newtheorem=\b:newtheorem \let\b:newtheorem=\empty
  \item[\normalfont#1]% 
  \let\b:newtheorem=\sv:newtheorem \b:newtheorem \ignorespaces
}
>>>

The old version of amsthm used \`'\item[\normalfont#1]' instead
of \`'\sbox\@labels{\normalfont#1}'--it is preferable for tex4ht,
in case the lemma starts with something like \`'\begin{equation}'.

The following code is for the cases that the \''\refstercounter'
is ignored in \''\@thm'.

\<theorem in amsthm.sty\><<<
\def\:temp{\ShowRefstepAnchor\o:@begintheorem:}
\HLet\@begintheorem|=\:temp
|<shared ams thm/cls|>
>>>

\<shared ams thm/cls\><<<  
\def\:temp#1{%
   \def\:temp{#1}%
   \edef\:temp{\expandafter\eorem:syle  \meaning\:temp|<par del|>}%
   \expandafter\let\expandafter\@tmp:sv\csname th@\:temp\endcsname
   \def\:tempa##1{%
      \expandafter\append:def\csname th@##1\endcsname{%
         \expandafter\let\csname th@##1\endcsname=\@tmp:sv 
         \let\thm:headnl=\thmheadnl
         \pend:def\thmheadnl{\let\thmheadnl\thm:headnl \b:newtheorem}%
         \append:def\thmheadnl{\expandafter
             \ht:everypar\expandafter{\the\ht:everypar 
             \ht:everypar{\HtmlPar}}}}}%
   \expandafter\:tempa\expandafter{\:temp}%
   \let\sv:trivlist=\trivlist
   \def\trivlist{\let\trivlist\sv:trivlist \let\sv:trivlist\:unDef
      \a:newtheorem \trivlist}%
   \aftergroup\c:newtheorem
   \:thm{#1}}
\HLet\@thm\:temp
\HRestore\@endtheorem
>>>

The @thm appends its setting to  the hook of theoremstyle:

\<shared ams thm/cls\><<<
\bgroup
\def\bgroup{\catcode`\\=0 \catcode`\t=11 }
\catcode`\/=0
\catcode`\@=12
\catcode`\h=12
\catcode`\\=12
/catcode`/t=12
/edef~{/def/noexpand/eorem:syle##1\th@##2 |<par del|>{##2}}
/bgroup
\expandafter\egroup ~
>>>

\<shared ams thm/cls\><<<
\long\def\:temp[#1]{\par\a:proof
    \csname o:\string\proof :\endcsname[#1]\b:proof}
\expandafter\HLet\csname \string\proof \endcsname=\:temp
\append:def\endproof{\c:proof}
\NewConfigure{proof}{3}
>>>

\Verbatim
   \newtheoremstyle{note}% name
     {3pt}%      Space above
     {3pt}%      Space below
     {}%         Body font
     {}%         Indent amount (empty = no indent, \parindent = para indent)
     {\itshape}% Thm head font
     {:}%        Punctuation after thm head
     {.5em}%     Space after thm head: `` `` = normal interword space;
           %       \newline = linebreak
     {}%         Thm head spec (can be left empty, meaning `normal')
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%
\Chapter{ams....sty}
%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%
\Section{amsbsy.sty}
%%%%%%%%%%%%%%%%%%%%%

\<amsbsy.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amsbsy.4ht                            |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<amsbsy.sty|>
\Hinput{amsbsy}
\endinput
>>>        \AddFile{5}{amsbsy}

\<amsbsy.sty\><<<
\def\:tempc#1{\begingroup
  \setboxz@h{\thinmuskip0mu
    \medmuskip\m@ne mu\thickmuskip\@ne mu
    \setbox\tw@\hbox{$#1\m@th$}\kern-\wd\tw@
    ${}#1{}\m@th$}%
  \edef\@tempa{\endgroup\let\noexpand\binrel@@
    \ifdim\wdz@<\z@ \noexpand\mathbin
    \else\ifdim\wdz@>\z@ \noexpand\mathrel
    \else \relax\fi\fi}%
  \@tempa
}
\HLet\binrel@\:tempc
>>>

\<amsbsy.sty\><<<
\def\:tempc#1#2{%
  \a:pmb\binrel@@{\hbox{$\m@th#1{#2}$}}\b:pmb
} 
\HLet\pmb@\:tempc
\def\:tempc#1#2#3{%
  \leavevmode\a:pmb\hbox{#3}\b:pmb
} 
\HLet\pmb@@\:tempc
\NewConfigure{pmb}{2}
>>>

%%%%%%%%%%%%%%%%%%
\Section{amssymb.sty}
%%%%%%%%%%%%%%%%%%

\<amssymb.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amssymb.4ht                           |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{amssymb}
\endinput
>>>        \AddFile{8}{amssymb}

%%%%%%%%%%%
\Chapter{Ams Structures}
%%%%%%%%%

%%%%%%%%%%%%%%%%%
\Section{AMS for Plain}
%%%%%%%%%%%%%%%%%

\Verbatim
(/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/amslatex/amsart.cls
Document Class: amsart 1995/02/23 v1.2b
(/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/amslatex/amsgen.sty)
(/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/amslatex/amsmath.sty
(/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/amslatex/amstext.sty)
(/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/amslatex/amsbsy.sty)
(/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/amslatex/amsopn.sty))

(/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/amslatex/amsthm.sty))
\EndVerbatim

/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/base/book.cls

\<record ams definitions\><<<
\def\:tmp#1#2{%
   \expand:after{\expandafter\let\csname ams:#1\endcsname|=}%
      \csname #1\endcsname
   \pend:def#2{%
      \expand:after{\expandafter\let\csname #1\endcsname|=}%
          \csname ams:#1\endcsname}}
   |<recall amstex.tex|>
   |<recall amsppt.sty|>
   |<recall osudeG|> 
>>>

%----------------------------- amsmath.sty -----------------------
%%%%%%%%%%%%%%%%%%%%%%
\Section{amsmath.sty}
%%%%%%%%%%%%%%%%%%%%%%

\SubSection{OutLine}

\<amsmath.4ht\><<<
% amsmath.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
\HRestore\cases
\HRestore\matrix
\HRestore\pmatrix
|<restore amsmath everydisplay|>
|<config amsmath.sty utilities|>
|<config amsmath.sty shared|>
|<body of amsmath.sty|>
|<equations of amsmath.sty|>
\:CheckOption{new-accents}     \if:Option \else
   |<accents of amsmath.sty|>
\fi
|<amsmath.sty|>
|<amsmath.sty and amstex.sty|>
\ifx \ifinany@\:Undef
   |<amsmath 1999|>
\else
   \:warning{ams files too old for TeX4ht}
\fi
\Hinput{amsmath}
\endinput
>>>        \AddFile{5}{amsmath}

\<body of amsmath.sty\><<<
\pend:def\subequations{\SkipRefstepAnchor }
>>>

\<body of amsmath.sty\><<<
\NewConfigure{boldsymbol}{2}
\pend:defI\boldsymbol{\a:boldsymbol}
\append:defI\boldsymbol{\b:boldsymbol}
>>>

\<body of amsmath.sty\><<<
\def\hdots@for#1#2{\multicolumn{#2}c% 
  {\m@th \hdots:for{#1}\hfil}}
\def\hdots:for#1{\dotsspace@1.5mu\mkern-#1\dotsspace@ 
   \xleaders\hbox{$\m@th\mkern#1\dotsspace@.\mkern#1\dotsspace@$}% 
           \hfill 
   \mkern-#1\dotsspace@}
\NewConfigure{hdotsfor}[1]{\def\a:hdotsfor##1{#1}}
\let\a:hdotsfor=\hdots:for
\def\:tempc{\a:hdotsfor}
\HLet\hdots:for\:tempc
>>>

\<body of amsmath.sty\><<<
\expandafter\ifx \csname tmp:muskip\endcsname\relax
   \csname newmuskip\endcsname \tmp:muskip
\fi
\expandafter\def\csname tmspace \endcsname#1#2#3{%
  \ifmmode
    \bgroup 
      \tmp:muskip #1#2\edef\mathglue{\the\tmp:muskip}%
      \tmp:dim #1#3\edef\textspace{\the\tmp:dim}\a:tmspace
    \egroup
  \else \kern #1#3\fi \relax
}
\edef\:tempc{\noexpand\protect
             \expandafter\noexpand\csname tmspace \endcsname}
\HLet\tmspace=\:tempc
\NewConfigure{tmspace}{1}       
\Configure{tmspace}{\mskip\mathglue}
>>>

\<body of amsmath.sty\><<<
\HRestore\over
\def\:tempc{\pic:gobble\a:over \o:@@over: \pic:gobble\b:over}
\HLet\@@over\:tempc
\HRestore\atop
\def\:tempc{\pic:gobble\a:atop \o:@@atop: \pic:gobble\b:atop}
\HLet\@@atop\:tempc
\def\::above{\pic:gobble\a:above \o:@@above:\tmp:dim
            \pic:gobble\b:above }
\def\:above{\afterassignment\::above}
\def\:tempc{\Protect\:above \tmp:dim=}
\HLet\@@above\:tempc
>>>

\<body of amsmath.sty\><<<
\HRestore\abovewithdelims
\def\::abovewithdelims#1#2{\pic:gobble\a:abovewithdelims 
   \o:@@abovewithdelims:#1#2\tmp:dim\pic:gobble\b:abovewithdelims}
\def\:abovewithdelims#1#2{\def\:temp{\::abovewithdelims#1#2}%
   \afterassignment\:temp\tmp:dim}
\def\:tempc{\Protect\:abovewithdelims }
\HLet\@@abovewithdelims\:tempc
\NewConfigure{abovewithdelims}{2}
\HRestore\overwithdelims
\def\:overwithdelims#1#2{\pic:gobble\a:overwithdelims 
   \o:@@overwithdelims:#1#2\pic:gobble\b:overwithdelims}
\def\:tempc{\Protect\:overwithdelims}
\HLet\@@overwithdelims\:tempc
\NewConfigure{overwithdelims}{2}
\HRestore\atopwithdelims
\def\:atopwithdelims#1#2{\pic:gobble\a:atopwithdelims 
   \o:@@atopwithdelims:#1#2\pic:gobble\b:atopwithdelims}
\def\:tempc{\Protect\:atopwithdelims}
\HLet\@@atopwithdelims\:tempc
\NewConfigure{atopwithdelims}{2}
>>>

\<amsmath.sty and amstex.sty\><<<
\def\:tempc#1#2#3{\a:underarrow@
   \hbox{$\m@th#2#3$}\b:underarrow@
   \hbox{#1#2}\c:underarrow@
}
\HLet\underarrow@\:tempc
\def\:tempc#1#2#3{\a:overarrow@
   \hbox{#1#2}\b:overarrow@
   \hbox{$\m@th#2#3$}\c:overarrow@
}
\HLet\overarrow@\:tempc
\NewConfigure{underarrow@}{3}
\NewConfigure{overarrow@}{3}
>>>

The following was needed to hide paragraph breaks in \`'math' option,
due to a \''\vtop' in the macro definition.

\<amsmath.sty and amstex.sty DEPRECATED\><<<
\def\:temp{\Configure{HtmlPar}{}{}{}{}\o:overarrow@:}
\HLet\overarrow@|=\:temp
>>>

\<amsmath.sty\><<<
\let\:tempc|=\measure@
\pend:defI\:tempc{\bgroup
   \RecallTeXcr \HRestore\noalign \let\EndPicture\empty
   \let\halign|=\TeXhalign \let\span|=\:span  
   \expandafter\HRestore\csname begin \endcsname
   \expandafter\HRestore\csname end \endcsname
 \a:measure@ }
\append:defI\:tempc{\egroup}
\HLet\measure@|=\:tempc
\NewConfigure{measure@}{1}
>>>

\<amsmath.sty\><<<
\HLet\savealignstate@|=\empty
\renewcommand{\n:smash:}[2][tb]{%
  \def\smash@{#1}%
  \ifmmode\@xp\o:mathpalette:\@xp\mathsm@sh\else
        \@xp\makesm@sh\fi{#2}}
>>>

\<body of amsmath.styNO\><<<
\append:defI\collect@body{\let\halign\TeXhalign \HRestore\noalign}
>>>

\<body of amsmath.sty\><<<
\let\ltx@label|=\lb:l
>>>

\<body of amsmath.sty\><<<
\let\Mathaccent:|=\mathaccent@
\def\mathaccent@#1#2{\ifx \EndPicture\:UnDef 
     \DN@{\Picture+{}\Mathaccent:{#1}{#2}\EndPicture}%
  \else\DN@{\Mathaccent:{#1}{#2}}\fi\next@}
>>>

\<amsmath.sty and amstex.sty\><<<
\def\:temp#1#2{\a:overset\binrel@{#2}%
  \binrel@@{\mathop{\kern\z@#2}\limits^{#1}}\b:overset}
\HLet\overset|=\:temp
\NewConfigure{overset}{2}
\def\:temp#1#2{\a:underset\binrel@{#2}%
  \binrel@@{\mathop{\kern\z@#2}\limits_{#1}}\b:underset}
\HLet\underset|=\:temp
\NewConfigure{underset}{2}
|<plain, fontmath, amsmath, amstex|>
>>>

\<body of amsmath.sty\><<<
\def\:temp#1{{\a:boxed\leavevmode
   \vbox{\m@th$\displaystyle#1$}\b:boxed}} 
\HLet\boxed|=\:temp
\NewConfigure{boxed}{2}
>>>

%\edef\:temp{%
%   \noexpand\catcode`\noexpand\^=\the\catcode`\^
%   \noexpand\catcode`\noexpand\_=\the\catcode`\_ }

\<body of amsmath.sty\><<<
\newcommand\:temp:xrightarrow[2][]{\a:xrightarrow {\o:xrightarrow:[#1]{#2}}\b:xrightarrow}
\HLet\xrightarrow|=\:temp:xrightarrow
\NewConfigure{xrightarrow}{2}
\newcommand\:temp:xleftarrow[2][]{\a:xleftarrow {\o:xleftarrow:[#1]{#2}}\b:xleftarrow}
\HLet\xleftarrow|=\:temp:xleftarrow
\NewConfigure{xleftarrow}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Fractions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
\expandafter\def\csname genfrac \endcsname#1#2#3#4{%
  \def\@tempa{#1#2}%
  \edef\@tempb{\@nx\@genfrac\@mathstyle{#4}%
    \expandafter\noexpand\csname @@\ifx @#3@over\else above\fi
    \ifx\@tempa\@empty \else withdelims\fi\endcsname}%
  \@tempb{#1#2#3}}
\def\:tempc#1#2#3#4#5{{\a:genfrac#1\b:genfrac{\c:genfrac#4#2#3\relax
   {\d:genfrac#5\e:genfrac}}\f:genfrac}}
\HLet\@genfrac|=\:tempc
\NewConfigure{genfrac}{6}
\HRestore\frac
\def\:temp#1#2{{\a:frac\begingroup
   #1\endgroup\b:frac \@@over \c:frac #2\d:frac}}
\expandafter\HLet\csname frac \endcsname\:temp
>>>

\<tcilatex fractions\><<<
\def\:tempc#1#2{\o:dfrac:{\a:dfrac#1\b:dfrac}{\c:dfrac#2\d:dfrac}}
\HLet\dfrac|=\:tempc
\NewConfigure{dfrac}{4}
\def\:tempc#1#2{\o:tfrac:{\a:tfrac#1\b:tfrac}{\c:tfrac#2\d:tfrac}}
\HLet\tfrac|=\:tempc
\NewConfigure{tfrac}{4}
\def\:tempc#1#2{\o:binom:{\a:binom#1\b:binom}{\c:binom#2\d:binom}}
\HLet\binom|=\:tempc
\NewConfigure{binom}{4}
\def\:tempc#1#2{\o:dbinom:{\a:dbinom#1\b:dbinom}{\c:dbinom#2\d:dbinom}}
\HLet\dbinom|=\:tempc
\NewConfigure{dbinom}{4}
\def\:tempc#1#2{\o:tbinom:{\a:tbinom#1\b:tbinom}{\c:tbinom#2\d:tbinom}}
\HLet\tbinom|=\:tempc
\NewConfigure{tbinom}{4}
>>>

\<\><<<
\let\n:frac:|=\:UnDef
\DeclareRobustCommand{\n:frac:}[2]{|<amsamth.sty frac|>}    
\def\:temp#1#2{{\a:frac\begingroup
   #1\endgroup\b:frac \@@over \c:frac #2\d:frac}}
\HLet\frac|=\:temp
\NewConfigure{frac}{4}
>>>

\<amsmath.sty\><<<
\let\:tempc\maketag@@@
\pend:defI\:tempc{\a:maketag}
\append:defI\:tempc{\b:maketag}
\NewConfigure{maketag}{2}
\HLet\maketag@@@\:tempc
>>>

%%%%%%%%%%%%%%%
\SubSection{align}
%%%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
\def\math@cr@@[#1]{\ifnum0=`{\fi \iffalse}\fi\math@cr@@@
   \o:noalign:{\vskip#1\relax}}
>>>

The above had also \`+\noalign{\vskip#1\relax}}+ in it, but it cause
two extra   rows in subarray.

\<equations of amsmath.sty\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:align!1!2{%
   |<inany@true|>  \inalign@true |<displaybreak@|>\intertext@
   \ifingather@\else\displ@y@\fi\Let@  \let\math@cr@@@\math@cr@@@align
   \ifxxat@\else \let\tag\tag@in@align \fi
   \let\label\label@in@display !1% set st@r
   \ifst@rred\else \global\@eqnswtrue  \fi   \measure@{!2}%
   \global\row@\z@ \tabskip\eqnshift@ 
   |<clean span|>%
   |<halign amsmath align|>}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<halign amsmath align\><<<
\SaveMkHalignConf:g{\align:type}\HRestore\noalign
\MkHalign#{|<amsmath align pattern|>}!2%
>>>

\<amsmath align pattern\><<<
\span
   &\@lign$\m@th\displaystyle{|<sub/sup base|>#}$%
   &\@lign$\m@th\displaystyle{|<sub/sup base|>#}$%
>>>

We need to clean  the \''\c:halign' and \''\d:halign' around the
\''\span'.

\<clean span\><<<
\Configure{PauseMkHalign}
  {\Configure{PauseMkHalign}{}{}{}{}\expandafter\clean:span}{}{}{}%
>>>

\<equations of amsmath.sty\><<<
\def\clean:span#1\c:halign{%
  \TeXhalign \bgroup \:span}
>>>

% \restore@math@cr

\<equations of amsmath.sty\><<<
\ifx \ifinany@\:Undef
   |<since 1999 endalign|>
\else
   |<until 1999 endalign|>
\fi
\HLet\endalign|=\:tempc
\def\:tempc{\pic:MkHalign{\align:type}} 
\HLet\align@|=\:tempc
>>>

\<since 1999 endalign\><<<
\def\:tempc{%
        \math@cr
    \EndMkHalign \RecallMkHalignConfig \csname b:\align:type\endcsname
    \ifingather@  \restorealignstate@  \egroup \nonumber 
      \ifnum0=`{\fi\iffalse}\fi%
    \else         $$\fi
    \global\@ignoretrue
}
>>>

\<until 1999 endalign\><<<
\def\:tempc{%
        \math@cr
    \EndMkHalign \RecallMkHalignConfig \csname b:\align:type\endcsname
    \ifingather@  \restorealignstate@  \egroup \nonumber 
      \ifnum0=`{\fi}%
    \else         $$\fi
    \global\@ignoretrue
}
>>>

\<equations of amsmath.styNO\><<<
\NewConfigure{align}{6}
\NewConfigure{align*}{6}
>>>

\<equations of amsmath.sty\><<<
|<ams align config util|>
\def\:tempc#1{%
   \expandafter\pend:def\csname #1\endcsname{\def\align:type{#1}}%
   \NewConfigure{#1}[6]{\Config:alg{##1}{##2}{##3}{##4}{##5}{##6}{#1}}%
   \Configure{#1}{}{}{}{}{}{}%
   \def\:temp{#1}\def\:tempa{align}\ifx \:temp\:tempa\else
      \@xp\let\csname reg:#1\endcsname|=\reg:align
      \@xp\let\csname end#1\endcsname|=\endalign
   \fi }
\:tempc{alignat}
\:tempc{alignat*}
\:tempc{xalignat}
\:tempc{xalignat*}
\:tempc{xxalignat}
\:tempc{align}
\:tempc{align*}
\:tempc{flalign}
\:tempc{flalign*}
\pend:defIII\start@align{\Configure{$$}{}{}{}}             
>>>

\<ams align config util\><<<
\def\Config:alg#1#2#3#4#5#6#7{%
   \expandafter\c:def\csname a:#7\endcsname{\global
      \let\sv:amps|=\add:amps #1}%
   \expandafter\c:def\csname b:#7\endcsname{#2\global
      \let\add:amps|=\sv:amps}%
   \expandafter\c:def\csname c:#7\endcsname{#3}%
   \expandafter\c:def\csname d:#7\endcsname{#4}%
   \expandafter\c:def\csname e:#7\endcsname{\expandafter\align:td
      \expandafter{\csname f:#7\endcsname}{#5}{#6}}%
}
\def\align:td#1#2#3{\iftag@ 
     \ifnum \add:amps>0
        \gHAdvance\add:amps |by -1   \gHAdvance\HCol |by -1
        \global\let#1|=\empty 
        \ifnum \add:amps=0 \gHAdvance\HCol|=1 #2\gdef#1{#3}\fi     
     \else #2\gdef#1{#3}\fi
   \else \gHAssign\add:amps|=\HCol\relax #2\gdef#1{#3}\fi}%
>>>

The \`'align' environment set labels by rewriting the row
with empty entry, and adding the abel in an extra entry. That
is, with a format of the form
\`'align-\label=&....maxfields@-1....&latex-\label'.  The machinary is
within \''\add@amps'.

%     \let\:tempa|=\:temp
%     \def\:temp!!!!1\egroup{\:tempa !!!!1\EndMkHalign}%

Without  the \''\HRestore\noalign' we get infinite loop. Where? Why?

\<sub/sup base\><<<
{\HCode{}}%
>>>

%%%%%%%%%%%%%
\SubSection{Aligned}
%%%%%%%%%%%%%

\<EQUATIONS of amsmath.sty\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:align!1!2{%
   |<inany@true|>  \inalign@true |<displaybreak@|>\intertext@
   \ifingather@\else\displ@y@\fi\Let@  \let\math@cr@@@\math@cr@@@align
   \ifxxat@\else \let\tag\tag@in@align \fi
   \let\label\label@in@display !1% set st@r
   \ifst@rred\else \global\@eqnswtrue  \fi   \measure@{!2}%
   \global\row@\z@ \tabskip\eqnshift@ 
   |<clean span|>%
   |<halign amsmath align|>}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<equations of amsmath.sty\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:start@aligned!1!2{%
   \savecolumn@ 
   \vcenter \bgroup
        \maxfields@!2\relax
        \ifnum\maxfields@>\m@ne 
            \multiply\maxfields@\tw@ 
            \let\math@cr@@@\math@cr@@@alignedat 
        \else 
            \let\math@cr@@@\math@cr@@@aligned 
        \fi
        \Let@ \chardef\dspbrk@context\@ne 
        \default@tag 
        \global\column@\z@ 
   |<halign amsmath aligned|>}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<halign amsmath aligned\><<<
\SaveMkHalignConf:g{start@aligned}\HRestore\noalign
\MkHalign#{&\column@plus $\m@th\displaystyle{{\HCode{}}#}$%
           &\column@plus $\m@th\displaystyle{{\HCode{}}#}$}%
>>>

\<equations of amsmath.sty\><<<
\def\al:gned#1{%
   \Configure{start@aligned}{\csname a:#1\endcsname}%
       {\csname b:#1\endcsname}{\csname c:#1\endcsname}%
       {\csname d:#1\endcsname}{\csname e:#1\endcsname}%
       {\csname f:#1\endcsname}\pic:MkHalign{#1}}
\NewConfigure{start@aligned}{6}
>>>

\<equations of amsmath.sty\><<<
\def\:tempc{\crcr\EndMkHalign 
    \RecallMkHalignConfig \restorecolumn@
    \egroup  \b:start@aligned}
\HLet\endaligned|=\:tempc
\def\:temp{%
  \let\@testopt\alignsafe@testopt 
  \futurelet\:temp\aligned:a}
\def\aligned:a{\ifx [\:temp \expandafter\aligned:b
   \else \def\:temp{\aligned:b[c]}\expandafter\:temp \fi}
\def\aligned:b[#1]{%   
   \al:gned{aligned}{#1}\m@ne}
\HLet\aligned|=\:temp
\def\reg:aligned{\reg:start@aligned}
\NewConfigure{aligned}{6}
>>>

\<equations of amsmath.sty\><<<
\def\:temp{\futurelet\:temp\alignedat:a}
\def\alignedat:a{\ifx [\:temp \expandafter\alignedat:b
   \else \def\:temp{\alignedat:b[c]}\expandafter\:temp \fi}
\def\alignedat:b[#1]{%
    \let\@testopt\alignsafe@testopt 
    \al:gned{alignedat}{#1}\m@ne}
\HLet\alignedat|=\:temp
\def\reg:alignedat{\reg:start@aligned}
\NewConfigure{alignedat}{6}
>>>

% \def\:tempc{\crcr\EndMkHalign 
%     \RecallMkHalignConfig \restorecolumn
%     \egroup \b:start@aligned}
% \HLet\endalignedat|=\:tempc

%%%%%%%%%%%%%
\SubSection{Gathered}
%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:gathered[!1]{%
  \RIfM@\else 
      \nonmatherr@{\begin{gathered}}% 
  \fi 
  \null  \vcenter\bgroup 
    \Let@ \chardef\dspbrk@context\@ne \restore@math@cr 
    |<ialign gathered|>}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<ialign gathered\><<<
\SaveMkHalignConf:g{gathered}%|%\HRestore\noalign|%
\MkHalign#{$\m@th\displaystyle{\HCode{}}#$}%
>>>

\<equations of amsmath.sty\><<<
\def\:tempc{\crcr\EndMkHalign 
    \RecallMkHalignConfig \egroup\b:gathered}
\HLet\endgathered|=\:tempc
\def\:temp{\pic:MkHalign{gathered}} 
\expandafter\HLet\csname \string\gathered\endcsname|=\:temp
\NewConfigure{gathered}{6}
>>>

%%%%%%%%%%%%%%%%%%
\SubSection{multline}
%%%%%%%%%%%%%%%%%%

The environment of AmsLaTeX are being scanned as parameters of
\''\collect@@body'.  Hence, the featured of TeX4ht introduced to
\''\halign' are nulled there. 

\<equations of amsmath.sty\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:multline!1{%
  |<inany@true|>    \Let@
  \@display@init{\global\advance\row@\@ne \global\dspbrk@lvl\m@ne}%
  |<displaybreak@|>    \restore@math@cr    \let\tag\tag@in@align
  \global\tag@false \global\let\raise@tag\@empty   |% \mmeasure@{#1}%|%
  \let\tag\gobble@tag |<multline label|>%
  |<halign amsmath multline|>}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<halign amsmath multline\><<<
\ifst@rred
  \expandafter\let\csname e:multline*\endcsname|=\empty
  \expandafter\let\csname f:multline*\endcsname|=\empty
\fi
\SaveMkHalignConf:g{multline\ifst@rred *\fi}\HRestore\noalign
\MkHalign#{\hbox{$\m@th\displaystyle|<sub/sup base|>#$}}!1%
>>>

\<multline label\><<<
\ifst@rred  \let\label\@gobble  \else
   \stepcounter{equation}%
   \def\label{\let\cnt:currentlabel\@currentlabel
      \def\:@currentlabel{\ifx \cnt:currentlabel\@currentlabel
      \the\c@equation\else \@currentlabel\fi}%
      \anc:lbl r{equation}\ltx@label}%
   \edef\@currentlabel{\the\c@equation}%
\fi
>>>

\<multline tag\><<<
\ifst@rred\else
   \e:multline\csname a:multline-num\endcsname
   \tagform@\theequation\csname b:multline-num\endcsname\f:multline
\fi 
>>>

%    \e:multline(\theequation)\f:multline

\<equations of amsmath.sty\><<<
\def\:tempc{|<multline tag|>\math@cr \EndMkHalign 
   \RecallMkHalignConfig \csname b:multline\ifst@rred *\fi\endcsname
   $$\global\@ignoretrue  }
\HLet\endmultline|=\:tempc
\def\:tempc{\pic:MkHalign{multline\ifst@rred *\fi}} 
\HLet\multline@|=\:tempc
\NewConfigure{multline}{6}
\NewConfigure{multline-num}{2}
\@xp\let\csname reg:multline*\endcsname|=\reg:multline
\@xp\let\csname endmultline*\endcsname|=\endmultline
\NewConfigure{multline*}{4}
>>>

%%%%%%%%%%%%%%%%
\SubSection{gather}
%%%%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:gather!1{%
   \ingather@true  |<gather 1999|>%
   \let\tag\tag@in@align  \let\label\label@in@display 
   \intertext@ \displ@y@
   \Let@  \let\math@cr@@@\math@cr@@@gather  |%\gmeasure@{#1}%|%
   \global\shifttag@false    \global\row@\@ne
  |<halign amsmath gather|>}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<gather 1999\><<<
\ifx \ifinany@\:Undef
   \let\split\insplit@   \chardef\dspbrk@context\z@
\else
   \inany@true
\fi
>>>

\<halign amsmath gather\><<<
\SaveMkHalignConf:g{gather\ifst@rred *\fi}\HRestore\noalign
\MkHalign#{|<amsmath gather pattern|>}!1%
>>>

\<amsmath gather pattern\><<<
\hbox{$\m@th\displaystyle{|<sub/sup base|>#}$}%
&\hbox{|<sub/sup base|>#}%
>>>

\<equations of amsmath.sty\><<<
\def\:tempc{\math@cr \EndMkHalign 
   \RecallMkHalignConfig \csname b:gather\ifst@rred *\fi\endcsname
   $$\global\@ignoretrue  }
\HLet\endgather|=\:tempc
\def\:tempc{\pic:MkHalign{gather\ifst@rred *\fi}} 
\HLet\gather@|=\:tempc
\NewConfigure{gather}{6}
\@xp\let\csname reg:gather*\endcsname|=\reg:gather
\@xp\let\csname endgather*\endcsname|=\endgather
\NewConfigure{gather*}{6}
>>>

\<equations of amsmath.sty\><<<
\def\:tempc{%
  \def\intertext##1{%
    \ifvmode\else\\\@empty\fi
    \noalign{%
      \penalty\postdisplaypenalty\vskip\belowdisplayskip
      \vbox{\normalbaselines
        \ifdim\linewidth=\columnwidth
        \else \parshape\@ne \@totalleftmargin \linewidth
        \fi
       \a:intertext \noindent##1\b:intertext\par}%
      \penalty\predisplaypenalty\vskip\abovedisplayskip%
    }%
}}
\HLet\intertext@=\:tempc
\NewConfigure{intertext}{2}
>>>

%%%%%%%%%%%%%%%
\SubSection{Roots}
%%%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
\HLet\leftroot|=\:gobble
\HLet\uproot|=\:gobble
>>>

%%%%%%%%%%%%%%%%%
\SubSection{Accents}
%%%%%%%%%%%%%%%%%

\<accents of amsmath.sty\><<<
\HLet\Hat|=\hat
\HLet\Check|=\check
\HLet\Tilde|=\tilde
\HLet\Acute|=\acute
\HLet\Grave|=\grave
\HLet\Dot|=\dot
\HLet\Ddot|=\ddot
\HLet\Breve|=\breve
\HLet\Bar|=\bar
\HLet\Vec|=\vec
>>>

%%%%%%%%%%%%%%%%%%%%%
\SubSection{Smallmatrix}
%%%%%%%%%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:smallmatrix{%
  \vcenter\bgroup \Let@\restore@math@cr\default@tag
  |<ialign amsmath smallmatrix|>}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<ialign amsmath smallmatrix\><<<
\SaveMkHalignConf:g{smallmatrix}%|%\HRestore\noalign|%
\MkHalign#{$\m@th\scriptstyle#$&&%
           $\m@th\scriptstyle#$}%
>>>

\<equations of amsmath.sty\><<<
\def\:tempc{\crcr\EndMkHalign 
    \RecallMkHalignConfig \egroup\b:smallmatrix}
\HLet\endsmallmatrix|=\:tempc
\def\:temp{\pic:MkHalign{smallmatrix}} 
\HLet\smallmatrix|=\:temp
\NewConfigure{smallmatrix}{6}
>>>

%%%%%%%%%%%%%%%%%%
\SubSection{substack}
%%%%%%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
\pend:defI\substack{\a:substack}
\append:defI\substack{\b:substack}
\NewConfigure{substack}{2}
>>>

%%%%%%%%%%%%%%%%%%
\SubSection{subarray}
%%%%%%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:subarray!1{%
  \vcenter\bgroup
  \Let@ \restore@math@cr \default@tag
  \baselineskip\fontdimen10 \scriptfont\tw@
  \advance\baselineskip\fontdimen12 \scriptfont\tw@
  \lineskip\thr@@\fontdimen8 \scriptfont\thr@@
  |<ialign amsmath subarray|>}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<ialign amsmath subarray\><<<
\let\e:subarray|=\empty \let\f:subarray|=\empty 
\everycr{}\SaveMkHalignConf:g{subarray}%|%\HRestore\noalign|%
\MkHalign#{$\m@th\scriptstyle#$}%
>>>

\<equations of amsmath.sty\><<<
\def\:tempc{\crcr\EndMkHalign 
    \RecallMkHalignConfig \egroup\b:subarray}
\HLet\endsubarray|=\:tempc
\def\:temp#1{\def\Hlcr{#1}\pic:MkHalign{subarray}{#1}} 
\HLet\subarray|=\:temp
\NewConfigure{subarray}{4}
>>>

%%%%%%%%%%%%%%%
\SubSection{split}
%%%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
\NewConfigure{split}{6}
                                    \catcode`\#|=13 \catcode`\!|=6
\def\:tempc{%
   \vbox\bgroup
        |<insplit 1999|>%
        \Let@  \restore@math@cr  \default@tag \everycr{}\a:split
        \SaveMkHalignConf:g{split}\HRestore\noalign
        \MkHalign#{|<amsmath split pattern|>}}
\HLet\insplit@|=\:tempc
                                    \catcode`\#|=6 \catcode`\!|=12
\def\:tempc{%
   \crcr\EndMkHalign \b:split \egroup }
\HLet\endsplit|=\:tempc
>>>

\<insplit 1999\><<<
\ifx \ifinany@\:Undef
   \chardef\dspbrk@context\@ne 
\fi
>>>

\<amsmath split pattern\><<<
 $\m@th\displaystyle{|<sub/sup base|>#}$%
&$\m@th\displaystyle{|<sub/sup base|>#}$%
>>>

\<amsmath 1999\><<<
\let\:tempc|=\gather@split
\append:defIII\:tempc{%
   \def\endmathdisplay@a{%
     \math@cr \EndMkHalign
     \RecallMkHalignConfig \csname b:gather\ifst@rred *\fi\endcsname    
     \egroup |%on \vcenter\bgroup|%
   }%
}
\HLet\gather@split|=\:tempc
>>>

The split environment looks like 
  \`'\begin{split}...\begin{split}...\end{split}...\endmathdisplay@a'.
The folowing tries to compensate for the above extra openning split 
environment.   

But in 2023, this causes fatal error in the compilation. Furthermore,
the test cases that follows work in the picture and MathML modes, 
so it seems that it isn't necessary anymore.

Bug report for the fatal error can be 
\Link[https://github.com/michal-h21/make4ht/issues/132]{}{}found here\EndLink

\<do not use in equations of amsmath.sty\><<<
\Configure{@begin}
  {split}
  {\relax
   \ifx  \split\insplit@ \else 
   \def\choose:begin{\global\let\choose:begin\@firstoftwo
                     \@secondoftwo}%
   \fi
  }
>>>

The split environment still has
\HPage{problems}
\Verbatim
\documentclass{article}  
   \usepackage{amsmath}  
\begin{document}  
 
 
\begin{equation*}  
    \begin{split}   
     a & = b \\   
       & = c   
    \end{split} 
\end{equation*} 
 
\hshow{---------------------------------------------------------------} 
 
$$ 
   \begin{split}  
    a & = b \\  
      & = c  
   \end{split}  
%\def\foo{\math@cr \black@ \totwidth@ \egroup    
%      \egroup}  
%\hshow{endmathdisplay@a} 
% \foo 
$$
 
 
\hshow{---------------------------------------------------------------} 
 
\[ 
   \begin{split}  
    a & = b \\  
      & = c  
   \end{split}  
\]    
 
\hshow{---------------------------------------------------------------} 
 
\begin{displaymath}  
    \begin{split}   
     a & = b \\   
       & = c   
    \end{split} 
\end{displaymath} 
 
\end{document}   
\EndVerbatim
\EndHPage{example}

%%%%%%%%%%%%%%%%%%%
\SubSection{Equations}
%%%%%%%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
\NewConfigure{equations}[2]{\def\pic:equa{#1}\def\pic:equb{#2}}
>>>

\<equations of amsmath.sty\><<<
\def\str:pic{\ifx \EndPicture\:UnDef
      \expandafter\Picture\pic:equa{ \pic:equb}%
   \else \let\EndPicture|=\empty  \fi
   \let\halign|=\TeXhalign}
>>>

% \<equations of amsmath.sty\><<<
% \def\:tempa{\a:eqnum\print@eqnum\b:eqnum}
% \HLet\print@eqnum\:tempc
% \NewConfigure{eqnum}{2}
% >>>

\<body of amsmath.sty\><<<
\def\:tempc#1{\a:eqref\o:eqref:{#1}\b:eqref}
\NewConfigure{eqref}{2}
>>>

%%%%%%%%%%%%%%%
\SubSection{Other}
%%%%%%%%%%%%%%%

\<equations of amsmath.sty\><<<
\def\make@df@tag@@#1{%
  \gdef\df@tag{\maketag@@@{#1}\def\@currentlabel{#1}\gdef\ams:delete:tag{}%
               |<def :currentlabel for make@df@tag|>%
               \anc:lbl r{}%
}}
\ExplSyntaxOn
\def\make@df@tag@@@#1{\gdef\df@tag{\tagform@{\tl_rescan:nn{}{#1}}%
  \toks@\@xp{\p@equation{#1}}\edef\@currentlabel{\the\toks@}%
  |<def :currentlabel for make@df@tag|>%
  \anc:lbl r{}%
  }}
\ExplSyntaxOff
>>>

%%%%%%%%%%%%%
\SubSection{Gauss Style}
%%%%%%%%%%%%%

\<gauss.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% gauss.4ht                             |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config gauss|>
\Hinput{gauss}
\endinput
>>>        \AddFile{8}{gauss}

\<config gauss\><<<
\def\:tempc[#1]{\def\g@environment{#1matrix}%
   \begin{\g@environment}%
   \begin{g@matrix}}
\expandafter\HLet\csname \string\gmatrix\endcsname=\:tempc
\def\:tempc{%
   \end{g@matrix}%
   \end{\g@environment}%
   \let\matrix\@empty
   \let\endmatrix\@empty
}
\HLet\endgmatrix=\:tempc
>>>

\<config gauss\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:g@matrix{%
\hbox\bgroup 
  \global\g@maxrow@old\g@maxrow 
  \global\g@maxcol@old\g@maxcol 
  \global\g@maxrow0% 
  \global\g@maxcol0% 
  \let\rowops\g@east 
  \let\colops\g@north 
  \vbox\bgroup 
   \def\\{\mathstrut\cr\global\advance\g@maxrow1\relax}% 
   \global\let\g@endregion\g@endmatrix 
   \global\g@tab=2\arraycolsep 
  |<ialign g@matrix|>}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<ialign g@matrix\><<<
\SaveMkHalignConf:g{g@matrix}%|%\HRestore\noalign|%
\MkHalign#{\g@prae#\g@post&&%
           \kern\g@tab\g@prae#\g@post}%
>>>

\<config gauss\><<<
\def\:tempc{%
 \g@endregion
 \global\g@maxrow\g@maxrow@old 
 \global\g@maxcol\g@maxcol@old 
 \global\let\g@endregion\g@endmatrix 
 \global\let\rowops\g@east 
 \global\let\colops\g@north 
}
\HLet\endg@matrix|=\:tempc
\def\:temp{\pic:MkHalign{g@matrix}} 
\HLet\g@matrix|=\:temp
\NewConfigure{gmatrix}[6]{%
   \def\a:g@matrix {#1}%
   \def\b:g@matrix {#2}%
   \def\c:g@matrix {#3}%
   \def\d:g@matrix {#4}%
   \def\e:g@matrix {#5}%
   \def\f:g@matrix {#6}%
}
\Configure{gmatrix}{}{}{}{}{}{}
>>>

\<config gauss\><<<
\def\:tempc{% 
   \crcr\EndMkHalign
   \RecallMkHalignConfig \egroup \egroup
   \b:g@matrix
   \global\let\colops\g@north
}
\HLet\g@endmatrix\:tempc
>>>

\<config gauss\><<<
\def\:tempc{% 
 \g@endregion  
 \def\swap{\g@east@arrow11\rowswapfromlabel\rowswaptolabel} 
 \def\add{\g@east@arrow01\rowaddfromlabel\rowaddtolabel} 
 \let\mult\g@east@mult 
 \gdef\rowops{\PackageError{gauss}%
                 {Two sets of row operations were specified in % 
                  just one matrix. This is not allowed.}} 
 \gdef\g@endregion{\b:rowops \egroup}% 
 \hbox\bgroup \a:rowops
} 
\HLet\g@east\:tempc
\def\:tempc#1#2#3#4#5[#6]#7#8{%
   \ifnum #1=#2\relax
      \hbox{$\a:swap #7\b:swap #8\c:swap$}%
   \else
      \hbox{$\a:add #7\b:add #8\c:add$}%
   \fi
}
\HLet\g@east@arrow@b\:tempc
\def\:tempc#1#2{%
   \hbox{$\a:mult #1\b:mult #2\c:mult$}%
}
\HLet\g@east@mult\:tempc
\NewConfigure{rowops}{2}
>>>

\<config gauss\><<<
\def\:tempc{% 
 \g@endregion 
 \gdef\colops{\PackageError{gauss} 
   {Two sets of column operations are specified in % 
    just one matrix. This is not allowed.}}% 
 \gdef\g@endregion{\b:colops \egroup}% 
 \def\swap{\g@north@arrow11\colswapfromlabel\colswaptolabel}% 
 \def\add{\g@north@arrow01\coladdfromlabel\coladdtolabel}% 
 \let\mult\g@north@mult 
 \hbox\bgroup \a:colops
} 
\HLet\g@north\:tempc
\def\:tempc#1#2#3#4#5[#6]#7#8{%
   \ifnum #1=#2\relax
      \hbox{$\a:swap #7\b:swap #8\c:swap$}%
   \else
      \hbox{$\a:add #7\b:add #8\c:add$}%
   \fi
}
\HLet\g@north@arrow@b\:tempc
\def\:tempc#1#2{%
   \hbox{$\a:mult #1\b:mult #2\c:mult$}%
}
\HLet\g@north@mult\:tempc
\NewConfigure{colops}{2}
\NewConfigure{mult}{3}
\NewConfigure{swap}{3}
\NewConfigure{add}{3}
>>>

%%%%%%%%%%%%%%%
\SubSection{Fonts}
%%%%%%%%%%%%%%%

\<amsfonts.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amsfonts.4ht                          |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<amsfonts sty|>
\Hinput{amsfonts}
\endinput
>>>        \AddFile{5}{amsfonts}

\<amsfonts sty\><<<<
\NewConfigure{mathbb}{2}  
\def\:temp#1{{\a:mathbb \o:mathbb:{#1}\b:mathbb}}
\HLet\mathbb\:temp
>>>

\<amsfonts sty\><<<<
\NewConfigure{mathfrak}{2}  
\def\:temp#1{{\a:mathfrak \o:mathfrak:{#1}\b:mathfrak}}
\HLet\mathfrak\:temp
>>>

Commands like \''\rm' need low level implemetation through 
dynamic configurations of symbols decorations at the htf source 
(e.g., \Verb+${\textbf abc}XX\bf abc \mathbf ab\mathbb{C}d\mathsf{C}$+).

%%%%%%%%%%%
amstext.sty
%%%%%%%%%%%

\<amstext.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amstext.4ht                           |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\def\:tempc#1{\hbox{\a:text#1\b:text}}
\HLet\text@|=\:tempc
\NewConfigure{text}{2}

\Hinput{amstext}
\endinput
>>>        \AddFile{5}{amstext}

%----------------------------- amstex.sty -----------------------
%%%%%%%%%%%%%%%%%%%
\Chapter{amstex.sty}
%%%%%%%%%%%%%%%%%%%

Note that \`'\Let@' stands for \`'\let\\=\cr\', and so it should be
placed after the definition of \`'\cr' is recalled in halign tables.

\<amstex loads amsmath\><<<
 \input amsmath.4ht  
>>>

\<amstex1.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amstex1.4ht                           |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>
% amstex.sty

\if@compatibility \else 
   |<amstex loads amsmath|>
   \expandafter\endinput
\fi            

\let\ltx@label|=\lb:l
|<body of amstex.sty|>
|<equations of amstex.sty|>
|<label of amstex.sty|>
|<amsmath.sty and amstex.sty|>
|<config amstex1 utilities|>
|<config amstex1 shared|>
|<plain, fontmath, amstex|>
\Hinput{amstex1}
\endinput
>>>        \AddFile{5}{amstex1}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Aligned}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

We need the \`'\vtop' within \`'\[...\]' because of the
extra math environment taht we insert.

\<equations of amstex1\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:aligned@{\bgroup
  \vspace@\Let@ \everycr{}%
  \SaveMkHalignConf:g{aligned:type}%|%\HRestore\noalign|%
  \MkHalign#{|<amstex1 aligned@ pattern|>}%
}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\<amstex1 aligned@ pattern\><<<
$\m@th\displaystyle{#}$&%
$\m@th\displaystyle{{}#}$%
>>>

\<equations of amstex1\><<<
\def\:tempc{\crcr\EndMkHalign 
   \RecallMkHalignConfig \csname b:\aligned:type\endcsname \egroup}
\HLet\endaligned|=\:tempc
\def\:temp{\pic:MkHalign{aligned@}} 
\HLet\aligned@|=\:temp
\NewConfigure{aligned}{6}
\NewConfigure{topaligned}{6}
\NewConfigure{botaligned}{6}
\pend:def\topaligned{\def\aligned:type{topaligned}}
\pend:def\botaligned{\def\aligned:type{botaligned}}
\pend:def\aligned{\def\aligned:type{aligned}}
>>>

%%%%%%%%%%%%%%%
\SubSection{braket}
%%%%%%%%%%%%%%%

\<braket.4ht\><<<
% braket.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
|<braket sty|>
\Hinput{braket}
>>> \AddFile{9}{braket}

\<braket sty\><<<
\def\ket#1{\ensuremath{\left.||{#1}\right\rangle}}
\def\braket#1{\ensuremath{\left\langle{#1}\right\rangle}}
\def\Bra#1{\left\langle#1||\right.}
\def\Ket#1{\left.||#1\right\rangle}
>>>

%%%%%%%%%%%%%%%
\SubSection{mathtools}
%%%%%%%%%%%%%%%

\<mathtools.4ht\><<<
% mathtools.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2007. Eitan M. Gurari
|<TeX4ht copywrite|>
|<mathtools sty|>
\edef\cat:underscore{%
   \noexpand\catcode`\noexpand\_=\the\catcode`\_ }
\catcode`\_=11
|<mathtools sty underscore|>
\cat:underscore
\Hinput{mathtools}
\endinput
>>>        \AddFile{9}{mathtools}


\<mathtools sty\><<<
\ifx \o:endgathered:\:UnDef\else 
   \HRestore\endgathered 
\fi
\def\shortintertext{\intertext} 
>>>

\<mathtools sty\><<<
\def\:tempc#1#2{{\csname a:prescript\endcsname}\sp{#1}\sb{#2}} 
\expandafter\HLet\csname prescript \endcsname=\:tempc 
\NewConfigure{prescript}{1} 
\Configure{prescript}{\HCode{<mrow class="prescript"></mrow>}} 
>>>

\<mathtools sty underscore\><<<
\def\MT_gathered_pre:{} 
      \def\MT_gathered_post:{} 
      \def\MT_gathered_env_end:{} 
                                    \catcode`\#13 \catcode`\!6
\def\reg:MT_gathered_env[!1]{%
  \RIfM@\else
      \nonmatherr@{\begin{MT_gathered_env}}%
  \fi
  \null  \vcenter\bgroup
    \Let@ \chardef\dspbrk@context\@ne \restore@math@cr
    \SaveMkHalignConf:g{MT_gathered_env}%
\MkHalign#{$\m@th\displaystyle{\HCode{}}#$}%
}
                                    \catcode`\#=6 \catcode`\!=12
\def\:tempc{\crcr\EndMkHalign
    \RecallMkHalignConfig \egroup\b:MT_gathered_env}
\HLet\endMT_gathered_env\:tempc
\def\:temp{\pic:MkHalign{MT_gathered_env}}
\expandafter\HLet\csname \string\MT_gathered_env\endcsname\:temp
\NewConfigure{MT_gathered_env}{6}
>>>

\<mathtools sty underscore\><<<
\def\:tempc#1#2{{\m@th#1{#2}}} 
\HLet\MT_cramped_internal:Nn\:tempc
>>>

\<mathtools sty\><<<
\renewenvironment{dcases}[1][c]{%   
  \RIfM@\else   
      \nonmatherr@{\begin{\@currenvir}}%   
  \fi   
  \left\lbrace   
  \vcenter \bgroup   
      \Let@ \chardef\dspbrk@context\@ne \restore@math@cr   
      \spread@equation   
      \ialign\bgroup   
        \strut@$\m@th\displaystyle{##}$\hfil&\quad$\m@th\displaystyle{##}$\hfil\strut@   
        \crcr   
}   
{\endaligned\right.}   
                                    \catcode`\#13 \catcode`\!6
\def\reg:dcases[!1]{%
  \RIfM@\else
      \nonmatherr@{\begin{dcases}}%
  \fi
  \vcenter\bgroup
    \Let@ \chardef\dspbrk@context\@ne \restore@math@cr
    \SaveMkHalignConf:g{dcases}%
    \MkHalign#{$\m@th\displaystyle{\HCode{}}#$&\quad$\m@th\displaystyle{\HCode{}}#$}%
}
                                    \catcode`\#=6 \catcode`\!=12
\def\:tempc{\crcr\EndMkHalign
    \RecallMkHalignConfig \egroup\b:dcases \right.}
\HLet\enddcases\:tempc
\def\:temp{\left\lbrace   \pic:MkHalign{dcases}}
\expandafter\HLet\csname \string\dcases\endcsname\:temp
\NewConfigure{dcases}{6}
>>>

\<mathtools sty\><<<
\renewenvironment{dcases*}[1][c]{%   
  \RIfM@\else   
      \nonmatherr@{\begin{\@currenvir}}%   
  \fi   
  \left\lbrace   
  \vcenter \bgroup   
      \Let@ \chardef\dspbrk@context\@ne \restore@math@cr   
      \spread@equation   
      \ialign\bgroup   
        \strut@$\m@th\displaystyle{##}$\hfil&\quad{##}\hfil\strut@   
        \crcr   
}   
{\endaligned\right.}   
                                    \catcode`\#13 \catcode`\!6
\expandafter\def\csname reg:dcases*\endcsname[!1]{%
  \RIfM@\else
      \nonmatherr@{\begin{dcases*}}%
  \fi
  \vcenter\bgroup
    \Let@ \chardef\dspbrk@context\@ne \restore@math@cr
    \SaveMkHalignConf:g{dcases*}%
    \MkHalign#{$\m@th\displaystyle{\HCode{}}#$\quad&#}%
}
                                    \catcode`\#=6 \catcode`\!=12
\def\:tempc{\crcr\EndMkHalign
    \RecallMkHalignConfig \egroup\csname b:dcases*\endcsname \right.}
\expandafter\HLet\csname enddcases*\endcsname\:tempc
\def\:temp{\left\lbrace   \pic:MkHalign{dcases*}}
\expandafter\HLet\csname \string\dcases*\endcsname\:temp
\NewConfigure{dcases*}{6}
>>>

\<add to usepackage\><<<
\Configure{PackageHooks}{mathtools.sty}{mathtools-hooks.4ht}
>>>

\<mathtools-hooks.4ht\><<<
% mathtools-hooks.4ht, generated from |jobname.tex
% Copyright 2023-2024 TeX Users Group
|<TeX4ht license text|>
|<mathtools dont load twice|>
|<mathtools inner wrapper|>
>>> 
\AddFile{9}{mathtools-hooks}

The Chemmacros package loads mathtools multiple times, but the subsequent loads lead to 
problems with catcodes. I don't see a reason for this, but it happened. To prevent that
we will stop loading of this file if mathtools is already loaded.

It is possible that similar issues can happen with other early hooks configuration files.

\<mathtools dont load twice\><<<
\@ifpackageloaded{mathtools}{\endinput}{}
>>>

This should prevent compilation errors with commands declared using \''\DeclarePairedDelimiter' and MathML. 
We need to patch the command at the moment when it is declared, so it must be available
already in the preamble. This is why we use early hooks.

\<mathtools inner wrapper\><<<
\ExplSyntaxOn
\:AtEndOfPackage{
\renewcommand\MT_delim_default_inner_wrappers:n [1]{
   \@namedef{MT_delim_\MH_cs_to_str:N #1 _star_wrapper:nnn}##1##2##3{
      \ifx\EndPicture\undefined
      \bgroup ##1 ##2  ##3\egroup
      \else
      \mathopen{}\mathclose\bgroup ##1 ##2  \aftergroup\egroup ##3
      \fi
    }
    \@namedef{MT_delim_\MH_cs_to_str:N #1 _nostarscaled_wrapper:nnn}##1##2##3{
      \mathopen{##1}##2\mathclose{##3}
    }
    \@namedef{MT_delim_\MH_cs_to_str:N #1 _nostarnonscaled_wrapper:nnn}##1##2##3{
      \mathopen##1##2\mathclose##3
    }
  }
}
\ExplSyntaxOff
>>>

%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Other}
%%%%%%%%%%%%%%%%%%%%%%

The \''\label'  gets a definition that differs a little than the one in LaTeX, and is more complicated because of cases like in the example:
\Verbatim
\documentclass[fleqn]{article}

\title{Test of subequations environment}
\author{mjd}

\usepackage[noamsfonts]{amstex}
\numberwithin{equation}{section}

\newcommand{\env}[1]{{\normalfont\texttt{#1}}}

   \begin{document}

`\section{Prime equation numbers}

Here is a,b,c sub-numbering.
\begin{subequations}{a}
\begin{eqnarray}
A&=&B\\
D&=&C \label{e:middle}\\
E&=&F
\end{eqnarray}
\end{subequations}
That was produced with the \env{eqnarray} environment; the middle line
was labeled as \eqref{e:middle}.

First an equation.
\begin{equation}\label{e:previous}
A=B
\end{equation}
That was equation \eqref{e:previous}.

\begin{equation}%
\tag{\ref{e:previous}$'$}
\label{e:prevprime}
C=D
\end{equation}

 And that was equation \eqref{e:prevprime}.

First an equation.
\begin{subequations}{a}
\begin{xalignat}{2}
\label{xalignat:a}A+B&=B&     B&=B+A\\
\label{xalignat:b}C&=D+E&     C\oplus D&=E\\
\label{xalignat:c}E&=F&       E'&=F'
\end{xalignat}
\end{subequations}

Label check: that was \eqref{xalignat:a}, \eqref{xalignat:b}, and
\eqref{xalignat:c}.

\end{document}
\EndVerbatim

Note that the above fails if \''\@currentlabel' has a \`'\Link[]...'.

\<equations of amstex.sty\><<<
\append:defI\subequations{\cur:lbl{}\let\cur:lbl|=\:gobble \ignorespaces}
>>>

With the exception of \''\subequations', the \''\refstepcounter'
of LaTeX is not used.  The following is to compensate for
the lost  \''\Link'.

\<equations of amstex.sty\><<<
\let\:stepcounter|=\stepcounter
\append:defI\stepcounter{%
   \ifx \EndPicture\:UnDef\else \def\:temp{equation}\def\:tempa{#1}%
   \ifx\:temp\:tempa 
      \edef\:currentlabel{E\the\c@equation}\let\cur:lbl|=\:gobble
      \edef\cur:th{|<haddr prefix|>\last:haddr}%
      \edef\:temp{\noexpand\AfterPicture{\noexpand\a:eqno\noexpand
         \Make:Label{\cur:th \:currentlabel}{}%
         \noexpand\html:addr}}\:temp
      \let\stepcounter|=\:stepcounter
   \fi\fi }
>>>

\<haddr prefix\><<<
x>>>

\<equations of amstex.sty\><<<
\let\:insplit|=\insplit@
\def\insplit@{\let\halign|=\TeXhalign \:insplit}
>>>

Place the number with the equation; not under.

\<equations of amstex.sty\><<<
\NewConfigure{eqn}[1]{\def\a:eqno{#1}}
>>>

% \pmatrix    def \matrix   def \endpmatrix
% \bmatrix    def \matrix   def \endbmatrix
% \vmatrix    def \matrix   def \endvmatrix
% \Vmatrix    def \matrix   def \endVmatrix

% \equation    def \gather     def \endgather

\<equations of amstex.sty\><<<
\pend:def\gather{\a:gather}
\append:def\endgather{\b:gather}
\@xp\pend:def\csname gather*\endcsname{\Picture*{}}
\@xp\append:def\csname endgather*\endcsname{\EndPicture}
\NewConfigure{gather}{2}
>>>

In amslatex.sty, equation is defined in terms of  gather.

\<equations of amstex.sty\><<<
\pend:def\equation{\bgroup \let\tagform@|=\:gobble}
\append:def\endequation{\egroup}
>>>

\<equations of amstex.sty\><<<
\pend:def\align{\Picture*{}}
\append:def\endalign{\EndPicture}
\@xp\pend:def\csname align*\endcsname{\Picture*{}}
\@xp\append:def\csname endalign*\endcsname{\EndPicture}
>>>

%\let\ltx@label=\lb:l

\<equations of amstex.sty\><<<
\pend:defI\alignat{\Picture*{}}
\append:def\endalignat{\EndPicture}
\expandafter\pend:defI\csname alignat*\endcsname{\Picture*{}}
\expandafter\append:def\csname endalignat*\endcsname{\EndPicture}
>>>

\<equations of amstex.sty\><<<
\pend:defI\xalignat{\Picture*{}}
\append:def\endxalignat{\EndPicture}
\expandafter\pend:defI\csname xalignat*\endcsname{\Picture*{}}
\expandafter\append:def\csname endxalignat*\endcsname{\EndPicture}
>>>

\<equations of amstex.sty\><<<
\pend:defI\xxalignat{\Picture*{}}
\append:def\endxxalignat{\EndPicture}
>>>

\<equations of amstex.sty\><<<
\pend:def\alignedat{\Picture*{}$}
\append:def\endalignedat{$\EndPicture}
>>>

\<equations of amstex.sty\><<<
\pend:def\gathered{\Picture*{}$}
\append:def\endgathered{$\EndPicture}
>>>

\<equations of amstex.sty\><<<
\pend:def\multline{\Picture*{}}
\append:def\endmultline{\EndPicture}
\expandafter\pend:def\csname multline*\endcsname{\Picture*{}}
\expandafter\append:def\csname endmultline*\endcsname{\EndPicture}
>>>

\<equations of amstex.sty\><<<
\let\:smallmatrix=\smallmatrix
\def\smallmatrix{\Picture*{}$\:smallmatrix}
\append:def\endsmallmatrix{$\EndPicture}
>>>

\<body of amstex.sty\><<<
|<amsmath.sty and amstex.sty|>
>>>

%%%%%%%%%%%%%%%%
\Section{Springer Lecture Notes}
%%%%%%%%%%%%%%%

LaTeX document class for Lecture Notes in Computer Science

\Link[http://www.springer.de/author/tex/help-book.html]{}{}springer\EndLink,
\Link[http://www.springer.de/comp/lncs/authors.html]{}{}Information
for Authors\EndLink.

We have llncs.cls for latex2e, and llncs.sty for latex2.9.

llncs.cls loads article.cls and then its definitions. Hence,
llncs.4ht asks article.4ht to load the definitions in llncs-a.4ht

\<llncs.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% llncs.4ht                             |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinclude{\input llncs-a.4ht}{article}    
\endinput
>>>        \AddFile{9}{llncs}

\<llncs-a.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% llncs-a.4ht                           |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\ifx \:UnDef 
  |<llcns sty|>
\else
  |<llcns cls|>
\fi
\let\:spthm|=\@spthm
\def\@spthm{|<seed begin theorem|>\:spthm}
\Hinput{llncs}
\endinput
>>>        \AddFile{9}{llncs-a}

\<llcns sty\><<<
\let\ll:maketitle|=\@maketitle
\def\@maketitle{%
   \ll:maketitle \Configure{maketitle}{}{}{}{}\Configure{newpage}{}}
>>>

\<llcns cls\><<<
\let\ll:maketitle|=\@maketitle
\def\@maketitle{%
   \let\sva:author\a:author  \def\a:author{\protect\sva:author}%
   \let\svb:author\b:author  \def\b:author{\protect\svb:author}%
   \ll:maketitle \Configure{maketitle}{}{}{}{}\Configure{newpage}{}}
>>>

\<llcns cls\><<<
\def\:tempc#1{\a:email\o:email:{#1}\b:email}
\HLet\email\:tempc
\NewConfigure{email}{2}
\def\:tempc{%
  \pend:def\@institute{\a:institute}%
  \append:def\@institute{\b:institute}%
  \o:institutename:
}
\HLet\institutename\:tempc
\NewConfigure{institute}{2}
>>>

\<llcns cls\><<<
\def\@Begintheorem#1#2#3{\a:newtheorem#3\trivlist
   \item[\hskip\labelsep{#2#1\@thmcounterend}]\b:newtheorem}
>>>

\<lncse.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% llncse.4ht                            |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinclude{\input lncse-a.4ht}{article}    
\endinput
>>>        \AddFile{9}{lncse}

\<lncse-a.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% llncse-a.4ht                          |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<lncse title page|>
  |<lncse theorems|>
  |<lncse chapter|>
\Hinput{lncse}
\endinput
>>>        \AddFile{9}{lncse-a}

\<lncse title page\><<<
\ifx \o:@maketitle:\UnDef
  \let\o:@maketitle:\@maketitle
\fi
\def\@maketitle{%
   \pend:def\@title{\Protect\a:ttl}\append:def\@title{\Protect\b:ttl}
   \pend:def\@date{\a:date}\append:def\@date{\b:date}%
   \pend:def\@author{\Protect\a:author}\append:def\@author{\Protect\b:author}%
   \def\and{\a:and}%
   \a:mktl \o:@maketitle: \b:mktl
}
\let\maketitle\o:maketitle:
\def\institutename{\par
 \begingroup
 \parskip=\z@
 \parindent=\z@
 \setcounter{@inst}{1}%
 \def\and{\c:institute \stepcounter{@inst}\c:inst
           $\sp{\the@inst}$\d:inst \ignorespaces}%
 \setbox0=\vbox{\def\thanks##1{}\everypar{}\@institute}%
 \ifnum\value{@inst}>9\relax\setbox0=\hbox{$\sp{88}$\enspace}%
                 \else\setbox0=\hbox{$\sp{8}$\enspace}\fi
 \ignorespaces \a:institute
 \ifnum\value{@inst}=1\relax  \else
   \setcounter{footnote}{\c@@inst}%
   \setcounter{@inst}{1}%
   \c:inst ${\sp\the@inst}$\d:inst
 \fi
 \@institute \b:institute\par
 \endgroup}
\def\inst#1{\unskip\a:inst$\sp{#1}$\b:inst}
\def\fnmsep{\unskip$\sp,$}
\NewConfigure{institute}{3}
\NewConfigure{inst}{4}
>>>

\<lncse theorems\><<<
\def\:Thm{\o:@Thm:}
\def\:temp{\let\sv:item\item
   \def\item[##1]{|<no page break before item|>\let\item\sv:item
                  \item[##1]\b:newtheorem}%
   \a:newtheorem\AutoRefstepAnchor
   \:Thm }
\HLet\@Thm\:temp
>>>

% \ifx \@chapapp\:UnDef
%   \def\@chapapp{\chaptername}
%   \def\chaptername{Chapter}
%   \def\appendixname{Appendix}
%   \newcommand*\chaptermark[1]{}
% \fi

\<lncse chapter\><<<
\let\:tempb\chapter
\Def:Section\chapter{\thechapter}{#1}
\let\:chapter\chapter
\let\chapter\:tempb
\def\@makechapterhead#1{}
\let\no@chapter\@chapter
\def\@chapter[#1]#2{%
   |<adjust minipageNum for setcounter footnote 0|>%
   {\SkipRefstepAnchor \let\addcontentsline\:gobbleIII\no@chapter[#1]{}}%
   \HtmlEnv   \Toc:Title{#1}\:chapter{#2}}
\Def:Section\likechapter{}{#1}
\let\:likechapter\likechapter
\let\likechapter\:UnDef
\let\no@schapter\@schapter
\def\@schapter#1{%
   {\let\addcontentsline\:gobbleIII\no@schapter{}}%
   \HtmlEnv   \:likechapter{#1}}
\let\no@appendix\appendix
\Def:Section\appendix{\thechapter}{#1}
\let\:appendix\appendix
\def\appendix{%
   \def\@chapter[##1]##2{%
      |<adjust minipageNum for setcounter footnote 0|>%
      {\def\addcontentsline####1####2####3{}\no@chapter[##1]{}}%
      \HtmlEnv \Toc:Title{##1}\:appendix{##2}}%
   \no@appendix}
>>>

%--------------------------------- amstex.tex -------------------

\Chapter{amstex.tex}

\`'/n/ship/0/packages/tetex/teTeX/texmf/tex/amstex/base/amstex.tex'

\Section{Outline}

\<amstex.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amstex.4ht                            |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>
% amstex.tex
\HRestore\cases \HRestore\matrix  \HRestore\pmatrix
|<body of amstex.tex|>
|<equations of amstex.tex|>
|<config amstex.tex utilities|>
|<config amstex.tex shared|>
|<amstex.tex matrix|>
|<amstex.tex align|>
|<amstex.tex cases|>
\Hinput{amstex}
\endinput
>>>        \AddFile{5}{amstex}

\<body of amstex.tex\><<<
\def\:tempc#1{\a:text{\ifx \a:math\:UnDef\else
    \let\:temp|=\everymath
    \def\everymath##1{\let\everymath|=\:temp\append:def\a:math{##1}}%
  \fi
  \o:text@:{#1}}\b:text}
\HLet\text@|=\:tempc
\NewConfigure{text}{2}
>>>

\Section{Sub/Sub scripts}

\<body of amstex.tex\><<<
\def\Sb#1\endSb{\sb{\a:multilimits
   \multilimits@#1\endSb\b:multilimits}}
\def\Sp#1\endSp{\sp{\a:multilimits
   \multilimits@#1\endSp\b:multilimits}}
\def\multilimits@{\bgroup\vspace@\Let@
 \baselineskip\fontdimen10 \scriptfont\tw@
 \advance\baselineskip\fontdimen12 \scriptfont\tw@
 \lineskip\thr@@\fontdimen8 \scriptfont\thr@@
 \lineskiplimit\lineskip  \let\halign|=\TeXhalign
 \vbox\bgroup\ialign\bgroup\hfil\c:multilimits
    $\m@th\scriptstyle{##}$\d:multilimits\hfil\crcr}
\NewConfigure{multilimits}{4}
>>>

\Section{Format}

\<equations of amstex.tex\><<<
                                      \catcode`\#|=13 \catcode`\!|=6
\def\format:!1\\{\def\preamble@{!1}%
   \hashtoks@{#}%
   \def\l{$\m@th\the\hashtoks@$\hfil}%
   \def\c{\hfil$\m@th\the\hashtoks@$\hfil}%
   \def\r{\hfil$\m@th\the\hashtoks@$}%
   \SaveMkHalignConf:g{format}%  
   \edef\preamble@@{\:span\preamble@}%
   |<expand amstex.tex ...alignat pattern|>\MkHalign#{\preamble@@}}
                                      \catcode`\#=6 \catcode`\!=12
\def\:tempc{\crcr\EndMkHalign\RecallMkHalignConfig
   \iffalse{\fi\ifnum`}=0 \fi\format:}     
\HLet\format|=\:tempc
\let\:format|=\format
\let\format|=\o:format:
\let\MkHformat=\empty
\def\:tempc{\def\format{\global\let\format|=\o:format: \:format}}
\HLet\MkHformat|=\:tempc
\NewConfigure{format}{6}
>>>

\Section{Align}

\<equations of amstex.tex\><<<
\catcode`\#|=13 \catcode`\!|=6
\def\:tempc!1\endalign{%%
  \Mk:ialign:end
   {|<amstex.tex align pattern|>}{align}{!1}#%
     {|<amstex.tex align env|>}}  
\catcode`\#=6 \catcode`\!=12
\expandafter\HLet\csname align \endcsname|=\:tempc
\expandafter\HLet\csname align \space\endcsname|=\:tempc
\NewConfigure{align}{6}
>>>

\<amstex.tex align env\><<<
\global\and@\z@
\ifingather@\append:def\T:halign{\global\and@\z@}\fi
\Let@\tabskip\centering@
>>>

\<amstex.tex align pattern\><<<
$\m@th\displaystyle{\@lign#}$\global\advance\and@\@ne       
&$\m@th\displaystyle{{}\@lign#}%
          $\global\advance\and@\@ne\tabskip\z@skip
&\hbox\bgroup\@lign\maketag@#\maketag@\egroup\tabskip\z@skip
>>>

\Section{Gather}

\<equations of amstex.tex\><<<
\catcode`\#|=13 \catcode`\!|=6
\def\:tempc!1\endgather{\Mk:ialign:end
   {|<amstex.tex gather pattern|>}{gather}{!1}#{}}  
\catcode`\#=6 \catcode`\!=12
\expandafter\HLet\csname gather \endcsname|=\:tempc
\expandafter\HLet\csname gather \space\endcsname|=\:tempc
\NewConfigure{gather}{6}
>>>

\<equations of amstex.tex\><<<
\def\Mk:ialign:end#1#2#3#4#5{%
   \csname a:#2\endcsname
     \ifx \EndPicture\:UnDef        
        |<SaveMkHalignConfig|>#5\RecallTeXcr
        \MkHalign#4{#1}#3\crcr\EndMkHalign
        \RecallMkHalignConfig 
     \else
        \expand:after{\csname o:#2:\endcsname #3}\csname end#2\endcsname
     \fi
   \csname b:#2\endcsname
}
>>>

\<SaveMkHalignConfig\><<<
\SaveMkHalignConfig
\Configure{MkHalign}
  {} {}
  {\csname c:#2\endcsname} {\csname d:#2\endcsname }
  {\csname e:#2\endcsname}
  {\csname f:#2\endcsname }%
>>>

\<amstex.tex gather pattern\><<<
$\m@th\displaystyle{#}$%
&\maketag@#\maketag@
>>>

%%%%%%%%%%%%%%GATHER

\Section{Matrix}

\<amstex.tex matrix\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:matrix{\vcenter\bgroup
   \SaveMkHalignConf:g{matrix}%
   \Let@ 
   \MkHalign#{$\m@th#$&&$\m@th#$}}
                                    \catcode`\#=6 \catcode`\!=12 
\def\:tempc{\crcr\EndMkHalign \RecallMkHalignConfig \egroup\b:matrix}
\HLet\endmatrix|=\:tempc
\def\:temp{\pic:MkHalign{matrix}} 
\HLet\matrix|=\:temp
\NewConfigure{matrix}{6}
>>>

\<equations of amstex.texNO\><<<
\def\:temp{\a:smallmatrix \o:smallmatrix:}
\HLet\smallmatrix|=\:temp
\let\:tempc|=\endsmallmatrix
\append:def\:tempc{\b:smallmatrix}
\HLet\endsmallmatrix|=\:tempc
\NewConfigure{smallmatrix}{2}
>>>

\<equations of amstex.tex\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:smallmatrix{\vcenter\bgroup
   \SaveMkHalignConf:g{smallmatrix}%
   \Let@ 
   \MkHalign#{$\m@th\scriptstyle{#}$&&$\m@th
                    \scriptstyle{#}$}}
                                    \catcode`\#=6 \catcode`\!=12 
\def\:tempc{\crcr\EndMkHalign 
    \RecallMkHalignConfig \egroup\b:smallmatrix}
\HLet\endsmallmatrix|=\:tempc
\def\:temp{\pic:MkHalign{smallmatrix}} 
\HLet\smallmatrix|=\:temp
\NewConfigure{smallmatrix}{6}
>>>

\<plain,latex utilities\><<<
\def\pic:MkHalign#1{%
  \csname a:#1\endcsname
  \ifx \EndPicture\:Undef
     \expandafter\expandafter\csname reg:#1\endcsname
  \else 
     \vtop\bgroup$$  
     \expandafter\def\csname #1\endcsname{\bgroup 
         \expandafter\def\csname end#1\endcsname{\csname
              o:#1:\endcsname\egroup}%
         \csname o:#1:\endcsname}%
      \expandafter\def\csname end#1\endcsname{\csname
          o:end#1:\endcsname$$\egroup
         \csname b:#1\endcsname}\expandafter
                               \expandafter\csname o:#1:\endcsname
  \fi}
>>>

\<plain,latex utilities\><<<
\def\SaveMkHalignConf:g#1{\SaveMkHalignConfig
   \edef\:temp{\noexpand\Configure{MkHalign} {} {}
     {\expandafter\noexpand\csname c:#1\endcsname} 
     {\expandafter\noexpand\csname d:#1\endcsname }
     {\expandafter\noexpand\csname e:#1\endcsname 
        \noexpand\RecallMkHalignConfig}
     {\expandafter\noexpand\csname f:#1\endcsname }}\:temp}
>>>

% \global\let\TailTD|=\:UnDef

\<amstex.tex matrix\><<<
\let\:tempc|=\pmatrix
\pend:def\:tempc{\a:pmatrix}
\HLet\pmatrix|=\:tempc
\let\:tempc|=\endpmatrix
\append:def\:tempc{\b:pmatrix}
\HLet\endpmatrix|=\:tempc
\NewConfigure{pmatrix}{2}
>>>

\Section{Align}

\SubSection{Cases}

%  \def\cases{\bgroup\spreadmlines@\jot\left\{\,\matrix\format\l&\quad\l\\}
%  \def\endcases{\endmatrix\right.\egroup}

\<amstex.tex cases\><<<
\pend:def\cases{\a:cases\MkHformat}
\append:def\endcases{\b:cases}
\NewConfigure{cases}{2}
>>>

\Section{Others}

\<equations of amstex.tex\><<<
\let\:tempc|=\bmatrix
\pend:def\:tempc{\a:bmatrix}
\HLet\bmatrix|=\:tempc
\let\:tempc|=\endbmatrix
\append:def\:tempc{\b:bmatrix}
\HLet\endbmatrix|=\:tempc
\NewConfigure{bmatrix}{2}
>>>

\<equations of amstex.tex\><<<
\pend:def\vmatrix{\a:vmatrix}
\append:def\endvmatrix{\b:vmatrix}
\NewConfigure{vmatrix}{2}
>>>

\<equations of amstex.tex\><<<
\pend:def\Vmatrix{\a:Vmatrix}
\append:def\endVmatrix{\b:Vmatrix}
\NewConfigure{Vmatrix}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Other}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%

%%%%%%%%%%%%%
\SubSection{amstex}
%%%%%%%%%%%%%

\<equations of amstex.tex\><<<
\let\:tempc|=\frac
\pend:defII\:temp{\a:frac}
\append:defII\:temp{\b:frac}
\HLet\frac|=\:temp
\NewConfigure{frac}{2}
\let\:tempc|=\dfrac
\pend:defII\:temp{\a:dfrac}
\append:defII\:temp{\b:dfrac}
\HLet\dfrac|=\:temp
\NewConfigure{dfrac}{2}
\let\:tempc|=\tfrac
\pend:defII\:temp{\a:tfrac}
\append:defII\:temp{\b:tfrac}
\HLet\tfrac|=\:temp
\NewConfigure{tfrac}{2}
\let\:tempc|=\binom
\pend:defII\:temp{\a:binom}
\append:defII\:temp{\b:binom}
\HLet\binom|=\:temp
\NewConfigure{binom}{2}
\let\:tempc|=\dbinom
\pend:defII\:temp{\a:dbinom}
\append:defII\:temp{\b:dbinom}
\HLet\dbinom|=\:temp
\NewConfigure{dbinom}{2}
\let\:tempc|=\tbinom
\pend:defII\:temp{\a:tbinom}
\append:defII\:temp{\b:tbinom}
\HLet\tbinom|=\:temp
\NewConfigure{tbinom}{2}
\let\:temp|=\boxed
\pend:defI\:temp{\a:boxed}
\append:defI\:temp{\b:boxed}
\HLet\boxed|=\:temp
\NewConfigure{boxed}{2}
>>>

\Section{Incomplete}

\<body of amstex.tex\><<<
\def\:temp{{\textfontii AMS}-\TeX}
\HLet\AmSTeX|=\:temp
>>>

\<body of amstex.tex\><<<
\def\linebreak{\RIfM@\mathmodeerr@\linebreak\else
 \ifhmode\unskip\unkern\break \a:linebreak\else
 \vmodeerr@\linebreak\fi\fi}
\NewConfigure{linebreak}{1}
>>>

\<equations of amstex.tex\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:gathered{\vcenter\bgroup
   \SaveMkHalignConf:g{gathered}%
   \Let@ 
   \MkHalign#{$\m@th\displaystyle{#}$}}
                                    \catcode`\#=6 \catcode`\!=12 
\def\:tempc{\crcr\EndMkHalign 
    \RecallMkHalignConfig \egroup\b:gathered}
\HLet\endgathered|=\:tempc
\def\:temp{\pic:MkHalign{gathered}} 
\HLet\gathered|=\:temp
\NewConfigure{gathered}{6}
>>>

\<equations of amstex.tex\><<<
\let\:insplit|=\insplit@
\def\insplit@{\let\halign|=\TeXhalign \:insplit}
>>>

\Section{Aligned}

\<equations of amstex.tex\><<<
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:aligned@{\bgroup
   \SaveMkHalignConf:g{aligned@}%
   \Let@ 
   \MkHalign#{$\m@th\displaystyle{#}$&%
              $\m@th\displaystyle{{}#}$}}
                                    \catcode`\#=6 \catcode`\!=12 
\def\al:gned#1{%
   \Configure{aligned@}{\csname a:#1\endcsname}%
       {\csname b:#1\endcsname}{\csname c:#1\endcsname}%
       {\csname d:#1\endcsname}{\csname e:#1\endcsname}%
       {\csname f:#1\endcsname}\pic:MkHalign{#1}}
\NewConfigure{aligned@}{6}
>>>

\<equations of amstex.tex\><<<
\def\:tempc{\crcr\EndMkHalign 
    \RecallMkHalignConfig \egroup\b:aligned@}
\HLet\endaligned|=\:tempc
\def\:temp{\al:gned{aligned}}
\HLet\aligned|=\:temp
\def\reg:aligned{\vcenter\reg:aligned@}
\NewConfigure{aligned}{6}
\HLet\endtopaligned|=\endaligned
\def\:tempc{\al:gned{topaligned}}
\HLet\topaligned|=\:tempc
\def\reg:topaligned{\null\vtop\reg:aligned@}
\NewConfigure{topaligned}{6}
\HLet\endbotaligned|=\endaligned
\def\:tempc{\al:gned{botaligned}}
\HLet\botaligned|=\:tempc
\def\reg:botaligned{\null\vtop\reg:aligned@}
\NewConfigure{botaligned}{6}
>>>

\<equations of amstex.tex\><<<
\def\:tempc{\crcr\EndMkHalign 
    \RecallMkHalignConfig \egroup\b:alignedat}
\HLet\endalignedat|=\:tempc
\def\:tempc{\al:gned{alignedat}}
\HLet\alignedat|=\:tempc
\NewConfigure{alignedat}{6}
                                    \catcode`\#|=13 \catcode`\!|=6    
\def\reg:alignedat!1{\null\vcenter\bgroup
   \SaveMkHalignConf:g{alignedat}%
   \hashtoks@{#}{\let\@lign|=\empty \doat@{!1}}\Let@
   \pend:def\preamble@@{\:span}%
   |<expand amstex.tex ...alignat pattern|>\MkHalign#{\preamble@@}}
                                    \catcode`\#=6 \catcode`\!=12 
>>>

\Section{Aligned At}

\<equations of amstex.tex\><<<
\catcode`\#|=13 \catcode`\!|=6
\def\:tempc!1!2\endalignat{%   
  \Mk:ialign:end{\preamble@@}{alignat}{!2}#%
     {|<amstex.tex alignat get pattern|>%
      |<expand amstex.tex ...alignat pattern|>%
     }}
\catcode`\#=6 \catcode`\!=12
\expandafter\HLet\csname alignat \endcsname\:tempc
\NewConfigure{alignat}{6}
>>>

\<expand amstex.tex ...alignat pattern\><<<
\def\:temp!!1!!2{\expand:after{!!1!!2}\expandafter}%
\:temp       |%\MkHalign#{\preamble@@}...\EndMkHalign |%
>>>

\<amstex.tex alignat get pattern\><<<
\hashtoks@{#}|<inany@true|>\xat@false  
|<tag for alignat amstex.tex|>%
\measuring@false \Let@
{\let\@lign=\empty \attag@{!1}}%
\let\allowdisplaybreak  =\empty
\pend:def\preamble@@{\:span}%
>>>

\<tag for alignat amstex.tex\><<<
\def\tag{\global\tag@true\count@!1\relax\multiply\count@\tw@
   \xdef\tag@{}\loop\ifnum\count@>\and@\xdef\tag@{&\tag@}%
                \advance\count@\m@ne \repeat\tag@}%
>>>

\<equations of amstex.tex\><<<
\catcode`\#|=13 \catcode`\!|=6
\def\:tempc!1!2\endxalignat{%   
  \Mk:ialign:end{\preamble@@}{xalignat}{!2}#%
     {|<amstex.tex alignat get pattern|>%
      |<expand amstex.tex ...alignat pattern|>%
     }}
\catcode`\#=6 \catcode`\!=12
\expandafter\HLet\csname xalignat \endcsname\:tempc
\NewConfigure{xalignat}{6}
>>>

\<amstex.tex xalignat get pattern\><<<
\hashtoks@{#}|<inany@true|>\xat@true  
|<tag for xalignat amstex.tex|>%
\measuring@false \Let@
{\let\@lign=\empty \attag@{!1}}%
\let\allowdisplaybreak  =\empty
\pend:def\preamble@@{\:span}%
>>>

\<tag for xalignat amstex.tex\><<<
\def\tag{\global\tag@true\def\tag@{}\count@!1\relax
  \multiply\count@\tw@
  \loop\ifnum\count@>\and@
     \xdef\tag@{&\tag@}\advance\count@\m@ne\repeat\tag@}%
>>>

\<equations of amstex.tex\><<<
                                  \catcode`\#|=13 \catcode`\!|=6
\def\:tempc!1!2\endxxalignat{%   
  \Mk:ialign:end{\preamble@@}{xxalignat}{!2}#%
     {|<amstex.tex xxalignat get pattern|>%
      |<expand amstex.tex ...alignat pattern|>%
     }}
                                  \catcode`\#=6 \catcode`\!=12
\expandafter\HLet\csname xxalignat \endcsname\:tempc
\NewConfigure{xxalignat}{6}
>>>

\<amstex.tex xxalignat get pattern\><<<
\hashtoks@{#}|<inany@true|> \measuring@false \Let@
{\let\@lign=\empty \xxattag@{!1}}%
\let\allowdisplaybreak  =\empty
\pend:def\preamble@@{\:span}%
>>>

\`'\ifinany@' and \`'\displaybreak@' are not defined in ams* starting 
since 1999.

\<inany@true\><<<
\ifx \ifinany@\:Undef\else  \inany@true\fi  
>>>

\<displaybreak@\><<<
\ifx \displaybreak@\:UnDef
   \chardef\dspbrk@context\z@  
\else
   \displaybreak@
\fi
>>>

\<restore ams equationNO\><<<
\ifx \ifinany@\:Undef
  \HRestore\equation
  \HRestore\endequation
\fi
>>>

\<restore amsmath everydisplay\><<<
\append:def\a:display{\@displaytrue}
\expandafter\append:defIII\csname
    c:$$:\endcsname{\append:def\a:display{\@displaytrue}}
>>>

\Section{Multiline}

\<equations of amstex.tex\><<<
\let\:tempc|=\endmultline
\append:def\:tempc{\b:multline}
\HLet\endmultline|=\:tempc
\def\:tempc{\al:gned{multline}}
\HLet\multline|=\:tempc
\let\reg:multline|=\o:multline:
\NewConfigure{multline}{4}  
\let\e:multline|=\empty
\let\f:multline|=\empty
                                    \catcode`\#|=13 \catcode`\!|=6
\def\:tempc{\let\sv:halign|=\halign
   \def\halign!!1\crcr{%
      \let\halign|=\sv:halign
      \SaveMkHalignConf:g{multline}%
      \MkHalign#{|<multline amstex.tex pattern|>}}%
   \o:rmultline@@@:}
                                    \catcode`\#=6 \catcode`\!=12
\HLet\rmultline@@@|=\:tempc
\def\:tempc{\rmultline@@@}
\HLet\lmultline@@@|=\:tempc
\def\:tempc{\crcr\EndMkHalign\RecallMkHalignConfig }
\HLet\lendmultline@|=\:tempc
\def\:tempc{\lendmultline@}   
\HLet\rendmultline@|=\:tempc
>>>

\<multline amstex.tex pattern\><<<
\Let@\hbox{$\m@th\displaystyle\hfil{}#$}%
>>>

%----------------------------- amsppt.sty -----------------------

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{amsppt.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<if not amsppt.sty\><<<
\expandafter\ifx \csname amsppt.sty\endcsname\relax
>>>

\<recall amsppt.sty\><<<
|<if not amsppt.sty|> \else
   \ifx  \plainend\:UnDef \else
      \let\sv:end|=\end  \let\end|=\plainend
   \fi
   \let\sv:logo|=\logo@  \let\logo@|=\empty
\fi
>>>

\<amsppt.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amsppt.4ht                            |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\HRestore\footnote
\append:def\EndPreamble{\let\logo@|=\sv:logo \let\sv:logo=\empty}
|<set amsppt.sty|>
|<top matter of amsppt.sty|>
|<everypar in amsppt.sty|>
|<hfonts for amsppt.sty|>
|<sectioning in amsppt.sty|>
|<footnotes in amsppt.sty|>
|<bib in amsppt.sty|>
|<roster in amsppt.sty|>
|<captions in amsppt.sty|>
|<enddocument in amsppt.sty|>
|<config amsppt + vanilla shared|>
\Hinput{amsppt}
\endinput
>>>        \AddFile{5}{amsppt}

In older files the ams-logo is printer at the first page, 
possibly before \''\endmatters'. This can be a problem if 
the \''\EndPreamble' stuff is pushed to the second page.

\<set amsppt.sty\><<<
\append:def\block{\ifx \EndPicture\:UnDef \:block 
  \pend:def\endblock{\end:block} \fi}
\NewConfigure{block}{2}
>>>

\Section{Captions}

\<captions in amsppt.sty\><<<
\append:def\@ins{\def\vspace##1{\vskip##1\relax}%
  \def\captionwidth##1{\captionwidth@##1\relax}}
\let\:topcaption|=\topcaption
\let\:botcaption|=\botcaption

\def\:caption#1#2\endcaption{\a:caption
  {\captionfont@#1}\if\notempty{#2}.\fi\b:caption
  \if\notempty{#2}{\rm#2}\fi \c:caption}

\def\botcaption{\ifx \EndPicture\:UnDef \expandafter\:caption
  \else \expandafter\:botcaption \fi}
\def\topcaption{\ifx \EndPicture\:UnDef \expandafter\:caption
  \else \expandafter\:topcaption \fi}

\NewConfigure{caption}{3}
>>>

\Section{Lists (Rosters}

without the par below we get an extra \''<P>' when \''\nextii@' applies in \''\roster'

\<roster in amsppt.sty\><<<
\let\:roster|=\roster
\def\roster{\IgnorePar
   \let\roster:par|=\par  
   \def\par{\let\par|=\roster:par \par
      \def\:tempa{\ifx \:temp\par@  \IgnorePar\leavevmode\IgnorePar\fi}%
      \futurelet\:temp\:tempa}%
   \:roster   \let\ams:tem|=\item
   \def\item{\IgnorePar\EnditemitemList \ams:tem}%
   \a:roster}
\pend:def\endroster{\EnditemitemList\b:roster}
>>>

\<roster in amsppt.sty\><<<
\pend:def\itembox@{\ifx \EndPicture\:UnDef
   \a:itembox@ \therosteritem@ \b:itembox@ \expandafter\:gobbleII\fi}
>>>

\<roster in amsppt.sty\><<<
\NewConfigure{roster}[4]{\def\:temp{#1#2#3#4}\ifx \:temp\empty
   \else \def\a:roster{\ii:conf#1}\def\b:roster{#2}%
         \def\a:itembox@{#3}\def\b:itembox@{#4}\fi
   \long\def\:temp##1##2##3##4{\def\:temp{##1##2##3##4}\ifx \:temp\empty
      \else 
      \def\ii:conf{\Configure{itemitem}{##1}{##2}{##3}{##4}}\fi}\:temp}
>>>

 Configure \''\item' and/or \''\itemitem', provided that at least one of the pars is not empty 

\<roster in amsppt.sty\><<<
|<itemitem from tex|>
>>>

The following is from TeX4ht2.

\<itemitem from tex\><<<
\ifx \EnditemitemList\:UnDef
   |<plain+ itemitem list|>
\fi
>>>

\Section{Bibliography}

\SubSection{Introduce Hooks}

\<bib in amsppt.sty\><<<
\let\:refstyle|=\refstyle
\let\endref:|=\endref@
\def\endref@{%
  \pend:defI\keyformat{\a:keyformat}%
  \append:defI\keyformat{\b:keyformat}%
  \def\refstyle##1{\let\:tempa|=\keyformat \:refstyle{##1}%
    \ifx \:tempa\keyformat  \else
       \pend:defI\keyformat{\a:keyformat}%
       \append:defI\keyformat{\b:keyformat}\fi  }
  \def\:temp##1{%
     \expandafter\ifvoid\csname ##1box@\endcsname\else
       \expandafter\setbox\csname ##1box@\endcsname=\hbox
          {\csname a:##1\endcsname \expandafter\unhbox\csname
            ##1box@\endcsname\csname b:##1\endcsname}\fi}
  \ifx \MRbox@\:UnDef\else  \:temp{MR}\fi
  \:temp{book}
  \:temp{bookinfo}
  \:temp{by}
  \:temp{ed}
  \:temp{finalinfo}
  \:temp{issue}
  \:temp{jour}
  \:temp{key}
  \:temp{lang}
  \:temp{miscnote}
  \:temp{moreref}
  \:temp{pages}
  \:temp{paper}
  \:temp{paperinfo}
  \:temp{procinfo}
  \:temp{publaddr}
  \:temp{publ}
  \:temp{vol}
  \:temp{yr}
  \endref: }
>>>

\<bib in amsppt.sty\><<<
\pend:def\ref{\Configure{HtmlPar}{}{}{}{}\a:ref}
\append:def\endref{\b:ref}
\pend:defIII\makerefbox{\IgnorePar}
>>>

\<bib in amsppt.sty\><<<
\let\:Refs|=\Refs
\def\Refs{\bgroup
   \let\sv:nofrillscheck\nofrillscheck
   \def\nofrillscheck{%
      \expand:after{\let\::Refs=}\csname Refs\endcsname
      \expandafter\def\csname Refs\endcsname####1{%
         |<header of Refs|>%
         \let\sv:ref|=\ref \def\ref{\let\ref|=\sv:ref \a:Refs\ref}%
         \pend:def\endRefs{\b:Refs}\append:def\endRefs{\egroup}}%
      \sv:nofrillscheck}%
   \csname :Refs\endcsname}
>>>

\<header of Refs\><<<
\def\:temp{####1}\ifx\:temp\empty \::Refs{}\else
   \::Refs{\csname ams:refs\endcsname{####1}}\fi 
>>>

\SubSection{Define Configures for Hooks}

\<bib in amsppt.sty\><<<
\def\:temp#1{\edef\:tempa{\long
   \def\expandafter\noexpand\csname c:#1:\endcsname
   ####1####2{\def\expandafter\noexpand\csname a:#1\endcsname{####1}
          \def\expandafter\noexpand\csname b:#1\endcsname{####2}}}\:tempa}
\ifx \MRbox@\:UnDef\else  \:temp{MR}\fi
\:temp{book}
\:temp{bookinfo}
\:temp{by}
\:temp{ed}
\:temp{finalinfo}
\:temp{issue}
\:temp{jour}
\:temp{key}
\:temp{lang}
\:temp{miscnote}
\:temp{moreref}
\:temp{pages}
\:temp{paper}
\:temp{paperinfo}
\:temp{procinfo}
\:temp{publaddr}
\:temp{publ}
\:temp{vol}
\:temp{yr}
\:temp{ref}
\:temp{keyformat}
\:temp{Refs}
>>>

\SubSection{Initialize the Hooks}

So far the hooks have been initialized to do nothing.

\SubSection{Fix}

\<bib in amsppt.sty\><<<
\def\makerefbox#1#2#3{\endgraf
  \setbox\z@\lastbox
  \global\setbox\@ne\hbox{\unhbox\holdoverbox
    \ifvoid\z@\else\unhbox\z@\unskip\unskip\unpenalty\fi}%
  \egroup
  \setbox\curbox\box \@ne
  \ifvoid#2\else\Err@{Redundant \string#1; duplicate use, or
     mutually exclusive information already given}\fi
  \def\curbox{#2}\setbox\curbox\vbox\bgroup \hsize\maxdimen \noindent
  #3}
>>>

The original file has the code \`'\setbox\curbox\box \ifdim\wd\@ne>\z@ \@ne \else\voidb@x\fi'.  That code is problematic because we can reach widths
larger than can be measured by the \`'\wd' command.

\Section{Sectioning}

\<sectioning in amsppt.sty\><<<
\def\title{\let\savedef@\title
  \def\title##1\endtitle{\let\title\savedef@
    \global\setbox\titlebox@\vtop{\tenpoint\a:title
      \raggedcenter@ \frills@\uppercasetext@{##1}\endgraf\b:title}%
  }%
  \nofrillscheck\title}
>>>

\<config amsppt + vanilla shared\><<<
\NewConfigure{title}{2}
>>>

The space above the title is needed to separate it from the `typset by AMS-TeX'
that is automatically printed.

\<sectioning in amsppt.styNO\><<<
\pend:def\endproclaim{\IgnorePar}
\append:def\endproclaim{\ShowPar}
>>>

\<sectioning in amsppt.sty\><<<
\def\proclaim#1{\csname o:proclaim:\endcsname
   {\a:proclaim#1\b:proclaim}}
\def\endproclaim{\revert@envir\endproclaim\c:proclaim \par\rm}
>>>

% \def\chapterno@{\uppercase\expandafter{\romannumeral\chaptercount@}}
% 
% \def\chapter{\let\savedef@\chapter
%   \def\chapter##1{\let\chapter\savedef@
%   \leavevmode\hskip-\leftskip
%    \rlap{\vbox to\z@{\vss\centerline{\eightpoint
%    \frills@{CHAPTER\space\afterassignment\chapterno@
%        \global\chaptercount@|=}%
%    ##1\unskip}\baselineskip2pc\null}}\hskip\leftskip}%
%  \nofrillscheck\chapter}

\<sectioning in amsppt.sty\><<<
\let\:specialhead|=\specialhead
\def\specialhead#1\endspecialhead{\let\specialheadfont:|=\specialheadfont@ 
   \ifx \ams:refs\:UnDef \def\ams:refs{\rm\ams:specialhead}\fi
   \let\specialheadfont@|=\empty
   \csname :specialhead\endcsname 
   \ams:specialhead{#1}\let\frills@\eat@ \endspecialhead
   \let\specialheadfont@|=\specialheadfont: }
\let\ams:specialhead|=\specialhead
\NewSection\specialhead{}
\let\:temp=\specialhead  \let\specialhead|=\ams:specialhead
\let\ams:specialhead|=\:temp
>>>

\<sectioning in amsppt.sty\><<<
\let\:head|=\head
\def\head#1\endhead{\let\headfont:|=\headfont@ 
   \ifx \ams:refs\:UnDef \def\ams:refs{\rm\ams:head}\fi
   \let\headfont@|=\empty
   \csname :head\endcsname 
   \ams:head{#1}\let\frills@\eat@ \endhead
   \let\headfont@|=\headfont: }
\let\ams:head|=\head
\NewSection\head{}
\let\:temp|=\head \let\head|=\ams:head
\let\ams:head|=\:temp
>>>

\<sectioning in amsppt.sty\><<<
\let\:subhead|=\subhead
\def\subhead#1\endsubhead{\let\subheadfont:|=\subheadfont@ 
   \ifx \ams:refs\:UnDef \def\ams:refs{\rm\ams:subhead}\fi
   \let\subheadfont@|=\empty  \csname :subhead\endcsname 
   \ams:subhead{#1}\let\frills@|=\eat@ \endsubhead
   \let\subheadfont@|=\subheadfont: }
\let\ams:subhead|=\subhead
\NewSection\subhead{}
\let\:temp|=\subhead \let\subhead|=\ams:subhead
\let\ams:subhead|=\:temp
>>>

\<sectioning in amsppt.sty\><<<
\let\:subsubhead|=\subsubhead
\def\subsubhead#1\endsubsubhead{\let\subsubheadfont:|=\subsubheadfont@ 
   \ifx \ams:refs\:UnDef \def\ams:refs{\rm\ams:subsubhead}\fi
   \let\subsubheadfont@|=\empty  \csname :subsubhead\endcsname 
   \ams:subsubhead{#1}\let\frills@|=\eat@ \endsubsubhead
   \let\subsubheadfont@|=\subsubheadfont: }
\let\ams:subsubhead|=\subsubhead
\NewSection\subsubhead{}
\let\:temp|=\subsubhead \let\subsubhead|=\ams:subsubhead
\let\ams:subsubhead|=\:temp
>>>

\Section{Everypar}

% group on #2 for fonts
%  \def\HtmlPar{\if:removeindent \ShowPar \hskip-\parindent
%     \else      \HCode{\html:par\html:src}%
%     \fi }

\<everypar in amsppt.sty\><<<
\def\par@{\ht:everypartoks@\expandafter{\the\ht:everypar}%
   \HtmlPar \ht:everypar{\HtmlPar}}
\def\nobreak{\penalty\@M
  \ifvmode\gdef\penalty@{\global\let\penalty@\penalty\count@@@}%
  \ht:everypar{\global\let\penalty@\penalty
    \HtmlPar \ht:everypar{\HtmlPar}}\fi}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Footnotes}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<set amsppt.styNO\><<<
\let\makefootnote@|=\vfootnote
>>>

\<footnotes in amsppt.styNO\><<<
\let\footmarkform@|=\:gobble
\let\thefootnotemark|=\footmarkform@
\def\makefootnote@#1#2{\def\footmarkform@##1{$\m@th{##1}$}%
  \def\FNmark{#1}\gHAdvance\FNnum |by 1 
  \a:footnote \b:footnote{#2}\c:footnote \let\footmarkform@\:gobble}
\NewConfigure{footnote}{3}
\HAssign\FNnum|=0
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Top Matter}

\<top matter of amsppt.sty\><<<
\let\:endtopmatter|=\endtopmatter
\def\endtopmatter{%
   |<move footnotes down|>%
  \let\inslogo@|=\logo@
  \ifx\thedate@\empty@\else
     |<neutralize line|>%
     \let\thedate:|=\thedate@
     \def\thedate@{\a:date\thedate:\b:date}\fi
  \ifvoid\tocbox@\else   \ifx \a:newtocdefs\:UnDef 
     \setbox\tocbox@=\vtop{\IgnorePar
        |<amstex.tex toc|>}%
  \fi \fi
  \csname :endtopmatter\endcsname \b:topmatter }
\pend:def\topmatter{\a:topmatter}
\NewConfigure{topmatter}{2}
>>>

\<top matter of amsppt.sty\><<<
\NewConfigure{newtocdefs}[1]{\c:def\a:newtocdefs{#1}}
\let\o:newtocdefs:=\newtocdefs
\def\newtocdefs{\o:newtocdefs:
   |<amstex.tex toc entries|>%
   \ifx \a:newtocdefs\:UnDef
   \else \a:TableOfContents
       \pend:def\endtoc{\c:TableOfContents}%
   \fi}
\pend:def\toc{\SaveEndP
   |<extract amstex.tex toc title|>}
\append:def\endtoc{\RecallEndP}
\def\c:toc:{\Configure{TableOfContents}}
>>>

\<insert amstex.tex toc title\><<<
\ifmonograph@\else
   \centerline{\headfont@\ignorespaces\toc:title\unskip}\nobreak
\fi
>>>

\<extract amstex.tex toc title\><<<
\ifx \a:newtocdefs\:UnDef 
   \let\:tempc|=\FN@
   \def\FN@{%
      \let\FN@|=\:tempc 
      \let\:tempc|=\nextii@
      \def\nextii@########1{\let\nextii@|=\:tempc 
         \gdef\toc:title{########1}\nextii@{########1}}%
      \FN@}%
\fi
>>>

If \''\a:newtocdefs' empty we go for the inlinecontent
under interpretation of entries of \''\TableOfContents',
if it is undefined we call directly to \''\TableOfContents' with
the entries that appear in the body (instead of the content part,
and we go for the body itself if \''\a:newtocdefs' is defined to a
nonempty content.  

\<amstex.tex toc entries\><<<
\ifx \a:newtocdefs\:UnDef
   \let\toc:list|=\empty
   \expandafter\def\csname title\endcsname  ##1\endtitle{%
       \xdef\toc:list{\ifx \toc:list\empty\else ,\fi title}}%
   \expandafter\def\csname specialhead\endcsname##1\endspecialhead{%
       \xdef\toc:list{\ifx \toc:list\empty\else ,\fi specialhead}}%
   \expandafter\def\csname head\endcsname##1 ##2\endhead{%
       \xdef\toc:list{\ifx \toc:list\empty\else ,\fi head}}%
   \expandafter\def\csname subhead\endcsname##1 ##2\endsubhead{%
       \xdef\toc:list{\ifx \toc:list\empty\else ,\fi subhead}}%
   \expandafter\def\csname subsubhead\endcsname##1 ##2\endsubsubhead{%
       \xdef\toc:list{\ifx \toc:list\empty\else ,\fi subsubhead}}%
\else \ifx \a:newtocdefs\empty
   \HAssign\TocCount|=0
   \expandafter\def\csname title\endcsname##1\endtitle{%
         \toctitle{}{##1}{}}%
   \expandafter\def\csname specialhead\endcsname##1\endspecialhead{%
         \tocspecialhead{}{##1}{}}%
   \expandafter\def\csname head\endcsname##1 ##2\endhead{%
         \tochead{##1}{##2}{}}%
   \expandafter\def\csname subhead\endcsname##1 ##2\endsubhead{%
         \tocsubhead{##1}{##2}{}}%
   \expandafter\def\csname subsubhead\endcsname##1 ##2\endsubsubhead{%
         \tocsubsubhead{##1}{##2}{}}%
\else
   \a:newtocdefs
\fi \fi
>>>

\<amstex.tex toc\><<<
|<insert amstex.tex toc title|>%
\ifx \toc:list\:UnDef
  \def\toc:list{\TableOfContents[title,specialhead,head,%
                       subhead,subsubhead]}%
\else
   \pend:def\toc:list{\TableOfContents[}%
   \append:def\toc:list{]}%
\fi 
\toc:list
>>>

   \<move footnotes down\><<<
\ifmonograph@\else
  \ifx \preabstract\relax \let\preabstract|=\empty\fi
  \ifx\thesubjclass@\empty@\else
     \let\:thesubjclass|=\thesubjclass@   \let\thesubjclass@|=\empty
     \pend:def\preabstract{\a:subjclass\:thesubjclass\b:subjclass}%
  \fi
  \ifx\thekeywords@\empty@\else
     \let\:thekeywords|=\thekeywords@   \let\thekeywords@|=\empty
     \pend:def\preabstract{\a:keywords\:thekeywords\b:keywords}%
  \fi
  \ifx\thethanks@\empty@\else
      \let\:thethanks|=\thethanks@    \let\thethanks@|=\empty
     \pend:def\preabstract{\a:thanks\:thethanks\b:thanks}%
  \fi
\fi
>>>

\<top matter of amsppt.sty\><<<
\NewConfigure{subjclass}{2}
\NewConfigure{thanks}{2}
\NewConfigure{keywords}{2}
>>>

\<neutralize line\><<<
\let\:predate|=\predate
\def\predate{\:predate
   \let\sv:line|=\line \def\line{\let\line|=\sv:line\hbox}}%
>>>

\<top matter of amsppt.sty\><<<
\let\:author|=\author
\def\author#1\endauthor{\:author{\a:author#1\b:author}\endauthor}
>>>

\<config amsppt + vanilla shared\><<<
\NewConfigure{author}{2}
>>>

\<top matter of amsppt.sty\><<<
\let\:affil|=\affil
\def\affil#1\endaffil{\:affil{\a:affil#1\b:affil}\endaffil}
\NewConfigure{affil}{2}
>>>

\<top matter of amsppt.sty\><<<
\def\abstract{\let\savedef@\abstract
  \def\abstract{\let\abstract\savedef@
    \setbox\abstractbox@\vbox\bgroup\IgnorePar \noindent
      \expandafter\everydisplay\expandafter{\expandafter
      \everydisplay\expandafter{\the\everydisplay}}$$\vbox\bgroup
      \def\envir@end{\endabstract}\advance\hsize-2\indenti
      \def\usualspace{\enspace}\eightpoint 
          \IgnorePar \noindent \frills@{{\smc 
          \a:abstract Abstract.\b:abstract\enspace}}}%
  \nofrillscheck\abstract}
>>>

\<top matter of amsppt.sty\><<<
\append:def\abstract{\c:abstract}
\pend:def\endabstract{\d:abstract}
\NewConfigure{abstract}{4}
>>>

\<top matter of amsppt.sty\><<<
\NewConfigure{date}{2}
>>>

\<top matter of amsppt.styNO\><<<
\NewConfigure{toc}[5]{\c:def\a:TableOfContents{#1}%
   \c:def\b:TableOfContents{#2}\c:def\c:TableOfContents{#3}%
   \c:def\d:TableOfContents{#4}\c:def\e:TableOfContents{#5}%
}
\Configure{toc} {}{}{} {}{}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{EndDocument}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<enddocument in amsppt.sty\><<<
\ifx \enddocument@text\:UnDef \else
   \pend:def\enddocument@text{\bgroup}
   \append:def\enddocument@text{\egroup}
\fi
>>>

The above is to prevent spilling of fonts when hfonts are defined.

Why the if below????

\<set amsppt.styNO\><<<
\ifx  \plainend\:UnDef \else
   \let\plainend|=\end   \let\end|=\sv:end
\fi
>>>

\<set amsppt.sty\><<<
\def\plainend{\end}   \let\end|=\sv:end
>>>

%%%%%%%%%%%%%%%%
\Part{Packages}
%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Bibliography}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%
\Section{BibTeX}
%%%%%%%%%%%%%%%%%%%%%

\Link[http://pertsserver.cs.uiuc.edu/\string ~hull/bib2html/]{}{}bib2html\EndLink

\<bibtex.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% bibtex.4ht                            |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Usage:  \input bibtex.4ht  \bibtex{file.bib}                   %
% Provides: \bibkey, \thisbib, \Configure{@...}, \Configure{...} %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|<save cat codes|>
|<bibtex body|>
|<parse fields|>
\:RestoreCatcodes
\endinput
>>>

\<save cat codes\><<<
\expandafter\ifx\csname :RestoreCatcodes\endcsname\relax
    \expandafter\let\csname :RestoreCatcodes\endcsname=\empty
\fi
\edef\bibstack{\noexpand\PushStack\expandafter\noexpand
    \csname Cat:Stack\endcsname
    \expandafter\noexpand \csname :RestoreCatcodes\endcsname}
\bibstack
\expandafter\edef\csname :RestoreCatcodes\endcsname{%
   \catcode`\noexpand :|=\the\catcode`:%
   \catcode`\noexpand "|=\the\catcode`"%
   \catcode`\noexpand @|=\the\catcode`@%
   \catcode`\noexpand _|=\the\catcode`_%
   \catcode`\noexpand ^|=\the\catcode`^%
   \catcode`\noexpand |||=\the\catcode`||%
   \csname no:restore\endcsname
   \noexpand\PopStack\expandafter\noexpand\csname Cat:Stack\endcsname
        \expandafter\noexpand \csname :RestoreCatcodes\endcsname}
\catcode`\:|=11 \catcode`\@|=11   \catcode`\^|=7 \catcode`\||=12
\catcode`"|=12
>>>

\<bibtex body\><<<
\catcode`\_=13
\gdef\bib:parse#1,{{\def_{\string_}%
   \xdef\bibkey{#1}\open:tag{\bib:type}{entry}\hfil\break}\cont:parse}
\catcode`\_=8
\gdef\bib:eat{\bgroup \catcode`\@=12  \catcode`\^^M=10 \catcode`\#=12
   \a:@bibtex \csname a:@\bib:type\endcsname
   \ifx \thisbib\:UnDef \expandafter\bib:conteat
   \else \pend:defI\thisbib{\egroup}\expandafter\thisbib \fi}
\NewConfigure{@bibtex}{1}
\def\get:key#1 #2///{\def\:temp{#2}\ifx\:temp\empty \def\bib:tag{#1}\else
      \def\:temp{\get:key#1#2///}\expandafter\:temp
   \fi}
\long\def\bib:conteat#1{\egroup
  {\bib:parse #1@="@"}\csname b:\bib:type\endcsname \vfil\break}
\def\open:tag#1#2{%
  \expandafter\ifx \csname a:#1\endcsname\relax
     \:warning{no configuration for #2 <#1>...</#1>}%
     \global\expandafter\let \csname a:#1\endcsname\empty
  \fi \csname a:#1\endcsname}    
\def\bib:scan{\ifx \:next\bgroup \expandafter\bib:eat
   \else \expandafter\bib:more \fi}
\def\bib:more#1{\edef\bib:type{\bib:type#1}\futurelet\:next\bib:scan}

\def\b:btitem#1{\egroup\def\bib:type{#1}\futurelet\:next\bib:scan}

\catcode`\@=13\relax
\gdef\bibtex#1{\begingroup
     \def@{\bgroup \catcode`\@=12\b:btitem}%
   \catcode`\@=13\relax
   \input #1\endgroup}
\catcode`\@=11\relax
>>>

\<parse fields\><<<
\def\cont:parse{\futurelet\:next\cont:parseY}
\def\cont:parseY{%
   \expandafter\ifx \space\:next
       \expandafter       \def\expandafter\:temp\space{\cont:parse}%
   \else \let\:temp\cont:parseX \fi \:temp}
\long\def\cont:parseX#1={%%
   \expandafter\get:key#1 ///\futurelet\:next\parse:value}
\def\parse:value{%
   \expandafter\ifx \space\:next
      \expandafter\def\expandafter\:temp\space{\futurelet
           \:next\parse:value}%
   \else \if "\:next   \let\:temp=\parse:valueX
   \else
      \ifx \bgroup\:next \let\:temp=\parse:valueG
      \else \let\:temp=\parse:valueC  \fi
   \fi \fi \:temp}
\def\parse:valueC#1,{\parse:valueY{#1},}
\def\parse:valueX"#1"{\parse:valueY{#1}}
\def\parse:valueG#1{\parse:valueY{#1}}
\def\parse:valueY#1{%
   \def\:temp{@}\def\:tempa{#1}\ifx \:temp\:tempa \else
     \def\:tempb{#1}\ifx \:tempb\empty\else \open:tag\bib:tag{key}%
        \:tempb\csname b:\bib:tag\endcsname\hfil\break
     \fi
     \expandafter\tail:parse
   \fi}
\def\tail:parse{\futurelet\:next\tail:parseY}
\def\tail:parseY{\ifx \:com\:next  \def\:temp##1{\cont:parse}%
   \else \expandafter\ifx \space\:next
       \expandafter       \def\expandafter\:temp\space{\tail:parse}%
   \else \ifx\:next\egroup \let\:temp|=\empty
         \else\def\:temp##1{\tail:parse}\fi
   \fi\fi \:temp}
\let\:com=,
>>>

\ifHtml[\HPage{example}\Verbatim
\input bibtex.4ht

/usr/local/teTeX/share/texmf/bibtex/bib/xampl.bib

\NewConfigure{@preamble}{1}
\Configure{@preamble}  {\let\thisbib=\ignore}
\NewConfigure{@STRING}{1}
\Configure{@STRING}  {\let\thisbib=\ignore}
\long\def\ignore#1{}

\newcommand{\noopsort}[1]{} 
\newcommand{\printfirst}[2]{#1} 
\newcommand{\singleletter}[1]{#1}
\newcommand{\switchargs}[2]{#2#1}
\def\temp#1{%
   \NewConfigure{#1}{2}
   \Configure{#1}%
      {\IgnorePar\HCode{<p class="bib-#1">
           <span class="bib-key">\bibkey</span>}}%
      {\HCode{</p>}}}

\temp{ARTICLE}
\temp{BOOKLET}
\temp{BOOK}
\temp{INBOOK}
\temp{INCOLLECTION}
\temp{INPROCEEDINGS}
\temp{MANUAL}
\temp{MASTERSTHESIS}
\temp{MISC}
\temp{PHDTHESIS}
\temp{PROCEEDINGS}
\temp{TECHREPORT}
\temp{UNPUBLISHED}

\def\temp#1{%
  \NewConfigure{#1}{2}
  \Configure{#1}%
     {\HCode{<br /><span class="bib-#1">}}%
     {\HCode{</span>}}}
\temp{address}
\temp{author}
\temp{booktitle}
\temp{chapter}
\temp{crossref}
\temp{edition}
\temp{editor}
\temp{howpublished}
\temp{institution}
\temp{journal}
\temp{key}
\temp{month}
\temp{note}
\temp{number}
\temp{organization}
\temp{pages}
\temp{publisher}
\temp{school}
\temp{series}
\temp{title}
\temp{type}
\temp{volume}
\temp{year}

\bibtex{/usr/local/teTeX/share/texmf/bibtex/bib/xampl.bib}

\end{document}
\EndVerbatim\EndHPage{}]\fi

%%%%%%%%%%%%%%%%%%%%%%%
\Section{bibtopic.sty}
%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://www.tex.ac.uk/tex-archive/macros/latex/contrib/supported/bibtopic/]{}{}ctan bibtopic\EndLink

\<bibtopic.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% bibtopic.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<bibtopic cite|>
\Hinput{bibtopic}
\endinput
>>>        \AddFile{9}{bibtopic}

\<bibtopic cite\><<<
\catcode`\:=12
\def\bt@citex[#1]#2{%  Add \@extra@b@citeb to \cite
    \let\@citea\@empty
    |<a cite|>\@cite{%
        \@for\@citeb:=#2\do{%
            \@citea\let\@citea\citepunct |<sub sup cite|>%
      \edef\@citeb{\expandafter\@firstofone\@citeb}%
            \if@filesw\immediate\write\@auxout{%
                \string\citation{\@citeb}}\fi
            \@ifundefined{b@\@citeb \@extra@b@citeb}{%
                \mbox{\reset@font\bfseries ?}%
                \@warning{Citation `\@citeb' on page \thepage\space
                undefined}\G@refundefinedtrue
            }{\bt@citesurround{|<link cite|>\citeform{\csname b@\@citeb
                \@extra@b@citeb\endcsname}|<end link cite|>}%
            }%
        }%
    }{#1}|<b cite|>}
\catcode`\:=11
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Overcite}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<overcite.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% overcite.4ht                          |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<over cite|>
\Hinput{overcite}
\endinput
>>>        \AddFile{9}{overcite}

\<over cite\><<<
\expandafter\pend:defI\csname citen \endcsname{%
   \csname a:cite\endcsname
   \begingroup \SUBOff \SUPOff 
      \csname pend:defI\endcsname\citeform{\cIteLink {X##1}{}}%
      \csname append:defI\endcsname\citeform{\EndcIteLink}%
    }
\expandafter\append:defI\csname citen \endcsname{\endgroup
      \csname b:cite\endcsname}
>>>

%%%%%%%%%%%%%%%%%%%
\Section{harvard.sty}
%%%%%%%%%%%%%%%%%%%

\<harvard.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% harvard.4ht                           |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config harvard|>
\Hinput{harvard}
\endinput
>>>        \AddFile{9}{harvard}

\<config harvard\><<<
\long\def\harvardcite#1#2#3#4{%
  \global\@namedef{HAR@fn@#1}{\cIteLink{X#1}{}#2\EndcIteLink}%
  \global\@namedef{HAR@an@#1}{\cIteLink{X#1}{}#3\EndcIteLink}
  \global\@namedef{HAR@yr@#1}{\cIteLink{X#1}{}#4\EndcIteLink}
  \global\@namedef{HAR@df@#1}{\csname HAR@fn@#1\endcsname}
}
\expandafter\let\expandafter\:harvarditem
          \csname \string\harvarditem\endcsname
\expandafter\long\expandafter
   \def\csname \string\harvarditem\endcsname[#1]#2#3#4{%
    \let\hv:item=\item 
    \def\item[##1]{|<no page break before item|>\let\item=\hv:item
                   \item[##1]\Link{}{X#4}\EndLink}%
    \:harvarditem[#1]{#2}{#3}{#4}}
>>>

\<config harvard\><<<
\def\harvardurl#1{\Link[#1]{}{}\textit{#1}\EndLink}
\renewcommand{\harvardyearparenthesis}[1]{
  \renewcommand{\harvardyearleft}{\csname HAR@bl@#1\endcsname
                                  \a:harvardyear}
  \renewcommand{\harvardyearright}{\b:harvardyear
                                   \csname HAR@br@#1\endcsname}
}
\append:def\harvardyearleft{\a:harvardyear}
\pend:def\harvardyearright{\b:harvardyear}
\NewConfigure{harvardyear}{2}
>>>

%%%%%%%%%%%%%%%%%%%
\Section{jurabib.sty}
%%%%%%%%%%%%%%%%%%%

\Link[http://userpage.fu-berlin.de/\string
        ~jberger]{}{}Home of jurabib\EndLink

\<jurabib.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% jurabib.4ht                           |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<jurabib footnote|>
|<jurabib links|>
|<jurabib corrections|>
\HRestore\@citex  
\HRestore\@bibitem
\HRestore\@lbibitem

\Hinput{jurabib}
\endinput
>>>        \AddFile{9}{jurabib}

\<jurabib links\><<<
\def\hyper@jblinkstart#1{\a:jblink{#1}{}%
   \PushMacro\hyper@jblinkstart 
   \def\hyper@jblinkstart{%
      \PushMacro\hyper@jblinkend
      \def\hyper@jblinkend{\PopMacro\hyper@jblinkend}%
    }}
\def\hyper@jblinkend{\PopMacro\hyper@jblinkstart \b:jblink} 
>>>

The following don't work (since 2005?) because of nested links.

\Verbatim
\def\hyper@jblinkstart#1{\a:jblink{#1}{}}
\def\hyper@jblinkend{\b:jblink}
\EndVerbatim

But no more because of nested links.

\Verbatim
Definition of \@citex
---------------------
    \hyper@jblinkstart{\@citeb} 
        \jb@firstcitefull 
    \hyper@jblinkend

Definiton of \jb@firstcitefull
------------------------------
 \hyper@jbanchorstart{look@\@citeb:\jb@reset@look@label@for}\hyper@jbanchorend

 \jbincollcrossref

Definition of \jbincollcrossref
-------------------------------
   \hyper@jblinkstart{#1}% 

   \hyper@jblinkend
\EndVerbatim

Also, juralib uses links with prefixes `look@'---they are problematic because
the `@' is not allowed in XML ids.

\<jurabib links\><<<
\def\hyper@jbanchorstart#1{\a:jbanchor{}{#1}}
\def\hyper@jbanchorend{\b:jbanchor}
\NewConfigure{jblink}{2}   
\NewConfigure{jbanchor}{2} 
>>>

\<jurabib footnote\><<<
\ifx \@footnotetext\:UnDef\else
   \let\ju:footnotetext|=\@footnotetext
   \AtBeginDocument{%
      \ifjb@hyper
          \let\ju:footnotetext|=\:UnDef
      \else 
          \long\def\@footnotetext#1{{\jb@fntrue
             \setcounter{jb@cites@in@footnote}{0}%
             \ju:footnotetext{#1}}}%
      \fi
   }
\fi
>>>

\<jurabib corrections\><<<
\def\:temp{$\mathord\langle$}
\expandafter\HLet\csname jblangle \endcsname\:temp
\def\:temp{$\mathord\rangle$}
\expandafter\HLet\csname jbrangle \endcsname\:temp
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{scrjura}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<scrjura.4ht\><<< 
% scrjura.4ht (|version), generated from |jobname.tex 
% Copyright 2018 TeX Users Group 
|<TeX4ht license text|> 
|<scrjura configure|>
\Hinput{scrjura} 
\endinput 
>>> \AddFile{9}{scrjura}

Why is needed the \Verbatim\:qtchr\EndVerbatim instead of quotes? I don't know :(
But quotes don't work

\<scrjura configure\><<<
\def\:qtchr{\expandafter\@gobble\string\"}

\pend:def\contract@paragraph@font{\a:contract@paragraph@font} 
\append:def\contract@paragraph@font{\b:contract@paragraph@font\gdef\end:prevpara{}} 

\NewConfigure{contract@paragraph@font}{2}

% \end:prevpara is needed to correctly handle paragraphs
\def\end:prevpara{}
\pend:def\parformat{\end:prevpara\a:parformat} 
\append:def\parformat{\b:parformat\global\let\end:prevpara\c:parformat} 

\NewConfigure{parformat}{3}


% this is a modified version of original macro from scrjura.sty
\renewcommand*{\ref@Par}[2]{%
  \expandafter\ifx\csname r@#2\endcsname\relax
    \ref#1{#2}%
  \else
    \begingroup
      % this definitions are needed to get correct content from the \csname r@#2\endcsname
      \def\rEfLiNK##1##2{##2}
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\def
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\@tempb
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter{%
        \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}%
      \def\@tempc##1##2\@nil{##1}%
      \let\scrjura@separator\@gobble
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \csname r@#2\endcsname\noexpand\@nil}%
      \def\@tempc##1##2##3\@nil{##2}%
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \@tempa{%
          \protect\G@refundefinedtrue
          \nfss@text{\reset@font\bfseries ??}%
          \@latex@warning{Reference `#2' on page \thepage \space
            with undefined par number}%
        }\noexpand\@nil}%
      \let\@@protect\protect
      \let\protect\noexpand
      \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}%
      \let\protect\@@protect
      \ref#1{#2}%
    \endgroup
  \fi
}
 \Css{.sentence{margin-left:2em; padding-top: .5em;}}
 \Css{.paragraph{margin: 1em;}}
 \Css{.para{margin: .5em;}}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{natbib.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<natbib.4ht\><<<
% natbib.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>

\HRestore\@lbibitem
\HRestore\@bibitem
\ifNAT@super
   |<natbib htcitet|>
   |<natbib numbers|>
\else
  \def\hyper@natlinkstart#1{%
    \let\rel:hyper|=\def  \hyper@linkstart{cite}{X#1}%
    \def\hyper@nat@current{#1}%
  }
  \def\hyper@natlinkbreak#1#2{%
    \hyper@linkend#1\let\rel:hyper|=\def \hyper@linkstart{cite}{X#2}%
  }
  \def\hyper@natlinkend{\hyper@linkend}
  |<hyperref for natbib|>
  |<natbib protect edef mbox|>
\fi
\Hinput{natbib}
\endinput
>>>        \AddFile{7}{natbib}

The following protection is needed for

\Verbatim
\documentclass{article}  
   \usepackage[sort&compress]{natbib}  
\begin{document}  
  
Single citations are fine \cite{foo},  
double citations are not \cite{bar,foo}.  
  
\begin{thebibliography}{99}  
\bibitem[1]{foo} foofoo  
\bibitem[2]{bar} barbar  
\end{thebibliography}  
\end{document}  
\EndVerbatim

when compiled with oolatex.

\<natbib protect edef mbox\><<<
\pend:defIII\NAT@cite{\let\mbox\o:mbox:}
\pend:defIII\NAT@citenum{\let\mbox\o:mbox:}
>>>

The following failed on

\Verbatim
\documentclass{article}  
 
  \usepackage 
      [numbers,sort&compress]% 
      {natbib}  
 
\begin{document}  
  
\section{Introduction} \label{sec:Introduction}  
  
\cite{Arantes2003b}. Here 
  
Section \ref{sec:Algorithms} presents  
  
\end{document}  
\EndVerbatim

\<\><<<
\let\o:NAT@citexnum:\NAT@citexnum
\def\NAT@citexnum[#1][#2]#3{%
   \let\sv:mbox\mbox
   \let\mbox\o:mbox:
   \o:NAT@citexnum:[#1][#2]{#3}%
   \let\mbox\sv:mbox
}
>>>

\<hyperref for natbib\><<<
\expandafter\ifx \csname hyper@linkstart\endcsname\relax
   \def\hyper@linkstart#1#2{%
     \a:cite%
     \def\:temp{#1}%
     \ifx\:temp\@urltype
       \cIteLink[#2]{}{}%
     \else
       \ifx\rel:hyper\def\cIteLink{#2}{}\else\cIteLink[\##2]{}{}\fi
     \fi  \global\let\rel:hyper=\:UnDef
   }
   \def\hyper@linkend{\EndcIteLink\b:cite}
\fi
\long\def\:temp#1{}\ifx \:temp\hyper@natanchorstart
   \def\hyper@natanchorstart#1{\Link{}{X#1}\EndLink}
\fi
>>>

This modification is needed since Stefan
\Verb=<s.newslists@googlemail.com>= vide bug \# 178 reported that
\Verb=\citet= didn't work in combination with \Verb=super= option of
\Verb=natbib= package.

\<natbib htcitet\><<<
\def\citet{\@ifstar{\NAT@longnamestrue\ht@citet}%
          {\NAT@longnamesfalse\ht@citet}}
>>>

\<natbib numbers\><<<
\def\setb:anc#1{\let\sv:anc\AnchorLabel
   \def\bib:anc{\Link{}{bibitem\the
      \c@NAT@ctr}\EndLink \gdef\bib:anc{}}%
   \def\AnchorLabel{\bib:anc}}
\def\nb:link#1{\Protect\Link{bibitem#1}{}#1\Protect\EndLink}
\def\nb@link#1{\Protect\Link{bibitem#1}{}#1\Protect\EndLink}
>>>

\<natbib numbers\><<<
\let\nat:lbibitem\@lbibitem
\def\@lbibitem{%
  \ifx\hyper@natanchorstart\@gobble 
     \def\hyper@natanchorstart##1{\Link{}{bibitem\the
      \c@NAT@ctr}\EndLink}\fi
  \nat:lbibitem
}
>>>

\<natbib numbers\><<<
\catcode`\:|=12
  \def\ht@citet#1{\def\NAT@num{-1}\let\NAT@last@yr\relax\let\NAT@nm\@empty
     \let\@citea\@empty
     \@for\@citeb:=#1\do{%  
      \@ifundefined{b@\@citeb\@extra@b@citeb}% 
       {{\reset@font\bfseries?}\NAT@citeundefined\PackageWarning{natbib}%
         {Citation `\@citeb' on page \thepage \space undefined}%
       }%
       {\@citea\let\NAT@last@num\NAT@num\let\NAT@last@nm\NAT@nm
        \NAT@parse{\@citeb}%
        \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
          \let\NAT@name=\NAT@all@names
          \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
        \fi
        \ifNAT@full\let\NAT@nm\NAT@all@names\else
         \let\NAT@nm\NAT@name
        \fi
        \NAT@nm}\Tg<sup>\nb@link{\NAT@num}\Tg</sup>
        \def\@citea{\unskip\NAT@sep\penalty\@m\space}%
       }%
}
\def\NAT@citexnum[#1][#2]#3{%
 \NAT@sort@cites{#3}%
 \let\@citea\@empty
  \@cite{\def\NAT@num{-1}\let\NAT@last@yr\relax\let\NAT@nm\@empty
    \@for\@citeb:=\NAT@cite@list\do
    {\edef\@citeb{\expandafter\@firstofone\@citeb}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb\@extra@b@citeb}{%
       {\reset@font\bfseries?}
        \NAT@citeundefined\PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}}%
     {\let\NAT@last@num\NAT@num\let\NAT@last@nm\NAT@nm
      \NAT@parse{\@citeb}%
      \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
        \let\NAT@name=\NAT@all@names
        \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
      \fi
      \ifNAT@full\let\NAT@nm\NAT@all@names\else
        \let\NAT@nm\NAT@name\fi
      \ifNAT@swa
       \ifnum\NAT@ctype=2\relax\@citea
        \hyper@natlinkstart{\@citeb\@extra@b@citeb}%
            \NAT@test{2}\hyper@natlinkend\else
       \ifnum\NAT@sort>1
         \begingroup\catcode`\_|=8
            \ifcat _\ifnum\z@<0\NAT@num _\else A\fi
              \global\let\NAT@nm=\NAT@num \else \gdef\NAT@nm{-2}\fi
            \ifcat _\ifnum\z@<0\NAT@last@num _\else A\fi
              \global\@tempcnta|=\NAT@last@num
              \global\advance\@tempcnta |by\@ne
            \else \global\@tempcnta\m@ne\fi
         \endgroup
         \ifnum\NAT@nm=\@tempcnta
           \ifx\NAT@last@yr\relax
             \edef\NAT@last@yr{\@citea
                \csname o:mbox:\endcsname{|<nb link|>\NAT@num}}%
           \else
             \edef\NAT@last@yr{--\penalty
                \@m\csname o:mbox:\endcsname{|<nb link|>\NAT@num}}%
           \fi
         \else
           \NAT@last@yr \@citea \csname o:mbox:\endcsname{|<nb link|>\NAT@num}%
           \let\NAT@last@yr\relax
         \fi
       \else
         \@citea \csname o:mbox:\endcsname
               {\ifx\hyper@natanchorstart\@gobble 
                    \Link{bibitem\NAT@num}{}\NAT@num
                    \EndLink
                \else
                    \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@num
                    \hyper@natlinkend
                \fi
               }%
       \fi
       \fi
       \def\@citea{\NAT@sep\penalty\@m\NAT@space}%
      \else
        \ifcase\NAT@ctype\relax
          \ifx\NAT@last@nm\NAT@nm \NAT@yrsep\penalty\@m\NAT@space\else
          \@citea \NAT@test{1}\ \NAT@@open
          \if\relax#1\relax\else#1\ \fi\fi \NAT@mbox{%
          \hyper@natlinkstart{\@citeb\@extra@b@citeb}%
          \NAT@num\hyper@natlinkend}%
          \def\@citea{\NAT@@close\NAT@sep\penalty\@m\ }%
        \or\@citea
          \hyper@natlinkstart{\@citeb\@extra@b@citeb}%
           \NAT@test{1}\hyper@natlinkend
          \def\@citea{\NAT@sep\penalty\@m\ }%
        \or\@citea
          \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@test{2}%
           \hyper@natlinkend
          \def\@citea{\NAT@sep\penalty\@m\ }%
        \fi
      \fi
      }}%
      \ifnum\NAT@sort>1\NAT@last@yr\fi
      \ifNAT@swa\else\ifnum\NAT@ctype=0\if\relax#2\relax\else
      \NAT@cmt\ #2\fi \NAT@@close\fi\fi}{#1}{#2}}
 \let\@citex|=\NAT@citexnum
\catcode`\:|=11
>>>

\<nb link\><<<
\csname nb:link\endcsname
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{citation-style-language}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CSL support using LuaTeX

\<citation-style-language.4ht\><<<
% citation-style-language.4ht (|version), generated from |jobname.tex
% Copyright 2023 TeX Users Group
|<TeX4ht license text|>
|<csl cite|>
|<csl bibitem|>
\Hinput{citation-style-language}
\endinput
>>>  \AddFile{5}{citation-style-language}


\<csl cite\><<<
\ExplSyntaxOn
% add links to bibliography around citations
\cs_set:Npn \__csl_print_citation:N #1
{
  \bool_if:NT \l__csl_regression_test_bool
  { \tl_show:N #1 }
  \bool_if:NTF \l__csl_note_bool
  { \footnote {\a:cite\cIteLink{X\l__csl_cite_keys_tl}{bk-\l__csl_citation_id_tl}#1\EndcIteLink\b:cite} }
  {\a:cite\cIteLink{X\l__csl_cite_keys_tl}{bk-\l__csl_citation_id_tl}#1\EndcIteLink\b:cite}
}
\ExplSyntaxOff
>>>

\<csl bibitem\><<<
% fix problems with \bibitem in the bibliography
\def\setb:anc#1{\def\bib:anc{\def\bib:anc{#1}\ifx \bib:anc\empty \else%
  \a:bibitem{}{\a:bibanchor#1}\b:bibitem\fi \gdef\bib:anc{}}%
  \def\AnchorLabel{\bib:anc}%
}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Languages}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%
\Section{babel.sty}
%%%%%%%%%%%%%%%%%%%%

\Link[http://babel.alis.com:8080/]{}{}Create your own multilingual Web\EndLink

\<babel.4ht\><<<
% babel.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>

|<babel.def|>
\Hinput{babel}
\endinput
>>>        \AddFile{5}{babel}

\<babel.def\><<<
|<bbl@redefine|>
|<bbl@redefinerobust|>
|<robust babel|>
\def\:temp#1{{\leavevmode #1}}
\HLet\save@sf@q|=\:temp
|<set@low@box|>
|<arabic digits|>
>>>

\<set@low@box\><<<
\def\:tempc#1#2#3{\HCode{<sub>}{\let\/=\empty#1}\HCode{</sub>}}
\HLet\set@low@box|=\:tempc
\HLet\quotedblbase|=\empty
\HLet\quotesinglbase|=\empty
\NewConfigure{quotedblbase}[1]{\def\n:quotedblbase:{#1}}
\NewConfigure{quotesinglbase}[1]{\def\n:quotesinglbase:{#1}}
\Configure{quotedblbase}{\o:quotedblbase:}
\Configure{quotesinglbase}{\o:quotesinglbase:}
>>>

% \expandafter\def\csname glqq \endcsname{\HCode{&\#132;}}
% \expandafter\def\csname glq \endcsname{\HCode{&\#130;}}

% this command will convert normal numbers to arabic
% it fixes both babel and polyglossia version
% Unicode block for Arabic numerals starts at U+0660
% the following special command inserts the XML entity
% for the number, which will be converted to Unicode char
% by tex4ht
\<arabic digits\><<<
\def\arabic:loopoverdigits#1{\ifx\relax#1\else%
\ht:special{t4ht@+&{35}x066#1{59}}\a:HChar%
\expandafter\arabic:loopoverdigits\fi}
\def\arabicdigits#1{\arabic:loopoverdigits#1\relax}
>>>

\<robust babel\><<<
\def\@newl@bel#1#2{{\:SUBOff\:SUPOff \@safe@activestrue 
   \xdef\:temp{\noexpand\n:wlbl{#1}{#2}}}\:temp }
\pend:defI\l:bel{\Protect\@safe@activestrue}
\append:defI\l:bel{\Protect\@safe@activesfalse}
>>>

\<bbl@redefine\><<<
\def\:tempc#1{%
  \edef\bbl@tempa{\expandafter\@gobble\string#1}%
  \expandafter\let\csname org@\bbl@tempa\endcsname#1
  \expandafter\def\csname\bbl@tempa\endcsname}
\let\@c:tex|=\@citex
\:tempc\@c:tex[#1]#2{%
  \@safe@activestrue\org@@c:tex[#1]{#2}\@safe@activesfalse}
\let\@citex|=\@c:tex
>>>

\<robust babel\><<<
\let\@b:bitem=\@bibitem
\def\@bibitem#1{\@safe@activestrue
  \edef\:temp{\noexpand\@b:bitem{#1}}\@safe@activesfalse\:temp}
>>>


I don't know what this code was meant to do in the past, but it fails 
with the current LaTeX. It is better to not use it.
See \Link[https://tex.stackexchange.com/q/651631/2891]{}{} this issue\EndLink.
\<not use bbl@redefinerobust\><<<
\def\:tempc#1{%
  \edef\bbl@tempa{\expandafter\@gobble\string#1}%
  \expandafter\ifx\csname \bbl@tempa\space\endcsname\relax
    \expandafter\let\csname org@\bbl@tempa\endcsname#1
    \expandafter\edef\csname\bbl@tempa\endcsname{\noexpand\protect
      \expandafter\noexpand\csname\bbl@tempa\space\endcsname}%
  \else
    \expandafter\let\csname org@\bbl@tempa\expandafter\endcsname
                    \csname\bbl@tempa\space\endcsname
  \fi
  \expandafter\def\csname\bbl@tempa\space\endcsname}
\:tempc\:ref#1{\@safe@activestrue\org@:ref{#1}\@safe@activesfalse}
\let\ref|=\:ref
>>>

\<babel.def\><<<
\def\active:prefix#1{\protect#1}
\def\:temp#1{%
  \ifx\protect\@typeset@protect
  \else
    \bbl@afterfi\active:prefix#1\@gobble
  \fi}
\HLet\active@prefix|=\:temp
>>>

\<babel.def\><<<
\def\:tempc#1{\leavevmode \a:ddj}
\HLet\ddj@=\:tempc
\def\:tempc#1{\leavevmode \a:DDJ}
\HLet\DDJ@=\:tempc
\NewConfigure{ddj}{1}
\NewConfigure{DDJ}{1}
\Configure{DDJ}{\leavevmode\ht:special{t4ht@+{38}{35}x0110;}\a:HChar}
\Configure{ddj}{\leavevmode\ht:special{t4ht@+{38}{35}x0111;}\a:HChar}
>>>


\Section{csquotes}

\<csquotes.4ht\><<<
% csquotes.4ht (|version), generated from |jobname.tex 
% Copyright 2019 TeX Users Group 
|<TeX4ht license text|> 
|<csquotes footnote fix|>
|<csquotes display|>
\Hinput{csquotes}
\endinput
>>>   \AddFile{7}{csquotes}

Fix for footnotes inside a blockquote environment.

See \Link[https://tex.stackexchange.com/a/474605/2891]{}{}this answer on TeX.sx\EndLink
for details

\<csquotes footnote fix\><<<
\long\def\csq@bquote@i#1#2#3#4#5#6{%
\csq@bquote@ii{#1}{#2}{#3}{#4}{#5}{#6}}
>>>     

Display quotes environment support. We redefine the commands used by multiple
environments to insert XML tags.

\<csquotes display\><<<
\NewConfigure{displayquote}{4}
\let\csq:bdquote\csq@bdquote
\def\csq@bdquote#1#2#3#4#5{%
\a:displayquote%
\csq:bdquote{#1}{#2}{#3}{#4}{#5}%
}

\let\csq:edquote\csq@edquote%
\def\csq@edquote{\csq:edquote\d:displayquote}

\renewcommand{\mkenddispquote}[2]{#1\b:displayquote#2\c:displayquote}
>>>

Handle circumflex catcodes when the \Verb|early^| option is used.

\<add to usepackage\><<<
\Configure{PackageHooks}{babel.sty}{babel-sty-hooks.4ht}
>>>

\<babel-sty-hooks.4ht\><<<
% babel-sty-hooks.4ht, generated from |jobname.tex
% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>
|<disable early sup|>
|<babelfont|>
>>> 
\AddFile{9}{babel-sty-hooks}

The babelfont command can be used in the document preamble.
It can cause fatal errors, because it changes font encodings
and can cause loating of OTF fonts

\<babelfont\><<<
\ProvideDocumentCommand\:babelfont{o m o m}{}

\:AtEndOfPackage{%
  % disable \babelfont
  \let\babelfont\:babelfont
}
>>>

%%%%%%%%%%%%%%%%%%%%%%
\Section{CJK}
%%%%%%%%%%%

\<CJK.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% CJK.4ht                               |version %
% Copyright (C) |CopyYear.2000.             Eitan M. Gurari         %
|<TeX4ht copyright|>
|<CJK config|>
\Hinput{CJK}
\endinput
>>>        \AddFile{7}{CJK}

\<CJK config\><<<
\pend:defI\CJK@input{%
   \edef\CJK:ccode{\catcode`\noexpand\^|=\the\catcode`\^%
      \catcode`\noexpand\_|=\the\catcode`\_}\catcode`\^|=7 \catcode`\_|=8}
\append:defI\CJK@input{\CJK:ccode}
>>>

\<CJK config\><<<
\long\def\CJKboldshift{0em{}\:gobble}
\expandafter
  \pend:defI\csname CJKsymbol \endcsname{\ifCJK@bold@ \a:CJKbold\fi}
\expandafter
  \append:defI\csname CJKsymbol \endcsname{\ifCJK@bold@ \b:CJKbold\fi}
\expandafter
  \pend:defII\csname CJKsymbols \endcsname{\ifCJK@bold@ \a:CJKbold\fi}
\expandafter
  \append:defII\csname CJKsymbols \endcsname{\ifCJK@bold@ \b:CJKbold\fi}
\NewConfigure{CJKbold}{2}
>>>

\<CJK config\><<<
\let\o:CJK@envStart:=\CJK@envStart
\pend:defIII\CJK@envStart{%
   \global\let\CJK@envStart=\o:CJK@envStart:
   \global\let\o:CJK@envStart:=\:UnDef
   \Tag{CJK.enc}{##2}}
\NewConfigure{CJK.enc}[2]{%
   \edef\:temp{\LikeRef{CJK.enc}}%
   \def\:tempa{#1}\ifx \:temp\:tempa  #2\fi
}
>>>

%%%%%%%%%%%%%%%%
\Section{arabtex}
%%%%%%%%%%%%%%%

% \<Arabicore.4ht\><<<
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% % Arabicore.4ht                          |version %
% % Copyright (C) |CopyYear.2006.       Youssef Jabri               %
% %                            Modified by Eitan M. Gurari %
% |<TeX4ht copyright|>
% |<arabicore configs|>
% \Hinput{Arabicore}
% \endinput
% >>>        \AddFile{8}{Arabicore}

\<arabicore.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% arabicore.4ht                          |version %
% Copyright (C) |CopyYear.2006.       Youssef Jabri               %
%                            Modified by Eitan M. Gurari %
|<TeX4ht copyright|>
|<arabicore configs|>
\Hinput{arabicore}
\endinput
>>>        \AddFile{8}{arabicore}

\<arabicore configs\><<<
\let\ht:everypar\o@everypar
\Configure{Lregion}{}{} 
>>>

%\def\bbl@arabi{\ifvmode\relax\else\HCode{<span dir="rtl">}\fi} 

%%%%%%%%%%%%%%%%
\Section{Farsi}
%%%%%%%%%%%%%%%

\<lfeenc.4ht\><<<
% lfeenc.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2007. Youssef Jabri
% Modified by Eitan M. Gurari
|<TeX4ht copywrite|>
  \long\def\ZWNJ{\noindent\ht:special{t4ht@+\string&{35}x200C;}\a:HChar} 
\Hinput{lfeenc}
\endinput
>>>        \AddFile{8}{lfeenc}

\<cp1256.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% cp1256.4ht                         |version %
% Copyright (C) |CopyYear.2007.       Youssef Jabri               %
|<TeX4ht copyright|>
|<cp1256 config|>
\Hinput{cp1256}
\endinput
>>>                        \AddFile{9}{cp1256}

\<8859-6.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% 8859-6.4ht                         |version %
% Copyright (C) |CopyYear.2007.       Youssef Jabri               %
|<TeX4ht copyright|>
|<cp1256 config|>
\Hinput{8859-6}
\endinput
>>>                        \AddFile{9}{8859-6}

\<cp1256 config\><<<
|<config textdegree|>
\long\def\mathonesuperior{{\sp1}} 
\long\def\maththreesuperior{{\sp3}} 
\long\def\mathtwosuperior{{\sp2}} 
>>>

%%%%%%%%%%%%%%%%
\Section{arabtex}
%%%%%%%%%%%%%%%

\<alatex.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% alatex.4ht                            |version %
% Copyright (C) |CopyYear.2001.             Eitan M. Gurari         %
|<TeX4ht copyright|>
|<alatex body|>
\Hinput{alatex}
\endinput
>>>        \AddFile{8}{alatex}

\<alatex body\><<<
\ifx \undefined \LaTeX \xpa \endinput \fi
\endinput
>>>

\<\><<<
\def \@footnotetext {% 
   \let\FNmark\@thefnmark
   \leavevmode\vbox
   \bgroup 
      \leftskip0pt
      {\ht:everypar{}\parindent0pt\leavevmode}%
      \ifx \footglue \undefined    \else 
         \setbox0=\hbox \bgroup    \footnotesize
      \fi
      \gdef\@makefnmark{\let\FNmark\@thefnmark
            \leavevmode\hbox{\gHAdvance\FNnum  1
               \a:footnote}}%
      \ifnum \FNnum>\fn:txt
         \gHAssign\fn:txt\FNnum
         \b:footnote  \let\@foot:c\c:footnote
      \else
         \a:footnotetext \b:footnotetext \let\@foot:c\c:footnotetext
      \fi
      \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
      \anc:lbl f{footnote}%
      \let\a:footnote\empty
      \a@fntext }
\def\@foot{\unskip \strut \@foot:c
   \ht:special{t4ht@[}\egroup \ht:special{t4ht@]}}
>>>

%%%%%%%%%%%%%%%%
\Section{Right-to-Left Babel}
%%%%%%%%%%%%%%%%

\<rlbabel.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% rlbabel.4ht                           |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<rlbabel def|>
\Hinput{rlbabel}
\endinput
>>>        \AddFile{8}{rlbabel}

\<rlbabel def\><<<
\let\ht:everypar|=\o@everypar
\def\L{\protect\pL}
\def\R{\protect\pR}
\Configure{@:currentlabel}
  {\let\special\:gobble
   \let\protect\empty
   \let\o:beginL:=\empty
   \let\o:endL:=\empty
   \Configure{Lregion}{}{}%
  }
>>>

tex4ht.sty indert  Rregion  and Lregion end hooks within
\Verb+\beginL/R+ and \Verb+\endL/R+, mainly to void the 
inverse produced by the elatex compiler. The latter commands are
native to elatex. We need to be carefull how we configure them, since
they are not always nested nicely within groups.

   
\<rlbabel def\><<<
\def\:tempc{\a:moreR\bracetext \aftergroup\endR 
  \aftergroup\b:moreR \beginR\csname
  to\@rllanguagename\endcsname}
\HLet\moreR|=\:tempc
\NewConfigure{moreR}{2}
>>>

\<rlbabel def\><<<
\def\:tempc{\a:moreL\bracetext \aftergroup\endL 
  \aftergroup\b:moreL \beginL\csname
  from\@rllanguagename\endcsname}
\HLet\moreL|=\:tempc
\NewConfigure{moreL}{2}
>>>

\<rlbabel def\><<<
\NewConfigure{$$}[3]{%
   \def\a:display{\bgroup#1}%
   \def\b:display{#2\egroup \if@rl\else \beginL\fi}%
   \def\c:display{#3}%
   \everydisplay{\ifx \EndPicture\:UnDef
        $$\a:display\everymath{}\everydisplay{}$$
              \aftergroup\b:display \c:display\fi}}
\let\rl:b:display\b:display
\let\rl:c:display\c:display
\let\rl:a:display\a:display
\Configure{$$}{\rl:a:display}{\rl:b:display}{\rl:c:display}
>>>

%%%%%%%%%%%%%%%%%%
\Section{hebtex}
%%%%%%%%%%%%%%%%%%

\Link[http://www.dsg.technion.ac.il/heblatex/]{}{}heblatex\EndLink

Note: we should distinguish between
 hebrew.ldf and   hebrew.sty

\<hebtex.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% hebtex.4ht                            |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<hebtex body|>
\Hinput{hebtex}
\endinput
>>>        \AddFile{8}{hebtex}

\<hebtex body\><<<
\let\:tempc|=\arabtext
\pend:def\:tempc{\a:arabtext}
\HLet\arabtext|=\:tempc
\let\:tempc|=\endarabtext
\pend:def\:tempc{\Configure{HtmlPar}{}{}{}{}}
\append:def\:tempc{\b:arabtext}
\HLet\endarabtext|=\:tempc
\HLet\RLtext  \arabtext     \HLet\endRLtext  \endarabtext
\HLet\hebtext \arabtext     \HLet\endhebtext \endarabtext
\HLet\hebtex  \arabtext     \HLet\endhebtex  \endarabtext 
>>>

\<hebtex body\><<<
\let\:tempc|=\a@arab@codes
\pend:def\:tempc{%
    \chardef\up:de = \catcode`\^   \catcode`\^=7
    \chardef\dn:de = \catcode`\_   \catcode`\_=8 }
\append:def\:tempc {%
   \catcode`\^=\up:de  \catcode`\_=\dn:de}
\HLet\a@unarab@codes|=\:tempc
>>>

\<hebtex body\><<<
\let\put@ab@x|=\:tempc
\pend:def\:tempc{%
   \let\sv:noindent=\noindent
   \def\rc:noindent{\let\noindent=\sv:noindent}%
   \def\noindent{\rc:noindent  \noindent   \c:arabtext
      \let\sv:endgraf=\endgraf 
      \def\endgraf{\d:arabtext\sv:endgraf \aftergroup\rc:noindent }}%
}
\append:def\:tempc{\let\noindent|=\sv:noindent}
\HLet\put@ab@x|=\:tempc
\def\:tempc {\:nbsp}
\HLet\arab@space|=\:tempc
\NewConfigure{arabtext}{4}
>>>

\<hebtex body\><<<
\def\:tempc{\a:chireq} \HLet \put@chireq=\:tempc 
\NewConfigure{chireq}{1}
\def\:tempc{\a:cholem} \HLet \put@cholem=\:tempc 
\NewConfigure{cholem}{1}
\def\:tempc{\a:cholem} \HLet\h@cholem=\:tempc 
\NewConfigure{cholem}{1}
\def\:tempc{\a:chpatach} \HLet \put@chpatach=\:tempc 
\NewConfigure{chpatach}{1}
\def\:tempc{\a:chqames} \HLet \put@chqames=\:tempc 
\NewConfigure{chqames}{1}
\def\:tempc{\a:chsegol} \HLet \put@chsegol=\:tempc 
\NewConfigure{chsegol}{1}
\def\:tempc{\a:dagesh} \HLet\put@dagesh=\:tempc 
\NewConfigure{dagesh}{1}
\def\:tempc{\a:meteg} \HLet\h@meteg=\:tempc 
\NewConfigure{meteg}{1}
\def\:tempc{\a:patachf} \HLet \put@patachf=\:tempc 
\NewConfigure{patachf}{1}
\def\:tempc{\a:patach} \HLet \put@patach=\:tempc 
\NewConfigure{patach}{1}
\def\:tempc{\a:qameschat} \HLet\put@qameschat=\:tempc 
\NewConfigure{qameschat}{1}
\def\:tempc{\a:qames} \HLet \put@qames=\:tempc 
\NewConfigure{qames}{1}
\def\:tempc{\a:qibbus} \HLet\put@qibbus=\:tempc 
\NewConfigure{qibbus}{1}
\def\:tempc{\a:rdot} \HLet\h@rdot=\:tempc 
\NewConfigure{rdot}{1}
\def\:tempc{\a:segol} \HLet\put@segol=\:tempc 
\NewConfigure{segol}{1}
\def\:tempc{\a:sere} \HLet \put@sere=\:tempc 
\NewConfigure{sere}{1}
\def\:tempc{\a:shindot} \HLet\h@shindot=\:tempc 
\NewConfigure{shindot}{1}
\def\:tempc{\a:shwa} \HLet \put@shwa=\:tempc 
\NewConfigure{shwa}{1}
\def\:tempc{\a:sindot} \HLet\h@sindot=\:tempc 
\NewConfigure{sindot}{1}
>>>

\<abidir.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% abidir.4ht                            |version %
% Copyright (C) 2001             Eitan M. Gurari         %
|<TeX4ht copyright|>
|<arabtex bidir|>
\Hinput{abidir}
\endinput
>>>        \AddFile{8}{abidir}

\<arabtex bidir\><<<
\def\a@Rinsert#1{%
  \leavevmode \a:RL\vbox{\everypar{}\a@sequence {#1}}\b:RL }
\NewConfigure{RL}{6}
>>>

% 
% \pend:def\a@Ldimen{\expandafter\def
%    \expandafter\ev:disp\expandafter{\expandafter\everydisplay
%    \expandafter{\the\everydisplay}}\everydisplay{\IgnorePar}}
% \append:def\a@Ldimen{\ev:disp}
% 
% 
% \let\:tempc|=\a@RL
% \pend:def\:tempc{\a:RL\bgroup 
%    \append:defI\a@@Rinsert{\egroup\b:RL}}
% \HLet\a@RL|=\:tempc

\<hewrite.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% hewrite.4ht                           |version %
% Copyright (C) 2001             Eitan M. Gurari         %
|<TeX4ht copyright|>
|<reverse hebrew words|>
\Hinput{aparse}
\endinput
>>>        \AddFile{8}{hewrite}

\<reverse hebrew words\><<<
\def\:temp #1#2+#3*#4<{% 
   \def \next {\heb@mid #4}%
   \ifnum \act@cd = \m@qqeph
      \def \next {\heb@end #4}\put@b@x {\the\act@cd }%
      \ifhcl@s \else \put@box {\raise .6ex \hbox
         {\kern.05em\unhbox \ab@x \kern.05em}}%              
      \fi 
   \else \ifnum \act@cd = \illch@r
      \put@b@x {\the\act@cd }%
   \else
      \ifnum \act@cd = \hc@@ 
         \heb@cd \hc@y \advance \heb@cd \heb@dsp
         \put@box {\hphantom{\char \the\heb@cd }}%
      \else   \heb@cd \act@cd \advance \heb@cd \heb@dsp
         \put@b@x {\the\heb@cd }%
      \fi
      \ifhv@wel \heb@accent #2+#3*%
         \ifcase \act@mod \or \h@sindot \or \h@shindot \fi
         \if@dagesh \put@dagesh \fi
      \fi      
   \fi\fi
   \:heblet \unhbox \ab@x \end:heblet
   \h@test@chr #4}
\HLet\h@put@mid=\:temp
>>>

\<reverse hebrew words\><<<
\def\:temp #1>{% 
 \iftest@write \iftest@parse \else \a@verb (#1 )>\fi
   \tracingmacros = 1 \fi
   \a@write@hook
   \ifa@@write {\heb@beg #1>0+0*>\end:hebword}\fi
   \iftest@write \tracingmacros = 0
 \fi }
\HLet\heb@write=\:temp
>>>

\<reverse hebrew words\><<<
\def\:heblet{\a:hewrite}
\def\end:heblet{\b:hewrite}
\let\end:hebword=\empty
\:CheckOption{rl2lr}\if:Option
   \csname newbox\endcsname\heb:box
   \setbox\heb:box=\hbox{}
   \pend:def\:heblet{\setbox\heb:box=\hbox\bgroup}
   \append:def\end:heblet{\unhbox\heb:box\egroup}
   \def\end:hebword{\unhbox\heb:box}
\else
   \Log:Note{to reverse the direction of 
       Hebrew words, use the command line option `rl2lr'}
\fi
\NewConfigure{hewrite}{2} 
>>>

\<aoutput.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% aoutput.4ht                           |version %
% Copyright (C) 2001             Eitan M. Gurari         %
|<TeX4ht copyright|>
|<aoutput sentences|>
\Hinput{aoutput}
\endinput
>>>        \AddFile{8}{aoutput}

\<aoutput sentences\><<<
\let\:tempc|=\put@ab@x
\pend:def\:tempc {%
   \setbox\a@tempb@x=\hbox{\c:RL \box\a@tempb@x \d:RL}}
\HLet\put@ab@x|=\:tempc
>>>

\<aoutput sentences\><<<
\:CheckOption{RL2LR}\if:Option
  |<reverse sentences|>
\else
  \Log:Note{to reverse direction of RL sentences, 
          use the command line option `RL2LR'}
  |<non reverse sentences|>
\fi
>>>

\<non reverse sentences\><<<
\let\:tempc|=\put@word
\pend:def\:tempc{\setbox\wordb@x \hbox {\e:RL \unhcopy \wordb@x \f:RL }}
\HLet\put@word|=\:tempc
>>>

\<reverse sentences\><<<
\def\:tempc{%
   \ifa@space \putlineb@x
       {\unhcopy \lineb@x \arab@space \e:RL \unhcopy \wordb@x \f:RL}%
   \else \add@word   \fi }
\HLet\addt@line|=\:tempc
\def\:tempc{% 
   \putlineb@x {\unhbox \lineb@x \e:RL \unhbox \wordb@x  \f:RL}}
\HLet\add@word|=\:tempc
>>>

% \def\put:word {%
%    \setbox\wordb@x \hbox {\e:RL \unhcopy \wordb@x \f:RL }%
%    \setbox \a@tempb@x \hbox
%    {\unhcopy \lineb@x \ifa@space \arab@space \fi \unhcopy \wordb@x}%
%    \ifdim \a@limit < \wd\lineb@x \put@line \add@word \else 
%    \ifdim \a@limit < \wd\a@tempb@x \put@line \add@word \else 
%       \setbox \lineb@x \box \a@tempb@x
%    \fi\fi 
% }
%    \let\:tempc|=\a@@Rinsert
%    \pend:defI\:tempc{\HLet\put@word|=\put:word }
%    \HLet\a@@Rinsert|=\:tempc

 
%%%%%%%%%%%%%%%%%%
\Section{koi8-r}
%%%%%%%%%%%%%%%%%%

\<koi8-r.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% koi8-r.4ht                            |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{koi8-r}
\endinput
>>>        \AddFile{8}{koi8-r}

 
%%%%%%%%%%%%%%%%%%
\Section{latin2}
%%%%%%%%%%%%%%%%%%

\<latin2.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% latin2.4ht                            |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{latin2}
\endinput
>>>        \AddFile{6}{latin2}

%%%%%%%%%%%%%%%%%%%%%%%
\Section{frenchb.ldf}
%%%%%%%%%%%%%%%%%%%%%%%

% \<frenchb.4ht\><<<
% % frenchb.4ht (|version), generated from |jobname.tex
% % Copyright |CopyYear.2001. Eitan M. Gurari
% |<TeX4ht copyright|>
% |<declare frenchb shorthand|>
% |<frenchb nbsp|>
% \Hinput{frenchb}
% \endinput
% >>>        \AddFile{8}{frenchb}

% \<declare frenchb shorthand\><<<
% \def\frenchb:shorthand#1#2#3#4{%
%   \ifhmode
%      \ifdim \lastskip >\z@ \unskip \penalty \@M
%         \csname a:#1-#2\endcsname#3\csname b:#1-#2\endcsname
%      \else
%         \csname a:#1-#2\endcsname#4\csname b:#1-#2\endcsname
%   \fi \fi }
% >>>

% \<frenchb nbsp\><<<
% \def\:temp{\leavevmode \nobreak \csname a:system-nbsp\endcsname\ \csname 
%                   b:system-nbsp\endcsname}
% \expandafter\HLet\csname \system@group @sh@\string ~@\endcsname=\:temp
% \expandafter \ifx \csname FDP@colonspace\endcsname\relax
%   |<pre 2001/09/09 v1.5g frenchb|>
% \else
%   |<since 2001/09/09 v1.5g frenchb|>
% \fi
% \AtBeginDocument{%
%  \def\:temp{\frenchb:shorthand{frenchb}{thinspace}
%                               {\thinspace }{\FDP@thinspace}\string ;}%
%  \expandafter\HLet\csname\language@group @sh@\string ;@\endcsname=\:temp
%  \def\:temp{\frenchb:shorthand{frenchb}{thinspace}
%                               {\thinspace }{\FDP@thinspace}\string !}%
%  \expandafter\HLet\csname\language@group @sh@\string !@\endcsname=\:temp
%  \def\:temp{\frenchb:shorthand{frenchb}{thinspace}
%                               {\thinspace }{\FDP@thinspace}\string ?}%
%  \expandafter\HLet\csname\language@group @sh@\string ?@\endcsname=\:temp
% }
% \NewConfigure{frenchb-nbsp}{2}
% \NewConfigure{frenchb-thinspace}{2}
% \NewConfigure{system-nbsp}{2}
% >>>

% \<pre 2001/09/09 v1.5g frenchb\><<<
% \AtBeginDocument{%
%  \def\:temp{\frenchb:shorthand{frenchb}{nbsp}{\ }{\FDP@space}\string :}%
%  \expandafter\HLet\csname\language@group @sh@\string :@\endcsname=\:temp
% }
% >>>

% \<since 2001/09/09 v1.5g frenchb\><<<
% \AtBeginDocument{%
%  \def\:temp{\frenchb:shorthand{frenchb}{nbsp}{\ }{\FDP@colonspace}\string :}%
%  \expandafter\HLet\csname\language@group @sh@\string :@\endcsname=\:temp
% }
% >>>

% \Verbatim
% \declare@shorthand{frenchb}{:}{%
%     \ifhmode
%       \ifdim\lastskip>\z@
%         \unskip\penalty\@M\
%       \else
%         \FDP@space
%       \fi
%     \fi
%     \string:}
% \EndVerbatim

% \Verbatim
% \declare@shorthand{french}{:}{%
%     \ifhmode
%       \ifdim\lastskip>\z@
%         \unskip\penalty\@M\Fcolonspace
%       \else
%         \FDP@colonspace
%       \fi
%     \fi
%     \string:}
% \EndVerbatim

% The following is for code such as 

% \Verbatim
%  \documentclass{article}
%   \usepackage[francais]{babel}
%  \begin{document}

%  \tableofcontents
 
%  \section{Ma premi{\`e}re section !}
 
%  \section{Culture : d{\'e}sillusions}

%  \section{Culture :d{\'e}sillusions} 
%  \end{document}
% \EndVerbatim

% \<frenchb nbsp\><<<
% \catcode`\:=13
% \expandafter\let\csname protect\string:\endcsname=:
% \expandafter\def\csname active\string
%     :prefix\endcsname#1{\protect#1\ifx#1:{}\fi}
% \catcode`\:=11
% >>>

% \`=With the package \usepackage[francais]{babel} , every `;' `:' ...
%  must be preceded by an unbreakable space.  This works okay for the
%  input `a:' and `a :', but for `a~:' TeX4ht introduces _2_ unbreakable
%  spaces instead of one.=

\<frenchb.4ht\><<<
% frenchb.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2001. Eitan M. Gurari
|<TeX4ht copywrite|>
|<declare frenchb shorthand|>
|<frenchb nbsp|>
|<frenchb luatex|>
\Hinput{frenchb}
\endinput
>>>        \AddFile{8}{frenchb}

\<declare frenchb shorthand\><<<
\def\frenchb:shorthand#1#2#3#4{%
  \ifhmode
     \ifdim \lastskip >\z@ \unskip \penalty \@M
        \csname a:#1-#2\endcsname#3\csname b:#1-#2\endcsname
     \else
        \csname a:#1-#2\endcsname#4\csname b:#1-#2\endcsname
  \fi \fi }
>>>

\<frenchb nbsp\><<<
\def\:temp{\leavevmode \nobreak \csname a:system-nbsp\endcsname\ \csname 
                  b:system-nbsp\endcsname}
\expandafter\HLet\csname \system@group @sh@\string ~@\endcsname=\:temp
\expandafter \ifx \csname FDP@space\endcsname\relax
  |<since 2001/09/09 v1.5g frenchb|>
\else
  |<pre 2001/09/09 v1.5g frenchb|>
\fi
\AtBeginDocument{%
 \def\:temp{\frenchb:shorthand{frenchb}{thinspace}
                              {\thinspace }{\FDP@thinspace}\string ;}%
 \expandafter\HLet\csname\language@group @sh@\string ;@\endcsname=\:temp
 \def\:temp{\frenchb:shorthand{frenchb}{thinspace}
                              {\thinspace }{\FDP@thinspace}\string !}%
 \expandafter\HLet\csname\language@group @sh@\string !@\endcsname=\:temp
 \def\:temp{\frenchb:shorthand{frenchb}{thinspace}
                              {\thinspace }{\FDP@thinspace}\string ?}%
 \expandafter\HLet\csname\language@group @sh@\string ?@\endcsname=\:temp
}
\NewConfigure{frenchb-nbsp}{2}
\NewConfigure{frenchb-thinspace}{2}
\NewConfigure{system-nbsp}{2}
>>>

\<frenchb luatex\><<<
\ifFB@luatex@punct
\FB@luatex@punctfalse
\fi
>>>

\<pre 2001/09/09 v1.5g frenchb\><<<
\AtBeginDocument{%
 \def\:temp{\frenchb:shorthand{frenchb}{nbsp}{\ }{\FDP@space}\string :}%
 \expandafter\HLet\csname\language@group @sh@\string :@\endcsname=\:temp
}
>>>

\<since 2001/09/09 v1.5g frenchb\><<<
\AtBeginDocument{%
 \def\:temp{\frenchb:shorthand{frenchb}{nbsp}{\ }{\FDP@colonspace}\string :}%
 \expandafter\HLet\csname\language@group @sh@\string :@\endcsname=\:temp
}
>>>

\Verbatim
\declare@shorthand{frenchb}{:}{%
    \ifhmode
      \ifdim\lastskip>\z@
        \unskip\penalty\@M\
      \else
        \FDP@space
      \fi
    \fi
    \string:}
\EndVerbatim

\Verbatim
\declare@shorthand{french}{:}{%
    \ifhmode
      \ifdim\lastskip>\z@
        \unskip\penalty\@M\Fcolonspace
      \else
        \FDP@colonspace
      \fi
    \fi
    \string:}
\EndVerbatim

The following is for code such as 

\Verbatim
 \documentclass{article}
  \usepackage[francais]{babel}
 \begin{document}

 \tableofcontents
 
 \section{Ma premi{\`e}re section !}
 
 \section{Culture : d{\'e}sillusions}

 \section{Culture :d{\'e}sillusions} 
 \end{document}
\EndVerbatim

\<frenchb nbsp\><<<
\catcode`\:=13
\expandafter\let\csname protect\string:\endcsname=:
\expandafter\def\csname active\string
    :prefix\endcsname#1{\protect#1\ifx#1:{}\fi}
\catcode`\:=11
>>>

\`=With the package  \usepackage[francais]{babel} , every `;' `:' ...
 must be preceded by an unbreakable space.  This works okay for the
 input `a:' and `a :', but for `a~:' TeX4ht introduces _2_ unbreakable
 spaces instead of one.=



%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{german.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[/n/ship/0/packages/tetex/teTeX/texmf/tex/generic/misc/german.sty]{}{}german.sty\EndLink

\<german.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% german.4ht                            |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<set@low@box|>
\Hinput{german}
\endinput
>>>        \AddFile{7}{german}

\<german accents\><<<
\ifx \@begindocumenthook\:UnDef\else
   \:CheckOption{new-accents}        \if:Option  \else
      \def\:tempc{\csname grmn:OTumlaut\endcsname}
      \HLet\grmn@OTumlaut\:tempc
\fi \fi
>>>

% \expandafter
%   \def\csname glqq \endcsname{\HCode{&}\HChar{35}\HCode{8222;}}
% \expandafter
%    \def\csname glq \endcsname{\HCode{&}\HChar{35}\HCode{8218;}}

\Verbatim

> A minor problem showed up with hyphenation hints. In the german
> language, compound words of different languages are built with
> a hyphen between them, e.g. "Select-Klausel" or "depends-Abh\"angigkeit", 
> to make the change of language clear (there are other reasons for
> explicit hyphens, too). Since TeX does not hyphenate such compounds,
> and they can get very long in german, we use a macro "" (with active
> doublequote), defined as \hskip\z@skip, so TeX will hyphenate again:
> Select-""Klausel, depends-""Abh"angigkeit ("a is short for \"{a}).
> tex4ht translates this to a space, which makes sense since browsers
> will not break the compounds without that space either. However, I'd
> prefer to not have such spaces. Could this be configurable?

\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{ngerman.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<ngerman.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ngerman.4ht                           |version %
% Copyright (C) |CopyYear.2005.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config ngerman|>
|<set@low@box|>
\Hinput{ngerman}
\endinput
>>>        \AddFile{5}{ngerman}

\<germanb.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% germanb.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config germanb|>
\Hinput{germanb}
\endinput
>>>                        \AddFile{9}{germanb}

\<ngermanb.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ngermanb.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config ngermanb|>
\Hinput{ngermanb}
\endinput
>>>                        \AddFile{9}{ngermanb}

\<config germanb\><<<
\def\:tempc{\penalty \@M -\csname a:german"=\endcsname}
\expandafter\HLet\csname german@sh@\string"@=@\endcsname \:tempc 
\NewConfigure{german"=}{1}
\Configure{german"=}{}
>>>

\<config germanb\><<<
\def\:tempc{\csname a:german""\endcsname}
\expandafter\HLet\csname german@sh@\string"@"@\endcsname \:tempc 
\NewConfigure{german""}{1}
\Configure{german""}{}
>>>

\<config ngermanb\><<<
\def\:tempc{\penalty \@M -\csname a:german"=\endcsname}
\expandafter\HLet\csname ngerman@sh@\string"@=@\endcsname \:tempc 
\NewConfigure{german"=}{1}
\Configure{german"=}{}
>>>

\<config ngermanb\><<<
\def\:tempc{\csname a:german""\endcsname}
\expandafter\HLet\csname ngerman@sh@\string"@"@\endcsname \:tempc 
\NewConfigure{german""}{1}
\Configure{german""}{}
>>>

In bermanb.ldf, the above configurations contain  \Verb!\hskip 0pt!
(to avoid/allow line breaks ???). They can cause unwanted line
breaks in hypertext.

\HPage{example}
\Verbatim
\documentclass[a4paper]{article}  
\usepackage[german]{babel}  
\begin{document}  
X  
  
F\"ur  
die  
CFD  
Berechnungen  
wurden  
3D Modelle  
mit  
1234 Hexaeder"=E  
 
F\"ur  
die  
CFD  
Berechnungen  
wurden  
3D Modelle  
mit  
1234 Hexaederr""E  
 
  
\end{document}  
\EndVerbatim

\EndHPage{}

%%%%%%%%%%%%%%%%%%%
\Section{manju}
%%%%%%%%%%%%%%%%%%%

See also
CTAN:language/mongolian/montex/examples

\<manju.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% manju.4ht                           |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<manju hooks|>
\Hinput{manju}
\endinput
>>>        \AddFile{9}{manju}

\<manju hooks\><<<
\renewcommand{\mabosoo}[1]{\def\:temp{#1}\ifx \:temp\empty\else
     \bosoo{{\bth #1}}\fi}
>>>

%%%%%%%%%%%%%%%%%%%%
\Section{italian}
%%%%%%%%%%%%%%%%%%%%

\<italian.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% italian.4ht                           |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<italian 4ht|>
\Hinput{italian}
\endinput
>>>       \AddFile{7}{italian}

\<italian 4ht\><<<
\expandafter\def\csname bbl@ap \endcsname#1{%
  \textormath{\textsuperscript{#1}}{{\HCode{}}\sp{\mathrm{#1}}}}%
\expandafter\def\csname bbl@ped \endcsname#1{%
   \textormath{${\HCode{}}\sb{\mbox{\fontsize\sf@size\z@
        \selectfont#1}}$}{{\HCode{}}\sb{\mathrm{#1}}}}
>>>

%%%%%%%%%%%%%%%%%
\Section{french}
%%%%%%%%%%%%%%%%

\<french.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% french.4ht                            |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\expandafter\ifx \csname @s@ORI\endcsname \relax 
\else 
   |<french 4ht|>
   \Configure{special}{\csname @s@ORI\endcsname}
\fi
\Hinput{french}
\endinput
>>>       \AddFile{7}{french}

\<french 4ht\><<<
\let\:GOfrench|=\GOfrench
\def\GOfrench{\:GOfrench \let\:GOfrench|=\:UnDef%
  \def\@makefnmark{%
     \def\:temp{\expandafter\noexpand\csname ifFTY\endcsname
                \hbox{\noexpand\normalfont
                   \ifx\thefootnote\relax\else
                              \noexpand\,\fi}\expandafter
                             \noexpand\csname fi\endcsname}\:temp
     \let\FNmark\@thefnmark
     \leavevmode\hbox{%
        \gHAdvance\FNnum  1 \a:footnote}}%
}
>>>

\<french 4ht\><<<
\def\:temp#1#2{\seename \/ {#1}}
\ifx\see\:temp
   \pend:def\printindex{%
      \Configure{toToc}{likechapter}{chapter}%         
      \Configure{toToc}{likesection}{section}%
      \let\sv:addcontentsline=\addcontentsline
      \def\addcontentsline{\let\addcontentsline=\sv:addcontentsline
         \:gobbleIII}}
   \append:def\printindex{%
      \Configure{toToc}{likechapter}{}%         
      \Configure{toToc}{likesection}{}}
\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Verbatim}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{verbatimfiles.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<verbatimfiles.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% verbatimfiles.4ht                     |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<verbatimfiles.sty code|>
\Hinput{verbatimfiles}
\endinput
>>>        \AddFile{9}{verbatimfiles}

\<verbatimfiles.sty code\><<<
\pend:defI\verbatimlisting{\a:verbatimlisting\bgroup
    \pend:def\thelineno{\c:verbatimlisting}
    \append:def\thelineno{\d:verbatimlisting}}
\append:defI\verbatimlisting{\egroup\b:verbatimlisting}
\NewConfigure{verbatimlisting}{4}
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{verbatim.sty}
%%%%%%%%%%%%%%%%%%%%%%%

\Link[/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/tools/verbatim.sty]{}{}%
verbatim.sty\EndLink

\<verbatim.4ht\><<<
% verbatim.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
|<verbatim.sty code|>
\Hinput{verbatim}
\endinput
>>>        \AddFile{9}{verbatim}

\<verbatim.sty code\><<<
\pend:def\endverbatim{\Configure{obeylines}{}{}{}}
\pend:def\verbatiminput{\a:verbatiminput \list:save \begingroup
   \aftergroup\list:recall \aftergroup\b:verbatiminput
   \:gobble}
\NewConfigure{verbatiminput}{2}
>>>

\Section{moreverb.sty}

\Link[/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/tools/moreverb.sty]{}{}%
moreverb.sty\EndLink

\<moreverb.4ht\><<<
% moreverb.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>

|<moreverb.sty|>
\Hinput{moreverb}
\endinput
>>>        \AddFile{7}{moreverb}

\<moreverb.sty\><<<
|<fix moreverb|>
|<moreverb.sty shared config|>
>>>

\<fix moreverb\><<<
\pend:def\endverbatimtab{\ht:everypar{}}
\pend:def\verbatimtab{\bgroup
  \Configure{obeylines}{}{}{}%
  \Configure{HtmlPar}{\a:verbatimtab}{\a:verbatimtab}{}{}%
  \let\ =\b:verbatimtab }
\append:def\endverbatimtab{\egroup\IgnorePar}
\NewConfigure{verbatimtab}{2}
>>>

\<fix moreverb\><<<
\def\boxedverbatim{\verbatim}
\def\endboxedverbatim{\endverbatim}
>>>

\<fix moreverb\><<<
\let\:listinginput|=\@listinginput
\def\@listinginput{\a:listinginput\begingroup
   \def\@verbatim{\aftergroup\endgroup\aftergroup\b:listinginput
      \o:@verbatim:}%
   \:listinginput}
>>>

\<moreverb.sty shared config\><<<
\NewConfigure{listinginput}{2} 
>>>

\<moreverb.sty\><<<
\let\o:verbatimtabinput:=\verbatimtabinput
\def\verbatimtabinput{\a:verbatimtabinput\begingroup  
   \aftergroup\b:verbatimtabinput
   \let\:temp=\begingroup
   \def\begingroup{\let\begingroup=\:temp}%
   \o:verbatimtabinput:}
\NewConfigure{verbatimtabinput}{2}
>>>

\Section{fancyvrb.sty}

\Link[/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/tools/fancyvrb.sty]{}{}%
fancyvrb.sty\EndLink

\<fancyvrb.4ht\><<<
% fancyvrb.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>

  |<fancyvrb.sty|>
\Hinput{fancyvrb}
\endinput
>>>        \AddFile{7}{fancyvrb}

\<fancyvrb.sty\><<<
 |<fix fancyvrb|>
   |<fancyvrb.sty shared config|>
>>>

\SubSection{Verbatim}

\<fix fancyvrb\><<<
\pend:def\FV@FormattingPrep{|<find color for fancyvrb|>}
\append:def\FV@FormattingPrep{\a:fancyvrb%
   |<frames for fancyvrb|>%
   |<color for fancyvrb|>%
}
>>>

\''\FV@RightListNumber' not recognized in ttct.cls with test.tex. Why?

\<fix fancyvrb\><<<
\def\FV@ListProcessLine#1{%
    \hbox{\c:fancyvrb \anc:lbl r{FancyVerbLine}\FV@LeftListNumber%
      \FV@LeftListFrame \e:fancyvrb \FancyVerbFormatLine{#1}\f:fancyvrb%
      \FV@RightListFrame \csname FV@RightListNumber\endcsname %
          \d:fancyvrb}}
>>>

These macros are original fancyvrb versions, we removed some penalty commands,
as they resulted in unwanted blank lines.

\<fix fancyvrb\><<<
\def\FV@ListProcessLine@iii#1{%
  \box\@tempboxa
  \setbox\@tempboxa=\FV@ListProcessLine{#1}%
  \let\FV@ProcessLine\FV@ListProcessLine@iv}
\def\FV@ListProcessLine@iv#1{%
  % we use \nobreak to really prevent unwanted line breaks
  % see https://github.com/michal-h21/make4ht/issues/104
  \box\@tempboxa\nobreak% 
  \setbox\@tempboxa=\FV@ListProcessLine{#1}}%
\def\FV@ListProcessLastLine{%
  \ifx\FV@ProcessLine\FV@ListProcessLine@iv
    \box\@tempboxa
  \else
    \ifx\FV@ProcessLine\FV@ListProcessLine@iii
      \box\@tempboxa
    \else
      \ifx\FV@ProcessLine\FV@ListProcessLine@i
        \FV@Error{Empty verbatim environment}{}%
        \FV@ProcessLine{}%
      \fi
    \fi
  \fi}


\def\FV@EndList{\FV@ListProcessLastLine  \FV@EndListFrame%
  \IgnorePar\b:fancyvrb\par\@endparenv%
  \endgroup   \@endpetrue}
\def\FV@StepLineNo{%
  \FV@SetLineNo%
  \def\FV@StepLineNo{\SkipRefstepAnchor\refstepcounter{FancyVerbLine}}%
  \FV@StepLineNo}
>>>

The command 
\''\@endparenv' will complain if encounter in horizontal mode.

\`'\Configure{fancyvrb}
   {before-env} {after-env} {before-line} {after-line} {before-text}
   {after-text}'---beween end points of lines, and of tex, we can have
   line numbers.

\<fancyvrb.sty shared config\><<<
\NewConfigure{fancyvrb}{6}
>>>

\SubSection{Verb}

We must prevent execution of the code in a:fancyvrb in \Verb+\FVC@Verb+, as it
inserts special for ignoring of the output, so the rest of the document 
wouldn't be produced. This hook is inserted by \Verb+\FV@FormattingPrep+.
See \Link[://github.com/michal-h21/make4ht/issues/141]{}{}this issue\EndLink.

\<fix fancyvrb\><<<
\def\:tempa#1{\let\sa:fancyvrb\a:fancyvrb\let\a:fancyvrb\empty\a:verb\o:FVC@Verb:{#1}\global\let\a:fancyvrb\sa:fancyvrb\aftergroup\b:verb}
\HLet\FVC@Verb\:tempa
>>>

\<fix fancyvrb\><<<
\def\:tempa#1{\mbox{\FV@UseKeyValues%
   \let\a:fancyvrb|=\empty \FV@FormattingPrep%
   \a:verb #1\b:verb}}
\HLet\:tempa\FV@UseVerb
>>>

\SubSection{Colors}

\<find color for fancyvrb\><<<
\let\fv:color|=\empty 
  \ifx \color\:UnDef\else\Configure{color}{\xdef\fv:color}\fi
>>>

\<color for fancyvrb\><<<
\bgroup
  \ifx \fv:color\empty \else{%
     \let\HColor\fv:color \a:fancyvrbcolor%
  }\fi
  \ifx \FancyVerbFillColor\relax \ifx\FancyVerbBackgroundColor\relax\else%
     \ifdefined\FancyVerbBackgroundColor% this extra check is needed for \BVerbatimInput
       \:fvcolor \b:fancyvrbcolor \color{\FancyVerbBackgroundColor}|<par del|>%
     \fi%
  \fi\else%
     \:fvcolor \b:fancyvrbcolor \FancyVerbFillColor|<par del|>%
  \fi
  \ifx \FancyVerbRuleColor\relax \else%
     \:fvcolor \c:fancyvrbcolor \FancyVerbRuleColor|<par del|>%
  \fi
\egroup
\let\FV@BeginListFrame|=\relax
\let\FV@LeftListFrame|=\relax
\let\FV@RightListFrame|=\relax
\let\FV@EndListFrame|=\relax
>>>

\<fix fancyvrb\><<<
\def\:fvcolor#1{\def\a:color##1##2|<par del|>{%
   \Configure{SetHColor}#1{##1}}}%
>>>

\<fancyvrb.sty shared config\><<<
\NewConfigure{fancyvrbcolor}{3}    
>>>

Colors text/background/frame

%%%%%%%%%%%%%%%%%%%
\SubSection{Frames}
%%%%%%%%%%%%%%%%%%%

\<frames for fancyvrb\><<<
\ifx \FV@BeginListFrame\relax\else
   \tmp:dim=\FV@FrameRule \edef\HSize{\the\tmp:dim}%
   \a:fancyvrbframe
\fi
\ifx \FV@LeftListFrame\relax\else
   \tmp:dim=\FV@FrameRule \edef\HSize{\the\tmp:dim}%
   \b:fancyvrbframe
\fi
\ifx \FV@EndListFrame\relax\else
   \tmp:dim=\FV@FrameRule \edef\HSize{\the\tmp:dim}%
   \c:fancyvrbframe
\fi
\ifx \FV@RightListFrame\relax\else
   \tmp:dim=\FV@FrameRule \edef\HSize{\the\tmp:dim}%
   \d:fancyvrbframe
\fi
>>>

\<fancyvrb.sty shared config\><<<
\NewConfigure{fancyvrbframe}{6}    
>>>

Frame up/left/down/right/thickness/padding

We get duplications, because we don't know the order of parameters
(e.g., \`'\begin{Verbatim}% [frame=single,framerule=1mm]'), and even
which ones are present at all.

\<fix fancyvrb\><<<
\define@key{FV}{framerule}{%
  \@tempdima=#1\relax%
  \edef\FV@FrameRule{\number\@tempdima sp\relax}%
  {\Advance:\fancyvrbNo by 1   \tmp:dim=\FV@FrameRule%
   \edef\HSize{\the\tmp:dim}%
   \e:fancyvrbframe}}
\define@key{FV}{framesep}{%
  \@tempdima=#1\relax%
  \edef\FV@FrameSep{\number\@tempdima sp\relax}%
  {\Advance:\fancyvrbNo by 1    \tmp:dim=\FV@FrameSep%
   \edef\HSize{\the\tmp:dim}%
   \f:fancyvrbframe}}
>>>

\SubSection{Boxed Verbatim}

Verbatim within \TeX{} box.

\<fix fancyvrb\><<<
\def\FV@BVerbatimBegin{%
  \ht:special{t4ht@(}\begingroup%
    \let\a:fancyvrb\empty\IgnorePar%
    \FV@UseKeyValues%
    \FV@BeginVBox%
    \let\FV@ProcessLine\FV@BProcessLine%
    \FV@FormattingPrep%
    \FV@ObeyTabsInit\a:BVerbatimInput\ht:special{t4ht@)}
}%
\def\FV@BVerbatimEnd{\b:BVerbatimInput\ht:special{t4ht@(}\FV@EndVBox\ht:special{t4ht@)}\endgroup}
\def\FV@BProcessLine#1{\hbox{\FancyVerbFormatLine%
   {\c:BVerbatimInput#1\d:BVerbatimInput}}}   
\NewConfigure{BVerbatimInput}{4}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Verbatim in Footnores}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<fix fancyvrb\><<<
\def\V@@footnotetext{%
\leavevmode%
   \vbox\bgroup%
      \leftskip0pt {\ht:everypar{}\parindent0pt\leavevmode}%
      |<footnote label|>%
      \a:footnotetext%
      \b:footnotetext%
      \csname a:footnotebody\endcsname%
      \bgroup%
          \reset@font\footnotesize%
          \bgroup %
             \aftergroup\V@@@footnotetext %
             \ignorespaces%
}
\def\V@@@footnotetext{%
      \egroup%
      \csname b:footnotebody\endcsname%
      \c:footnotetext%
   \ht:special{t4ht@[}\egroup\ht:special{t4ht@]}%
}
>>>

\<fix fancyvrbNO\><<<
\pend:def\V@@footnotetext{%
   \let\FNmark|=\@thefnmark%
   \begingroup%
   \ifnum \FNnum>\fn:txt%
      \gHAssign\fn:txt|=\FNnum%
      \def\@makefnmark{\hbox{\ExitHPage{\a:footnote}}}%
      \b:footnote \def\end:fverb{\c:footnote}%
   \else%
      \a:footnotetext \b:footnotetext \let\end:fverb|=\c:footnotetext%
   \fi%
   \:gobbleII}
\append:def\V@@@footnotetext{\end:fverb\endgroup}
>>>

We mimic, and using components from, the standard verbatim environment
of LaTeX.  The \''\:gobbleII' is for getting rid of the
\`'\insert\footins'.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{minted}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\<minted.4ht\><<<
% minted.4ht (|version), generated from |jobname.tex
% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>

|<minted inline fixes|>
|<minted background color|>
|<minted input fixes|>

\Hinput{minted}
\endinput
>>> \AddFile{9}{minted}

Support for inline Minted listings. We need to take care of
newline and space characters, as they produce unwanted white space
in the generated HTML.

\<minted inline fixes\><<<
\NewConfigure{InlineCode}{2}
% this is a hack to hide a newline that is produced, and which causes spurious space in the output
\NewConfigure{MintedHideNewline}{2} 
% I cannot reproduce the newline issue now, but it seems that 
% this comment can hide desired tags sometimes, so we should disable it.
% See https://github.com/michal-h21/make4ht/issues/92
%\Configure{MintedHideNewline}{\HCode{<!--}}{\HCode{-->}}

\def\:tempa#1{%
  \endgroup%
  \begingroup%
  \Configure{BVerbatimInput}{\HCode{}\ht:special{t4ht@(}}% \HCode is necessary for correct paragraph handlingling
  {\a:MintedHideNewline}{\ht:special{t4ht@)}}{}{}% also hide newline and spurious spaces
  \a:InlineCode%
  \begingroup%
  \o:minted@inline@iii:{#1}\b:MintedHideNewline%
  \b:InlineCode%
  \endgroup%
}

\HLet\minted@inline@iii\:tempa
>>>

Minted 3.0 changed the way it works with the background color. 
It now uses Fancyvrb, so the minted@colorbg environment is not used anymore. 
We need to remove the redefinition, to prevent compilation error. 
The MintedColorbg configuration can stay here, to prevent errors in 
user config files that use it, but it doesn't have any effect.

\<minted background color\><<<
% support for background color in Minted listings
\NewConfigure{MintedColorbg}{2}
>>>

\<minted background color not used\><<<
\renewenvironment{minted@colorbg}[1]{%
  \colorlet{shadecolor}{#1}%
  \extractcolorspec{shadecolor}{\:tempa}%
  \expandafter\convertcolorspec\:tempa{HTML}\minted:bgcolor%
  \a:MintedColorbg%
  }
  {\b:MintedColorbg\medskip\noindent}
>>>

Minted sometimes produces unexpected results. For example, << characters 
get translated to guilelemets. To prevent that, we define new configuration,
mintedfixes, where we can redefine macrod used by Minted to produce correct
results.

\<minted input fixes\><<<
\NewConfigure{mintedfixes}[1]{\concat:config\a:mintedfixes{#1}}
\let\a:mintedfixes\empty

\def\:tempa#1{\a:mintedfixes\o:minted@input:{#1}}

\Configure{mintedfixes}{\def\PYGZlt{\textless}\def\PYGZgt{\textgreater}}

\HLet\minted@input\:tempa

>>>

The breaklines option for Minted environments and commands causes source code
lines to collapse into one line. We try to prevent that by basically disabling
this option.

As it can be declared in the preamble, we must patch the usepackage code.

\<add to usepackage\><<<
\Configure{PackageHooks}{minted.sty}{minted-sty-hooks.4ht}
>>>

\<minted-sty-hooks.4ht\><<<
% minted-sty-hooks.4ht, generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
\AddToHook{package/minted/after}{%
\@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}}
|<minted breaklines|>
}
>>> 
\AddFile{9}{minted-sty-hooks}


We use modified version of the keyval option declaration command used by
Minted, it turns the breaklines option to false when it is used.

\<minted breaklines\><<<
\newcommand{\:minted@def@opt@switch}[2][false]{%
  \define@booleankey{minted@opt@g}{#2}%
    {\@namedef{minted@opt@g:#2}{false}}%
    {\@namedef{minted@opt@g:#2}{false}}
  \define@booleankey{minted@opt@g@i}{#2}%
    {\@namedef{minted@opt@g@i:#2}{false}}%
    {\@namedef{minted@opt@g@i:#2}{false}}
  \define@booleankey{minted@opt@lang}{#2}%
    {\@namedef{minted@opt@lang\minted@lang :#2}{false}}%
    {\@namedef{minted@opt@lang\minted@lang :#2}{false}}
  \define@booleankey{minted@opt@lang@i}{#2}%
    {\@namedef{minted@opt@lang\minted@lang @i:#2}{false}}%
    {\@namedef{minted@opt@lang\minted@lang @i:#2}{false}}
  \define@booleankey{minted@opt@cmd}{#2}%
    {\@namedef{minted@opt@cmd:#2}{false}}%
    {\@namedef{minted@opt@cmd:#2}{false}}%
  \@namedef{minted@opt@g:#2}{#1}%
}
\:minted@def@opt@switch{breaklines}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{piton}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\<piton.4ht\><<<
% piton.4ht (|version), generated from |jobname.tex
% Copyright 2023-2024 TeX Users Group
|<TeX4ht license text|>

\ExplSyntaxOn
|<piton xcolor|>
|<piton spaces|>
|<piton env|>
|<piton inlines|>
\ExplSyntaxOff
\Hinput{piton}
\endinput
>>> \AddFile{9}{piton}

If Xcolor is not loaded earlier, Piton loads it in the begindocument/before hook. 
It leads to a compilation error caused by catcodes mismatch.  We can prevent it 
by loading Xcolor earlier.

\<piton xcolor\><<<
\IfPackageLoadedTF{xcolor}{}{\RequirePackage{xcolor}}
>>>

The current version of Piton started to show visible space character (U+2423) instead 
of spaces even if they are not requested using the show-spaces option. This code should 
prevent that.

\<piton spaces\><<<
\def\:pitonvisiblespace{ \HCode{\string&\#x2423;} }
\cs_new_protected:Npn \:__piton_replace_spaces:n #1
  {
    \tl_set:Nn \l_tmpa_tl { #1 }
    \bool_if:NTF \l__piton_show_spaces_bool
      {
        \tl_set:Nn \l__piton_space_tl {\:pitonvisiblespace} % U+2423
        \regex_replace_all:nnN { \x20 } {\c{:pitonvisiblespace}} \l_tmpa_tl
      }
      {
        \bool_if:NTF \l__piton_break_lines_in_Piton_bool
          {
            \regex_replace_all:nnN
              { \x20 }
              { \c { __piton_breakable_space: } }
              \l_tmpa_tl
            \regex_replace_all:nnN
              { \c { l__piton_space_tl } }
              { \c { __piton_breakable_space: } }
              \l_tmpa_tl
          }
          {
    \regex_replace_all:nnN { \x20 } { \x20 } \l_tmpa_tl
          }
      }
    \l_tmpa_tl
  }


\HLet\__piton_replace_spaces:n\:__piton_replace_spaces:n
>>>

\<piton env\><<<

\NewConfigure{pitonline}{3}
\NewConfigure{pitonnumber}{2}
\protected\def\:tempa #1\__piton_end_line:{
  \:pitonendignorelines\glet\:pitonendignorelines\relax
  \group_begin:
  % we set line in a box, because otherwise lines are collapsed sometimes
  \hbox_set:Nn \l_tmpa_box{
  \a:pitonline
  \a:pitonnumber
  \bool_if:NT \l__piton_line_numbers_bool
  {
  \bool_if:nF
    {
      \str_if_eq_p:nn { #1 } { \PitonStyle {Prompt}{} }
      &&
      \l__piton_skip_empty_lines_bool
    }
    { \int_gincr:N \g__piton_visual_line_int}

  \bool_if:nT
    {
      ! \str_if_eq_p:nn { #1 } { \PitonStyle {Prompt}{} }
      ||||
      ( ! \l__piton_skip_empty_lines_bool && \l__piton_label_empty_lines_bool )
    }
    \__piton_print_number:
  }
  \b:pitonnumber
  \language = -1
  \raggedright
  \strut
  % \HCode{<code>}
  \b:pitonline
  \NoFonts
  \__piton_replace_spaces:n { #1 }
  \EndNoFonts
  % 
  \c:pitonline
  }
  \box_use_drop:N \l_tmpa_box
  \group_end:
}
\HLet\__piton_begin_line:\:tempa


\NewConfigure{piton}{2}

% Piton environments and file input produces extra blank line at the start
% we use TeX4ht specials to remove them
\gdef\:pitonendignorelines{}
\pend:def\__piton_pre_env:{\a:piton
  \ht:special{t4ht@[}% ignore next linebreak, to preven spurious blank line at the beginning of listings
  \gdef\:pitonendignorelines{\ht:special{t4ht@]}}
}
\append:def\__piton_write_aux:{\b:piton}

>>>

\<piton inlines\><<<
\NewDocumentCommand { \:__piton_piton_standard } { m }
  {
    \group_begin:
    \ttfamily
    \a:pitonline\b:pitonline
    \automatichyphenmode = 1
    \cs_set_eq:NN \\ \c_backslash_str
    \cs_set_eq:NN \% \c_percent_str
    \cs_set_eq:NN \{ \c_left_brace_str
    \cs_set_eq:NN \} \c_right_brace_str
    \cs_set_eq:NN \$ \c_dollar_str
    \cs_set_eq:cN { ~ } \space
    \cs_set_protected:Npn \__piton_begin_line: { }
    \cs_set_protected:Npn \__piton_end_line: { }
    \tl_set:Ne \l_tmpa_tl
      {
        \lua_now:e
          { piton.ParseBis('\l__piton_language_str',token.scan_string()) }
          { #1 }
      }
    \bool_if:NTF \l__piton_show_spaces_bool
      { \regex_replace_all:nnN { \x20 } { ^^^^2423  } \l_tmpa_tl } % U+2423
      { 
        \bool_if:NT \l__piton_break_lines_in_piton_bool
          { \regex_replace_all:nnN { \x20 } { \x20 } \l_tmpa_tl }
      }
      % our extra code to remove the space glyph
    \regex_replace_all:nnN { \x20 } { \c { __piton_breakable_space: } } \l_tmpa_tl
    \l_tmpa_tl
    \c:pitonline
    \group_end:
  }

\HLet\__piton_piton_standard\:__piton_piton_standard

\NewDocumentCommand { \:__piton_piton_verbatim } { v }
  {
    \group_begin:
    \ttfamily
    \a:pitonline\b:pitonline
    \automatichyphenmode = 1
    \cs_set_protected:Npn \__piton_begin_line: { }
    \cs_set_protected:Npn \__piton_end_line: { }
    \tl_set:Ne \l_tmpa_tl
      {
        \lua_now:e
          { piton.Parse('\l__piton_language_str',token.scan_string()) }
          { #1 }
      }
    \bool_if:NT \l__piton_show_spaces_bool
      { \regex_replace_all:nnN { \x20 } { ^^^^2423  } \l_tmpa_tl } % U+2423
    % our extra code to remove the space glyph
    \regex_replace_all:nnN { \x20 } { \c { __piton_breakable_space: } } \l_tmpa_tl
    \l_tmpa_tl
    \c:pitonline
    \group_end:
  }

\HLet\__piton_piton_verbatim\:__piton_piton_verbatim
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{pythontex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\<pythontex.4ht\><<<
% pythontex.4ht (|version), generated from |jobname.tex
% Copyright 2019 TeX Users Group
|<TeX4ht license text|>
\def\:tempa#1{%
  \endgroup%
  \begingroup%
  \Configure{BVerbatimInput}{\HCode{}}{}{}{}{}\ifmmode\else\a:InlineCode\fi%
  \begingroup%
  \o:pytx@InlineMargBgroup:{#1}%
  \ifmmode\else\b:InlineCode\fi%
  \endgroup%
}

\HLet\pytx@InlineMargBgroup\:tempa

\NewConfigure{InlineCode}{2}

\Hinput{pythontex}
\endinput
>>> \AddFile{9}{pythontex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Slides}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%
\Section{Prosper}
%%%%%%%%%%%%%%%%%%%%%

\<prosper.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% prosper.4ht                           |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\let\prosper:Hinput=\Hinput
\def\Hinput#1{%
   \prosper:Hinput{#1}%
   \def\:temp{#1}\def\:tempa{seminar}\ifx \:temp\:tempa
      \let\Hinput=\prosper:Hinput
      \input prosper-a.4ht
   \fi
}
\endinput
>>>        \AddFile{9}{prosper}

The prosper class loads the article and seminar classes, and then its
own definitions.

\<prosper-a.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% prosper-a.4ht                         |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<shared prosper code|>
\expandafter\ifx  \csname @tempoLimit\endcsname\relax
   |<pre mid 2001 prosper|>
\else
   |<mid 2001 prosper|>
\fi
|<shared prosper code for hyperref|>
\Hinput{prosper}
\endinput
>>>        \AddFile{9}{prosper-a}

The prosper class loads hyperref before tex4ht. Hence:

\<shared prosper code\><<<
\ifHy@texht \else
   \:warning{Package option `tex4ht' missing for prosper.cls. Should
      be present with a PPR style option: default, darkblue,...}
\fi
\def\:temp{tex4ht}\ifx \:temp\Style@chosen
   \:warning{PPR style package option missing for prosper.cls
             (e.g., default, darkblue).}
\fi
\Log:Note{if figures in slides of prosper.cls
   translate to empty bitmaps, adjust the G-script in tex4ht.env  
   to handle larger page dimensions.}
>>>

\<shared prosper code\><<<
\let\orig@item\item
\pend:def\enditemize{\global\let\sv:end:DL\end:DL}
\append:def\enditemize{\sv:end:DL}
>>>

\<shared prosper code for hyperref\><<<
\let\hyp:enumerate\enumerate
\def\enumerate{\hyp:enumerate\@nmbrlistfalse}
>>>

\<pre mid 2001 prosper\><<<
\def\maketitle{\bgroup
   |<adjust minipageNum for setcounter footnote 0|>%
   \def\sec:typ{title}%
   \ConfigureEnv{center}{\empty}{}{\empty}{\empty}
   |<prosper maketitle markup|>%
   |<pre mid 2001 prosper maketitle markup|>%
   \a:mktl  \o:maketitle:  \b:mktl
   \egroup \let\maketitle\empty}
>>>

\<mid 2001 prosper\><<<
\def\maketitle{\bgroup
   |<adjust minipageNum for setcounter footnote 0|>%
   \def\sec:typ{title}%
   \ConfigureEnv{center}{\empty}{}{\empty}{\empty}
   |<prosper maketitle markup|>%
   |<mid 2001 prosper maketitle markup|>%
   \a:mktl  \o:maketitle:  \b:mktl
   \egroup \let\maketitle\empty}
>>>

\<prosper maketitle markup\><<<
\pend:def\@Title{\a:ttl}\append:def\@Title{\b:ttl}%
\pend:def\@Author{\a:author}\append:def\@Author{\b:author}%
\expandafter\ifx\csname @institution\endcsname\relax \else
   \ifx\@institution\@empty \else
      \pend:def\@institution{\a:institution}%
      \append:def\@institution{\b:institution}%
\fi\fi
>>>

\<mid 2001 prosper maketitle markup\><<<
\ifx\@Subtitle\@empty \else
   \pend:def\@Subtitle{\a:Subtitle}%
   \append:def\@Subtitle{\b:Subtitle}%
\fi
\ifx\@email\@empty \else
   \expandafter\pend:def\expandafter\@email\expandafter{%
       \expandafter\def\expandafter\@email\expandafter{\@email
                               }\a:email}\append:def\@email{\b:email}%
\fi
>>>

\<pre mid 2001 prosper maketitle markup\><<<
\if\@Subtitle.\else
   \pend:def\@Subtitle{\a:Subtitle}%
   \append:def\@Subtitle{\b:Subtitle}%
\fi
\if\@email.\else
   \expandafter\pend:def\expandafter\@email\expandafter{%
       \expandafter\def\expandafter\@email\expandafter{\@email
                               }\a:email}\append:def\@email{\b:email}%
\fi
>>>

\<shared prosper code\><<<
\NewConfigure{Subtitle}{2}
\NewConfigure{email}{2}
\NewConfigure{institution}{2}
>>>

\<shared prosper code\><<<
\let\part=\relax
\newcommand{\part}[2][\@defaultTransition]{%
  \begin{slide}[#1]{}%
    \vspace*{1.5cm}|<prospect part toc|>\@addBookmarkOnSlide{0}{#2}%
    \begin{center}%
      \fontTitle{#2}%
    \end{center}
  \end{slide}}
>>>

\<prospect part toc\><<<
\def\Hy@temp{#2}%
\addcontentsline{toc}{part}{%
   \expandafter\strip@prefix\meaning\Hy@temp}%
>>>

\<shared prosper code\><<<
\def\tocslideentry#1#2#3{#3}
>>>

\<pre mid 2001 prosper\><<<
\def\@addBookmarkOnSlide#1{%
   \def\Hy@temp{#1}%
   \addcontentsline{toc}{slide}{%
      \string\tocslideentry
      {}{\thetrueSlideCounter}
      {\expandafter\strip@prefix\meaning\Hy@temp}}%
}
>>>

\<shared prosper code\><<<
\def\@addBookmarkOnSlide#1#2{%
  \ifnum#1=0
    \def\Hy@temp{#2}%
    \addcontentsline{toc}{slide}{%
       \string\tocslideentry
       {}{\thetrueSlideCounter}
       {\expandafter\strip@prefix\meaning\Hy@temp}}%
  \else
    \@tempoLimit=#1%
    \advance \@tempoLimit by -1
    \ifcollapsedBookmarks
       \@tempoLimit=-\@tempoLimit
    \fi
    \def\Hy@temp{#2}%
    \addcontentsline{toc}{slide}{%
       \string\csname\space tocslideentry\string\endcsname
       {\number\@tempoLimit}{\thetrueSlideCounter}
       {\expandafter\strip@prefix\meaning\Hy@temp}}%
  \fi
}
>>>

\<shared prosper code\><<<
\expandafter\slide@hook\expandafter{\the \slide@hook
   \let\posit@Box=\empty
   \let\endposit@Box=\empty
}
\long\def\@on@overlay@one#1{}
>>>

\<shared prosper code\><<<
\pend:defI\slidetitle{\a:slidetitle}
\append:defI\slidetitle{\b:slidetitle}
\NewConfigure{slidetitle}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%% 
\Section{Powerdot} 
%%%%%%%%%%%%%%%%%%%%%%%% 
 
 
 
\<powerdot.4ht\><<< 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
% powerdot.4ht                          |version % 
% Copyright (C) |CopyYear.2006.       Eitan M. Gurari         % 
|<TeX4ht copyright|> 
  \Hinclude{\input powerdot-a.4ht}{article}  
\endinput 
>>>        \AddFile{8}{powerdot} 
 
 
 
 
\<powerdot-a.4ht\><<< 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
% powerdot-a.4ht                        |version % 
% Copyright (C) |CopyYear.2006.       Eitan M. Gurari         % 
|<TeX4ht copyright|> 
  |<powerdot code|> 
\Hinput{powerdot} 
\endinput 
>>>        \AddFile{8}{powerdot-a} 
 
% \HRestore\maketitle 

A \''\relax' is prepended to the start of the definitions
\`'\@namedef{end#2}{\ifpd@display\pd@slide\fi}' provided within
\`'\def\pd@pddefinetemplate[#1]#2#3#4{...}'.

\<powerdot code\><<< 
\pend:defI\pd@getargsandbody{%
   \expandafter\ifx \csname set:env:##1\endcsname\relax
      \expandafter\gdef\csname set:env:##1\endcsname{}%
      \expandafter\pend:def\csname end##1\endcsname{\relax}%
      \expandafter\global\expandafter\let
               \csname end##1\expandafter\endcsname\csname end##1\endcsname
      \expandafter\ifx\csname before:begin##1\endcsname\relax
          \:warning{\string\ConfigureEnv{##1} not provided}%
    \fi \fi
}
>>>

\<powerdot code\><<< 
\def\:tempc{%
  |<hooks for slide titles|>%
  \append:def\pd@template@slide@options{%
       \setkeys [pd]{template}{lfpos={}, rfpos={},
              tocpos={}, stocpos={}, ntocpos={}}}%
  \append:def\pd@template@titleslide@options{%
                  \setkeys [pd]{template}{lfpos={},rfpos={}}}%
  \o:pd@sl@de:}
\HLet\pd@sl@de\:tempc
\NewConfigure{slidetitle}{2}
>>>

\<hooks for slide titles\><<<
\let\sv:rput\rput
\def\rput[##1](##2)##3{\def\:temp{\pd@@titlepos}\def\:tempa{##2}%
   \ifx \:temp\:tempa        
       \let\rput\sv:rput 
       \def\:temp{\a:slidetitle\sv:rput[##1](##2){##3}\b:slidetitle}%
   \else
       \def\:temp{\sv:rput[##1](##2){##3}}%
   \fi \:temp
}%
>>>

\<powerdot code\><<< 
\let\:item\pd@orig@item
\let\pd@orig@item\@item 
\def\@item[#1]{\@ifnextchar<{\pd@item[#1]}{\pd@item[#1]<>}} 
\def\pd@item[#1]<#2>{% 
  \pd@closeitem 
  \ifx\pd@@type\pd@currenttype\else 
    \ifnum\pd@@type=\z@ 
      \pst@Verb{(1) BOL}% 
    \else 
      \pst@Verb{(0) BOL}% 
      \normalcolor 
    \fi 
    \global\let\pd@currenttype\pd@@type 
  \fi 
  \ifnum\pd@currentstate=\z@ 
    \normalcolor\pst@Verb{(0) BOL}% 
    \pd@hide{#2}% 
  \else 
    \color\pd@@iacolor 
  \fi 
  \ifx\@empty#2\@empty\else 
    \def\pd@closeitem{\gdef\pd@currentstate{0}}% 
  \fi 
  \pd@orig@item[#1]\@@par\leavevmode \ignorespaces
} 
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{beamer}
%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%
\SubSection{Beamer}
%%%%%%%%%%%%%

\<beamer.4ht\><<<
% beamer.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2003. Eitan M. Gurari
|<TeX4ht copywrite|>
|<shared conf beamer|>
\ifx \beamer@version\:UnDef
   |<shared conf beamer 0.8 and 0.3|>
   \ifx \insertinstituteshort\:UnDef
      |<conf beamer 0.8|>
   \else 
      |<conf beamer 0.3|>
   \fi
\else
   |<conf beamer 3.01|>
\fi
|<conf beamer current|>
\Hinput{beamer}
\endinput
>>>        \AddFile{9}{beamer}

\<shared conf beamer\><<<
|<beamer title page|>
|<beamer sections|>
|<beamer toc|>
|<beamer other|>
>>>

\<conf beamer 0.3\><<<
\append:def\andtitle{\a:andtitle}
\def\insttitle#1{\a:inst$\sp{#1}$\b:inst}
\def\instinst#1{\a:inst$\sp{#1}$\b:inst\ignorespaces}
>>>

\<conf beamer 0.8\><<<
\append:def\beamer@andtitle{\a:andtitle}
\def\beamer@insttitle#1{\a:inst$\sp{#1}$\b:inst}
\def\beamer@instinst#1{\a:inst$\sp{#1}$\b:inst\ignorespaces}
>>>

\<conf beamer 0.3\><<<
\pend:def\titlepage{%
   \a:titlepage
   \pend:def\inserttitletitle{\a:title}%
   \append:def\inserttitletitle{\b:title}%
   \pend:def\insertauthortitle{\a:author}%
   \append:def\insertauthortitle{\b:author}%
   \pend:def\insertinstitute{\a:institute}%
   \append:def\insertinstitute{\b:institute}%
   \pend:def\insertdate{\a:date}%
   \append:def\insertdate{\b:date}%
   \pend:def\inserttitlegraphic{\a:titlegraphic}%
   \append:def\inserttitlegraphic{\b:titlegraphic}%
}
\append:def\titlepage{\b:titlepage}
>>>

\<conf beamer 0.8\><<<
\pend:def\titlepage{%
   \a:titlepage
   \pend:def\inserttitle{\a:title}%
   \append:def\inserttitle{\b:title}%
   \pend:def\insertauthor{\a:author}%
   \append:def\insertauthor{\b:author}%
   \pend:def\insertinstitute{\a:institute}%
   \append:def\insertinstitute{\b:institute}%
   \pend:def\insertdate{\a:date}%
   \append:def\insertdate{\b:date}%
   \pend:def\inserttitlegraphic{\a:titlegraphic}%
   \append:def\inserttitlegraphic{\b:titlegraphic}%
}
\append:def\titlepage{\b:titlepage}
>>>

\<beamer title page\><<<
\NewConfigure{titlepage}{2}
\NewConfigure{title}{2}
\NewConfigure{author}{2}
\NewConfigure{institute}{2}
\NewConfigure{date}{2}
\NewConfigure{titlegraphic}{2}
\NewConfigure{andtitle}{1}
\NewConfigure{inst}{2}
>>>

It seems that TOC in Beamer doesn't work. It probably isn't that
important, as it is usually used only in frame outlines, which 
aren't used in \TeX4ht output anyway. I will remove the following
code because it causes clash with BibLaTeX.

\<beamer toc no more\><<<
\def\addtocontents#1#2{%
   \let\glossary\@gobble%
   \add:toc{#1}{}{#2}%
}
\def\add:toc#1#2#3{{%
   \csname if:toc\endcsname{
      \def\protect{\noexpand\noexpand\noexpand}%
      \edef\:tempa{|<beamer toc entry|>}\:tempa
   }%
}}
>>>

\<beamer toc entry\><<<
\the\:tokwrite{\string\doTocEntry
   \string\toc#1{#2}{%
      \string\csname\space a:TocLink\string\endcsname
            {\FileNumber}{\cur:th\@currentlabel}{}{#3}%
   }{}\relax
}%
>>>      

\<beamer toc\><<<
\def\tableofcontents{\futurelet\:temp\:TOC}
\def\:TOC{\ifx [\:temp \expandafter\:TableOfContents
          \else \:TableOfContents[toc]\fi}
>>>

\<beamer toc 0.8 and 0.3\><<<
\pend:def\@subsectiontemplateshaded{\a:subsectionshadedintoc}
\append:def\@subsectiontemplateshaded{\b:subsectionshadedintoc}
\pend:def\@subsectiontemplate{\a:subsectionintoc}
\append:def\@subsectiontemplate{\b:subsectionintoc}
\pend:def\sectiontemplateshaded{\a:sectionshadedintoc}
\append:def\sectiontemplateshaded{\b:sectionshadedintoc}
\pend:def\sectiontemplate{\a:sectionintoc}
\append:def\sectiontemplate{\b:sectionintoc}

>>>

\<conf beamer 0.3\><<<
\let\o:subsection:\subsection
\def\subsection#1{%
   \expandafter\global\expandafter\sl:toks\expandafter
   {\the\sl:toks\leavevmode \o:subsection:{#1}%
    \add:toc{subsection}{\thesection.\thesubsection}{#1}}%
   |<cond undo delayed sect|>%
}
>>>

\<conf beamer 0.8\><<<
\let\o:@subsection:\@subsection
\def\@subsection[#1]#2{%
   \expandafter\global\expandafter\sl:toks\expandafter
   {\the\sl:toks\leavevmode \o:@subsection:[#1]{#2}%
    \add:toc{subsection}{\thesection.\thesubsection}{#2}}%
   |<cond undo delayed sect|>%
}
>>>

\<beamer sections\><<<
\let\o:@section:\@section
\def\@section[#1]#2{%
   \expandafter\global\expandafter\sl:toks\expandafter
   {\the\sl:toks\leavevmode \o:@section:[#1]{#2}%
    \add:toc{section}{\thesection}{\secname}}%
   |<cond undo delayed sect|>%
}

\let\o:untitledsubsection:\untitledsubsection
\def\untitledsubsection#1{%
   \expandafter\global\expandafter\sl:toks\expandafter
   {\the\sl:toks\leavevmode \o:untitledsubsection:}%
   |<cond undo delayed sect|>%
}

\newtoks\sl:toks
\NewConfigure{sec@slide}{2}
>>>

\<conf beamer 0.3\><<<
\pend:def\slide{\a:sec@slide\the\sl:toks\b:sec@slide 
   \global\sl:toks={}}
>>>

\<conf beamer 0.8\><<<
\let\be:frameslide\frameslide
\def\frameslide{\a:sec@slide\the\sl:toks\b:sec@slide
   \global\sl:toks={}\be:frameslide}
>>>

If sec@slide is configured, the section are subsection commands are
transported into the slide blocks.

\<cond undo delayed sect\><<<
\expandafter\ifx\csname a:sec@slide\endcsname\relax 
   \expandafter\ifx\csname b:sec@slide\endcsname\relax
       \the\sl:toks \global\sl:toks={}%
\fi\fi
>>>

\<beamer toc 0.8 and 0.3\><<<
\pend:def\@beginblocktemplate{\a:blocktitle}
\append:def\@beginblocktemplate{\b:blocktitle}
\pend:def\@beginalertblocktemplate{\a:blocktitle}
\append:def\@beginalertblocktemplate{\b:blocktitle}
\pend:def\@beginexampleblocktemplate{\a:blocktitle}
\append:def\@beginexampleblocktemplate{\b:blocktitle}
\NewConfigure{blocktitle}{2}
>>>

\<beamer toc 0.8 and 0.3\><<<
\pend:defI\frametitle{\bgroup
   \pend:def\@headrenderer{\a:frametitle}%
   \append:def\@headrenderer{\b:frametitle}%
}
\append:defI\frametitle{\egroup}
\NewConfigure{frametitle}{2}
>>>

\<beamer other\><<<
\pend:defI\alert{\a:alert}
\append:defI\alert{\b:alert}
\NewConfigure{alert}{2}
\pend:defI\structure{\a:structure}
\append:defI\structure{\b:structure}
\NewConfigure{structure}{2}
\NewConfigure{sectionshadedintoc}{2}
\NewConfigure{sectionintoc}{2}
\NewConfigure{subsectionshadedintoc}{2}
\NewConfigure{subsectionintoc}{2}
>>>

\<conf beamer current\><<<
\let\Hy@EveryPageAnchor\relax
\def\pgf@trimright@final{0pt}
\def\pgf@trimleft@final{0pt}
\let\origEndP\EndP
\AtBeginDocument{\def\EndP{\let\EndP\origEndP}\SaveEndP}


\NewConfigure{frame}{2}
\NewConfigure{frametitle}{2}
\AddToHook{env/beamer@frameslide/before}{\RecallEndP\a:frame\beamer@autobreakfalse}
\AddToHook{env/beamer@frameslide/after}{\b:frame}

\long\def\:temp[#1]#2{%
\a:frametitle%
\o:beamer@@frametitle:[#1]{#2}%
\b:frametitle%
}

\HLet\beamer@@frametitle\:temp
% Beamer redefines \emph, it is necessary to insert hooks again
\NewConfigure{emph}{2}
\pend:defI\emph{\a:emph}%
\append:defI\emph{\b:emph}%

>>>

We must disable Beamer's framebreaking, as it can lead to tag mis-match.
It should still work in the picture mode, as we use the HLet command.

\<conf beamer current\><<<
\HLet\framebreak\relax
>>>

This should prevent insertion of SVG elements around columns:

\<conf beamer current\><<<
\HLet\beamer@@spacingcover\relax
>>>

 Beamer can break BibLaTeX's bibliography across several slides, 
 which can lead in tag mis-match, as the closing tags for the bibliography 
 are inserted as child of other element, than the opening tags.

 This redefinition uses Beamer's macros to insert tags for each individual
 bib item, without container item that would cause problems.


\<conf beamer current\><<<
\NewConfigure{beamerbiblatex}{3}
\@ifpackageloaded{biblatex}{
  \pend:defI\beamer@biblabeltemplate{%
    \ifdefined\end:itm\end:itm\fi%
    \gdef\end:itm{\c:beamerbiblatex}%
    \a:beamerbiblatex%
  }
  \append:defI\beamer@biblabeltemplate{\b:beamerbiblatex}
  \AfterPreamble{%
    \def\bibConfigure{%
      \ConfigureList{thebibliography}%
      {\PushMacro\end:itm\let\end:itm=\empty}%
      {\end:itm\PopMacro\end:itm\global\let\end:itm\end:itm}{}{}%
    }
  }
}
{}

>>>
%%%%%%%%%%%%%
\SubSection{beamerbasetoc}
%%%%%%%%%%%%%

\<beamerbasetoc.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% beamerbasetoc.4ht                     |version %
% Copyright (C) |CopyYear.2006.       Eitan M. Gurari         %
|<TeX4ht copyright|>
   \def\beamer@sectionintoc#1#2#3#4#5{}
\Hinput{beamerbasetoc}
\endinput
>>>        \AddFile{9}{beamerbasetoc}

%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{beamerbasefont}
%%%%%%%%%%%%%%%%%%%%%%%%

\<beamerbasefont.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% beamerbasefont.4ht                    |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\expandafter\ifx \csname o:@mathrm:\endcsname\relax\else
   \HRestore\@mathrm
   \HRestore\@mathbf
   \HRestore\@mathsf
   \HRestore\@mathit
   \HRestore\@mathtt
\fi
\AtBeginDocument{%
\def\:tempd#1{%
   \def\:tempc{\choose:mfont {#1}}
   \expandafter\HLet\csname @#1\endcsname|=\:tempc
}
\:tempd{mathbf}
\:tempd{mathrm}
\:tempd{mathsf}
\:tempd{mathit}
\:tempd{mathtt}
}
\Hinput{beamerbasefont}
\endinput
>>>        \AddFile{9}{beamerbasefont}

%%%%%%%%%%%%%%%%%%%%%%%
\Section{seminar.cls}
%%%%%%%%%%%%%%%%%%%%%%%

\<seminar.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% seminar.4ht                           |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\let\seminar:Hinput=\Hinput
\def\Hinput#1{%
   \seminar:Hinput{#1}%
   \def\:temp{#1}\def\:tempa{article}\ifx \:temp\:tempa
      \let\Hinput=\seminar:Hinput
      \input seminar-a.4ht
   \fi
}
\endinput
>>>        \AddFile{9}{seminar}

The seminar class loads the article class, and then its own definitions.

\<seminar-a.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% seminar-a.4ht                         |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<seminar code|>
\Hinput{seminar}
\endinput
>>>        \AddFile{9}{seminar-a}

\<seminar code\><<<
\def\begin@slide[#1,#2]{\begingroup
   \slide@clearpage   \slidetrue \leavevmode   \refstepcounter{slide}%
   \the\slide@hook   \the\before@newslide
   \everyslide}
\def\end@slide{\endgroup}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{slides.cls}
%%%%%%%%%%%%%%%%%%%%%%%%

\<slides.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% slides.4ht                            |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<conf slides|>
\Hinput{slides}
\endinput
>>>        \AddFile{9}{slides}

\<conf slides\><<<
\def\btn:s{%
   \advance\c@slide by -1   
   \edef\prevCutAt{\RefFile{\jobname-sl\the\c@slide.\:html}}%
   \ifx\prevCutAt\space \let\prevCutAt=\empty \fi
   \advance\c@slide by 2   
   \edef\nextCutAt{\RefFile{\jobname-sl\the\c@slide.\:html}}%
   \ifx\nextCutAt\space \let\nextCutAt=\empty \fi
}
\append:def\slide{\expandafter\ifx  \csname slide:\endcsname\relax \else
    \NextFile{\jobname-sl\the\c@slide .\:html}%
    \HPage{\a:slidename}%
     \bgroup\btn:s \default:bts{}{tail}%
      \egroup
   \fi}
\pend:def\endslide{\expandafter\ifx  \csname slide:\endcsname\relax \else
  \bgroup \btn:s
     \pend:def\b:crsbt{\Link-{}{tail\FileName}\EndLink}%
     \default:bts{tail}{}%
   \egroup\EndHPage{}\fi}
\NewConfigure{slidename}{1}
\Configure{slidename}{\the\c@slide}
>>>

\<conf slides\><<<
\pend:def\maketitle{\bgroup
   |<adjust minipageNum for setcounter footnote 0|>%
   \pend:def\@title{\a:ttl}\append:def\@title{\b:ttl}%
   \pend:def\@date{\a:date}\append:def\@date{\b:date}%
   \pend:def\@author{\a:author}\append:def\@author{\b:author}%
   \a:mktl }
\append:def\maketitle{\b:mktl \egroup }
\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
   \c:def\a:ttl{#3}\c:def\b:ttl{#4}}
\NewConfigure{author date}[4]{%
   \c:def\a:author{#1}\c:def\b:author{#2}%
   \c:def\a:date{#3}\c:def\b:date{#4}}
>>>

\<conf slides\><<<
\long\def\:tempc{\@roman \c@enumiii}
\ifx \theenumiii\:tempc
   \def\:tempc{\a:enumiii\@roman\c@enumiii\b:enumiii}
   \HLet\theenumiii\:tempc
\fi
\NewConfigure{enumiii}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{foils.cls}
%%%%%%%%%%%%%%%%%%%%%

\<foils.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% foils.4ht                             |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\ifx \o:listoffigures:\:UnDef \else
   \HRestore\listoffigures
\fi
\ifx \o:listoftables:\:UnDef \else
   \HRestore\listoftables
\fi
|<foils configs|>
\Hinput{foils}
\endinput
>>>        \AddFile{9}{foils}

 
\<foils configs\><<<
\pend:def\maketitle{\par\a:mktl\begingroup 
   \ifx \@thanks\empty \else
      \pend:def\@thanks{\a:thank}% 
      \append:def\@thanks{\b:thank}% 
   \fi
   \aftergroup\b:mktl \:gobbleII
}
\def\@maketitle{%
   {\a:ttl \@title \b:ttl} 
   {\lineskip \authorauthorskip 
    \begin{tabular}[t]{c}\a:author \@author \b:author\end{tabular} 
    \par
   } 
   \ifx \@date\empty \else
      \a:date \@date \b:date
   \fi
   \par
} 
\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
   \c:def\a:ttl{#3}\c:def\b:ttl{#4}}
\NewConfigure{author date}[4]{%
   \c:def\a:author{#1}\c:def\b:author{#2}%
   \c:def\a:date{#3}\c:def\b:date{#4}}
>>>

\<is not foils.cls\><<<
\@ifclassloaded{foils}{\:Optionfalse}{}
>>>>

\<foils configs\><<<
\NewSection\foilhead{}
\let\:foilhead|=\@foilhead
\def\@foilhead[#1]#2{%
   \def\:temp{#2}\ifx\:temp\empty \:foilhead[#1]{\foilhead{\space}}%
   \else \:foilhead[#1]{\foilhead{#2}}\fi  }
\NewConfigure{tableofcontents*}[1]{\edef\auto:toc{#1}%
   \ifx \::foilhead\:UnDef
      \let\::foilhead|=\:foilhead
      \def\:foilhead{\:TableOfContents[\auto:toc]%
          \let\:foilhead|=\::foilhead \::foilhead}
   \fi
}
>>>

 

\<foils configs\><<<
\def\Str:pic{\ifx \EndPicture\:UnDef  \Picture*{}%
   \else \let\EndPicture\empty  \fi }
\let\:boldequation|=\boldequation
\def\boldequation{\Str:pic \:boldequation}
\append:def\endboldequation{\EndPicture}
\expand:after{\let\boldequation:|=}\csname boldequation*\endcsname
\expandafter\def\csname boldequation*\endcsname{\Str:pic \boldequation:}
\expandafter\append:def\csname endboldequation*\endcsname{\EndPicture}
% \let\:begintheorem|=\@begintheorem
% \def\@begintheorem#1#2{\:begintheorem{#1}{#2.}}
% \def\@opargbegintheorem#1#2#3{\:begintheorem{#1}{#2.\ [#3] }}
% \def\@beginstartheorem#1{\:begintheorem{#1.}}
% \def\@opargbeginstartheorem#1#2{\:begintheorem{#1.}{\ [#2] }}
% \long\def\@caption#1[#2]#3{\par \begingroup \@parboxrestore \normalsize
% \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
% \endgroup}
\def\end@nonfloat{\end@float}
>>>

\<foils configs\><<<
\def\:temp#1{{\stepcounter{footnote}%
%   \ifx \footnote\thanks
      \a:thank\@fnsymbol\c@footnote\b:thank
%   \fi
   \let\a:thanks\empty    \let\b:thanks\empty
   \protected@xdef\@thanks{\noexpand\a:thanks{\@thanks\c:thank
     \@fnsymbol\c@footnote\d:thank #1\e:thank}\noexpand\b:thanks}%
}}
\HLet\thanks|=\:temp
>>>

Do we need the following?

%%%%%%%%%%%%%%%%%%%%%%
\Section{slidesec.sty}
%%%%%%%%%%%%%%%%%%%%%%

\<slidesec.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% slidesec.4ht                          |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\def\listofslides{\begingroup
  \section*{List of Slides}%
  \def\l@slide##1##2##3{%
    \slide@undottedcline{\slidenumberline{##3}{##2}}{}}%
  \let\l@subslide\l@slide   \a:listofslides
  \:tableofcontents[slidesection,subslidesection]\b:listofslides
  \endgroup}
\NewConfigure{listofslides}{2} 
\def\slide@heading[#1]#2{%
  \stepcounter{slidesection}%
  \:los{slidesection}{#1}%
  \gdef\theslideheading{#1}%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else
    {\edef\@currentlabel{\csname
        p@slidesection\endcsname\theslidesection}%
      \makeslideheading{#2}}%
  \fi}

\def\slide@subheading[#1]#2{%
  \stepcounter{slidesection}%
  \:los{subheading}{#1}%
  \gdef\theslidesubheading{#1}%
  \def\@tempa{#2}%
  \ifx\@tempa\@empty\else
    {\edef\@currentlabel{\csname p@slidesubsection\endcsname
      \theslidesubsection}\makeslideheading{#2}}%
  \fi}

\def\:los#1#2{{\Link{#1-\expandafter\the\csname
     c@#1\endcsname}{#1\expandafter\the\csname
     c@#1\endcsname}\EndLink
\protect:wrtoc
   \edef\:temp{\the\:tokwrite{\string\doTocEntry
       \string\toc#1{\expandafter\the\csname c@#1\endcsname}{\string
      \csname\space a:TocLink\string\endcsname
   {\FileNumber}{#1\expandafter\the
    \csname c@#1\endcsname}{#1-\expandafter\the
    \csname c@#1\endcsname}{\ignorespaces #2}}{\the
    \c@slide}\relax}}\:temp
 }}

\Hinput{slidesec}
\endinput
>>>        \AddFile{9}{slidesec}

%%%%%%%%%%%%%%%%%%%%%%
\Section{texpower}
%%%%%%%%%%%%%%%%%%%%%%

\<texpower.4ht\><<<
% texpower.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2003. Eitan M. Gurari
|<TeX4ht copywrite|>
 |<undo texpower|>
\Hinput{texpower}
\endinput
>>>        \AddFile{9}{texpower}

\<undo texpower\><<<
\expandafter\def\csname\string\@stepwise@TP\endcsname[#1]{}
\def\step#1{#1}
\def\bstep#1{#1}
\def\restep#1{#1}
\let\switch=\empty
\let\pause=\empty
>>>

\<texpower configs\><<<
\def\pause{\a:pause}
\NewConfigure{pause}{1}
\Configure{pause}
   {\gHAdvance\ShipoutCount by 1
     \hbox{\HCode{<!--[(\ShipoutCount) pause PPPPPPPPPPPP-->}}}

\Configure{pause}{}

\HAssign\ShipoutCount=0

\ConfigureEnv{stepcapsule}
   {\hbox{\HCode{<!-- step, l. \the\inputlineno -->}}}
   {\hbox{\HCode{<!-- /step, l. \the\inputlineno-->}}}
   {}{}

\pend:def\insertfirstduplicate@TP{\a:tp}
\append:def\insertfirstduplicate@TP{\b:tp}

\NewConfigure{tp}{2}

\Configure{tp}
   {\hbox{\HCode{<!-- first, l. \the\inputlineno -->}}}
   {\hbox{\HCode{<!-- /first, l. \the\inputlineno-->}}}

\pend:def\insertsecondduplicate@TP{\a:tpp}
\append:def\insertsecondduplicate@TP{\b:tpp}

\NewConfigure{tpp}{2}

\Configure{tpp}
   {\hbox{\HCode{<!-- second, l. \the\inputlineno -->}}}
   {\hbox{\HCode{<!-- /second, l. \the\inputlineno -->}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\:CheckOption{1} \if:Option
  \let\slide=\slide:
  \pend:def\slide{\let\slide:\:UnDef}
  \Configure{AtShipout}
   {\ifnum\ShipoutCount>0 
       \NextFile{\jobname-sl\ShipoutCount.\:html}%
       \HPage{\ShipoutCount}%
    \fi
   }
   {\ifnum\ShipoutCount>0 \rightline{%
         \ifnum \ShipoutCount>1
         \bgroup
             \HAdvance\ShipoutCount by -1
             [\Link[\jobname-sl\ShipoutCount.\:html]{}{}prev\EndLink]
         \egroup
         \fi
         \ShipoutCount{}
         \ifnum \ShipoutCount<0\LikeRef{LastShipout}%
         \bgroup
             \HAdvance\ShipoutCount by 1
             [\Link[\jobname-sl\ShipoutCount.\:html]{}{}next\EndLink]
         \egroup
         \fi
       }\EndHPage{}%
    \fi
   }
\else
  \Configure{AtShipout}
     {\ifnum\ShipoutCount>0 \HCode{<!--[\ShipoutCount]-->}\fi }
     {\ifnum\ShipoutCount>0 \HCode{<!--[/\ShipoutCount]--><hr />}\fi}
\fi
\ConfigureEnv{slide}
   {\ifvmode \IgnorePar\fi \EndP}
   {\ifvmode \IgnorePar\fi \EndP}
   {}{}
\Configure{stepwise}
   {}
   {\IgnorePar\par\leavevmode\EndP}
\Configure{@/BODY}
   {\relax \ifnum \FileNumber=1 
      \Tag{LastShipout}{\ShipoutCount}%
      \gHAssign\ShipoutCount=-2 
    \fi}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>>

\<texpower configs\><<<
\pend:def\at@shipout@once@TP{\aftergroup\:AtShipout}
\def\:AtShipout#1\vtop#2{#1\vtop{\hbox{%
  \Configure{HtmlPar}{}{}{}{}%
  \a:AtShipout
     \box \@cclv
  \b:AtShipout
  \gHAdvance\ShipoutCount by 1
  \global\def\at@shipout@once@TP{\aftergroup\:AtShipout}}}}

\NewConfigure{AtShipout}{2}

\HAssign\ShipoutCount=0
\expandafter\let \expandafter \:stepwise@TP
                      \csname \string\@stepwise@TP\endcsname
\expandafter\long\expandafter\def\csname \string\@stepwise@TP\endcsname
       [#1]#2{\:stepwise@TP[#1]{\a:stepwise#2\b:stepwise}}

\NewConfigure{stepwise}{2}

\pend:def\pause{\ifvmode\IgnorePar\fi \EndP}
\append:def\pause{\par\ShowPar}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Drawing Utilities and Colors}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%
\Section{xy.sty}
%%%%%%%%%%%%%%%%

\<xy.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% xy.4ht                                |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\pend:def\xy{\a:xypic}
\append:def\endxy{\b:xypic}
\NewConfigure{xypic}{2}
|<sup/sub in xypic|>
\expandafter\ifx \csname xyv2version\endcsname\relax\else 
   |<config xyv2|>
\fi
\Hinput{xy}
\endinput
>>>        \AddFile{9}{xy}

xypic assum catcodes of 7 and 8 for sup and sub.

\<sup/sub in xypic\><<<
\def\:tempa#1#2{%
   \def\:tempc##1{%
     \def\:temp{%
       \ifx #1\next \let\next|=^%
                    \def\:temp########1{##1^}%
       \else
          \ifx #2\next \let\next|=_%
                       \def\:temp########1{##1_}%
          \else  \let\:temp|=##1\fi
       \fi
       \:temp}\futurelet\next\:temp}%
   }
\:CheckOption{no^} \if:Option   \else
   \:CheckOption{^13} \if:Option   \catcode`\^|=13
                      \else        \catcode`\^|=12 \fi
\fi
\:CheckOption{no_} \if:Option   \else
   \:CheckOption{_13} \if:Option   \catcode`\_|=13
                      \else        \catcode`\_|=12 \fi
\fi
\:tempa^_
\catcode`\^|=7
\catcode`\_|=8
\HLet\xyFN@\:tempc
>>>

\<config xyv2\><<<
\let\xy:diagram|=\diagram
\def\diagram{\a:diagram \xy:diag}
\def\xy:diag#1\enddiagram{\xy:diagram#1\enddiagram\b:diagram}
\NewConfigure{diagram}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{xyling.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\<add to usepackage\><<<
\Configure{PackageHooks}{xyling.sty}{xyling-hooks.4ht}
>>>


\<xyling-hooks.4ht\><<<
% xyling-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
|<Xyling save Link|>
\:AtEndOfPackage{%
|<Xyling restore Link|>
}
\endinput
>>> \AddFile{9}{xyling-hooks}

Xyling defines its own version of the \Verb+\Link+ command,
which breaks lot of things in TeX4ht. We must suppress this
version and use it only inside Xyling diagrams.

\<Xyling save Link\><<<
\let\orix:xylingLink\Link
\let\Link\relax
>>>

\<Xyling restore Link\><<<
  \let\xyling:Link\Link
  \let\Link\orig:xylingLink
>>>

\<xyling.4ht\><<<
% xyling.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
|<patch Xyling Tree|>
\Hinput{xyling}
\endinput
>>> \AddFile{9}{xyling}

Restore the Link command inside Xyling graph drawing commands

\<patch Xyling Tree\><<<
\newcommand\xyling:Tree[2][0]{\bgroup\let\Link\xyling:Link\o:Tree:[#1]{#2}\egroup}
\newcommand\xyling:Treek[3][0]{\bgroup\let\Link\xyling:Link\o:Treek:[#1]{#2}{#3}\egroup}
\HLet\Tree\xyling:Tree
\HLet\Treek\xyling:Treek
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{PicTeX}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

In pict.sty

PicTex offers the following definitions
\`'\def\beginpicture{\setbox\!picbox=\hbox\bgroup....}
\def\endpicture{...  \egroup....}',  and it allows nested pictures.

\<pictex.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% pictex.4ht                            |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

   \let\:beginpicture|=\beginpicture
   \let\:endpicture|=\endpicture
   \def\beginpicture{%
      \ifx \EndPicture\:UnDef
          \a:pictex   \expandafter\Picture\c:pictex{}%
          \def\endpicture{\:endpicture \EndPicture\b:pictex}%
      \fi\:beginpicture \def\beginpicture{\let\endpicture|=\:endpicture
                                          \:beginpicture}}
   \NewConfigure{pictex}{3}
   \Hinput{pictex}

\endinput
>>>        \AddFile{9}{pictex}

\Section{Diagrams.tex}

By
\Link[http://www.dcs.qmw.ac.uk/\string
~pt/diagrams/index.html]{}{}Paul  Taylor \EndLink

\<diagrams.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% diagrams.4ht                          |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\pend:def\CD@bC{\ifincommdiag\else \expandafter\a:diagram \fi}
\append:def\CD@ED{\b:diagram}
\NewConfigure{diagram}{2}
   \Hinput{diagrams}
\endinput
>>>        \AddFile{9}{diagrams}

%%%%%%%%%%%%%%%%%%%%
\Section{PsTricks}
%%%%%%%%%%%%%%%%%%%%

\<pstricks.4ht\><<<
% pstricks.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht license text|>
|<pstricks pspicture|>
|<rput pspicture|>
|<pstricks configs|>
\ifx\psset@linecap\:UnDef
   |<pre 2006 pstricks|>
\else
   |<shared 2006/2008 pstricks|>
   \ifx \pst@LaTeX@Setup\:UnDef
      |<since 2008 pstricks|>
   \else
      |<since 2006 pstricks|>
   \fi
\fi
\Hinput{pstricks}
\endinput
>>>        \AddFile{9}{pstricks}

\<pst-all.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% pst-all.4ht                          |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{pst-all}
\endinput
>>>        \AddFile{9}{pst-all}

\<pstricks configs\><<<
\pend:def\psframebox@ii{\a:pspicture}
\append:def\psframebox@ii{\b:pspicture}
>>>

\<\><<<
\long\def\:tempc#1#2{% 
  \Picture+{}%
    \edef\pst@mathflag{% 
       \ifpsmathbox\ifmmode\ifinner 1\else 2\fi\else \z@\fi\else \z@\fi}% 
    \setbox\pst@hbox=\hbox{% 
         \ifcase\pst@mathflag\or$\m@th\textstyle\or$\m@th\displaystyle\fi 
         {\pst@thisbox\the\everypsbox#2}% 
         \ifnum\pst@mathflag>\z@$\fi}% 
   #1\EndPicture} 
\HLet\pst@makenotverbbox\:tempc
>>>

\<pstricks pspicture\><<<
\pend:def\pst@picture{\global\let\pst:EndPicture\EndPicture
    \let\EndPicture=\empty}
\expand:after{\let\fi@star|=}\csname fi\endcsname
\NewConfigure{pspicture}{2}
\HAssign\ps:level=0
>>>

\<pre 2006 pstricks\><<<
\def\endpspicture{%
\pst@killglue
\endgroup
\egroup
\ifdim\wd\pst@hbox=\z@\else   
   \:warning{Hidden \string\@pstrickserr
        {Extraneous space in the pspicture environment}}%
\fi
\ht\pst@hbox=\pst@dimd
\dp\pst@hbox=-\pst@dimb
\setbox\pst@hbox=\hbox{%
\kern-\pst@dima
\ifx\pst@tempa\@undefined\else
\advance\pst@dimd-\pst@dimb
\pst@dimd=\pst@tempa\pst@dimd
\advance\pst@dimd\pst@dimb
\lower\pst@dimd
\fi
\box\pst@hbox
\kern\pst@dimc}%
\if@star\setbox\pst@hbox=\hbox{\clipbox@@\z@}\fi@star
|<pspicture img|>%
\endgroup}
>>>

\<since 2006 pstricks\><<<
\def\endpspicture{% 
  \pst@killglue 
  \global\pst@shift=\psk@shift% in fact of the following endgroup 
  \endgroup 
  \egroup 
  \ifdim\wd\pst@hbox=\z@\else 
     \:warning{Hidden \string\@pstrickserr
        {Extraneous space in the pspicture environment}}%
  \fi 
  \ht\pst@hbox=\pst@dimd 
  \dp\pst@hbox=-\pst@dimb 
  \setbox\pst@hbox=\hbox{% 
    \kern-\pst@dima 
    \pst@dimd-\pst@shift 
    \advance\pst@dimd\pst@dimb 
    \lower\pst@dimd% 
    \box\pst@hbox% 
    \kern\pst@dimc}% 
  \if@star\setbox\pst@hbox=\hbox{\clipbox@@\z@}\fi@star
  |<pspicture img|>%
  \endgroup% 
  \global\psk@shift\z@% restore value 
} 
>>>

\<since 2008 pstricks\><<<
\def\endpspicture{% 
  \pst@killglue 
%  \global\pst@shift=\psk@shift% in fact of the following endgroup 
  \endgroup 
  \egroup 
  \ifdim\wd\pst@hbox=\z@\else 
     \:warning{Hidden \string\@pstrickserr
        {Extraneous space in the pspicture environment}}%
  \fi 
  \ht\pst@hbox=\pst@dimd 
  \dp\pst@hbox=-\pst@dimb 
  \setbox\pst@hbox=\hbox{% 
    \kern-\pst@dima 
    \pst@dimd-\pst@shift 
    \advance\pst@dimd\pst@dimb 
    \lower\pst@dimd% 
    \box\pst@hbox% 
    \kern\pst@dimc}% 
  \if@star\setbox\pst@hbox=\hbox{\clipbox@@\z@}\fi@star
  |<pspicture img|>%
  \endgroup% 
  \psset@shift{0}% reset value 
%  \global\psk@shift\z@% restore value 
} 
>>>

\<pspicture img\><<<
\ifnum \ps:level=0
   \let\EndPicture\pst:EndPicture
   \global\let\pst:EndPicture=\:UnDef
   \a:pspicture\box\pst@hbox\b:pspicture 
\else
   \xdef\pspicture:dim{\the\wd\pst@hbox,
         \the\ht\pst@hbox, \the\ht\pst@hbox}%
   \box\pst@hbox
\fi
>>>

\<rput pspicture\><<<
\def\rput@iv(#1){\pst@killglue \gHAdvance\ps:level by 1
     \pst@makebox{\gHAdvance\ps:level by -1 \rput@v{#1}}} 
\def\rput@v#1{\begingroup
   \use@par
   \if@star\pst@starbox\fi
   \pst@makesmall\pst@hbox
   \pst@rotate\psk@rot\pst@hbox 
   \ifnum \ps:level=0
      \expandafter\ifx \csname pspicture:dim\endcsname\relax
         \ht:everypar{}\psput@{#1}\pst@hbox 
      \else
         |<rput fix|>%
      \fi
   \else
      \psput@{#1}\pst@hbox 
   \fi
\endgroup \ignorespaces}
>>>

A search on \`'\psput@{#1}\pst@hbox' show a few other locations
needing a similar code: \''\Rput', \''\uput', and \''\cput'.
When it is coming to paragraph breaks, they are all problematic
(because they move text around?).

\<rput fix\><<<
\def\psput@cartesian##1{%
   \hbox to \pst@dimg{{\vbox to \pst@dimh{\vss\box##1}\hss}}}%
\global\let\pspicture:dim=\:UnDef
\let\sv:leavevmode=\leavevmode
\def\leavevmode{%
   \let\leavevmode=\sv:leavevmode    
   |<rput warning|>%
   \let\EndPicture\pst:EndPicture
   \global\let\pst:EndPicture=\:UnDef
   \a:pspicture \leavevmode}%
\psput@{#1}\pst@hbox\b:pspicture
>>>

\<rput warningNO\><<<
\ifdim \pst@dimg<2pt  
   \:warning{pspicture might fail within \noexpand\rput 
        (width=\the\pst@dimg\space height=\the\pst@dimh)}%
\else \ifdim \pst@dimh<2pt
   \:warning{pspicture might fail within \noexpand\rput 
        (width=\the\pst@dimg\space height=\the\pst@dimh)}%
\fi\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{epsf.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%

\<epsf.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% epsf.4ht                              |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

 |<epsf.sty|>
\Hinput{epsf}
\endinput
>>>        \AddFile{7}{epsf}

\<epsf.sty\><<<
   |<fix epsf|>
>>>

\<fix epsf\><<<
\def\:tempc#1{\def\PicName{#1}\a:epsfsetgraph
   \o:epsfsetgraph:{#1}\b:epsfsetgraph}
\HLet\epsfsetgraph=\:tempc
\NewConfigure{epsfsetgraph}{2}
>>>

%%%%%%%%%%%%%%%%
\Section{psfig.sty}
%%%%%%%%%%%%%%%%%

\<psfig.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% psfig.4ht                             |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<verify /psfig is from psfig.sty|>

\NewConfigure{psfig}{2}
\def\:temp#1{{\a:psfig\o:psfig:{#1}\b:psfig}}
\HLet\psfig|=\:temp
\Hinput{psfig}
\endinput
>>>        \AddFile{7}{psfig}

\<verify /psfig is from psfig.sty\><<<
\def\:temp#1{\vbox { \ps@init@parms \parse@ps@parms {#1} \compute@sizes \ifnum
\@p@scost <\@psdraft { \PsfigSpecials \vbox to \@p@srheight sp{ \hbox
to \@p@srwidth sp{ \hss } \vss } }\else { \if@draftbox { \hbox {\fbox
{\vbox to \@p@srheight sp{ \vss \hbox to \@p@srwidth sp{ \hss \hss }
\vss }}} }\else { \vbox to \@p@srheight sp{ \vss \hbox to \@p@srwidth
sp{\hss } \vss } }\fi \par \par \par }\fi }}

\ifx \psfig\:temp\else \expandafter\endinput \fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{epsfig.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/graphics/epsfig.sty]{}{}%
epsfig.sty\EndLink.

\<epsfig.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% epsfig.4ht                            |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\NewConfigure{epsfig}{2}
\def\:temp#1{{\a:epsfig\o:epsfig:{#1}\b:epsfig}}
\HLet\epsfig|=\:temp
\Hinput{epsfig}
\endinput
>>>        \AddFile{7}{epsfig}

Redefines \Verb+\psfig+ in terms of \Verb+\includegraphics+ of graphicx.

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{graphics.sty}
%%%%%%%%%%%%%%%%%%%%%%%

\Link[/n/ship/0/packages/tetex/teTeX/texmf/tex/latex/graphics/graphics.sty]{}{}%
graphics.sty\EndLink.

\<graphics.4ht\><<<
% graphics.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>

   |<fix graphics|>
\Hinput{graphics}
\endinput
>>>        \AddFile{4}{graphics}

\<fix graphics\><<<
\expandafter\let\csname includegraphics \endcsname\includegraphics
\def\includegraphics{\expandafter\protect\csname includegraphics \endcsname}
>>>

[\HPage{example}
\Verbatim
\documentclass{article} 
\usepackage{graphicx} 
 
\begin{document} 
 
\begin{titlepage} 
 
\title{\includegraphics[width=7cm]{triangle.eps}\\ 
 xxxx 
\footnote{xxxx}} 
\date{xxxx-yy-zz} 
\author{xxxx yyyy\thanks{Debian Project Official Developer}}  
\maketitle 
 
\end{titlepage} 
 
 
\end{document} 
\EndVerbatim
\EndHPage{}]

\<fix graphics\><<<
\def\grf:removequote"#1"{#1}
\def\grf:thrashname#1\relax{}
\def\grf:fixquotes{%
    \@ifnextchar"{\edef\Gin@base{\expandafter\grf:removequote\Gin@base}\grf:thrashname}{\grf:thrashname}}
\def\grp:warning#1{\no:bound#1(no BoundingBox)//\:warning{#1}}
\def\no:bound#1(no BoundingBox)#2//{\gdef\noBoundingBox{#2}\ifx
   \noBoundingBox\empty \global\let\noBoundingBox\:UnDef\fi}
\let\:tempc|=\Gin@setfile
\pend:defIII\:tempc{\a:graphics
    \global\let\noBoundingBox\:UnDef
    \let\@latex@error|=\grp:warning \let\@ehc|=\empty}
\append:defIII\:tempc{\b:graphics\grf:gobble\leavevmode grf:gobble}
\HLet\Gin@setfile|=\:tempc
\NewConfigure{graphics*}[2]{%
   \expandafter\ifx \csname :.#1\endcsname\relax
      \pend:defIII\n:Gin@setfile:{\csname :.#1\endcsname}%
   \fi
   \def\:temp{#2}\ifx \:temp\empty
     \expandafter\let\csname :.#1\endcsname\:UnDef
   \else
     \expandafter\def\csname :.#1\endcsname{\edef\:temp{\detokenize{.#1}}%
        \ifx \:temp\Gin@ext  \let\a:graphics|=\relax
           \def\G:cnfg{#2}\expandafter\grf:gobble \fi}%
   \fi }
\NewConfigure{graphics}{2}
\def\grf:gobble#1\leavevmode#2grf:gobble{%
   \PictureOff\expandafter\grf:fixquotes\Gin@base\relax#1\PictureOn \G:cnfg \let\G:cnfg|=\relax}
\let\G:cnfg|=\relax

\let\old:GreadEps\Gread@eps
\def\Gread@eps#1{\old:GreadEps{"#1"}}
>>>

Show dimensions only for pictures that have dimensions specified explicitly or using the .xbb file

\<fix graphics\><<<
\def\if:boundingbox#1#2{\ifdim\Gin@req@width=\Gin@nat@width\ifx\noBoundingBox\UnDefined#1\else#2\fi\else#1\fi}
>>>

We need to find bounding boxes of images. Graphics support the .xbb file that contain this information.
It is necessary to provide the DeclareGraphicsRule commands for supported image formats so 
the .xbb file works. We execute these rules only with the default dvips driver. If user selects explicitly
other drivers, it would result in a compilation error. 


\<fix graphics\><<<
\def\Gin:defaultdriver{dvips.def}
\ifx\Gin@driver\Gin:defaultdriver%
\DeclareGraphicsRule{.png}{bmp}{.xbb}{}
\DeclareGraphicsRule{.jpg}{bmp}{.xbb}{}
\DeclareGraphicsRule{.jpeg}{bmp}{.xbb}{}
\DeclareGraphicsRule{.gif}{bmp}{.xbb}{}
\DeclareGraphicsRule{.pdf}{bmp}{.xbb}{}
\DeclareGraphicsRule{.svg}{bmp}{.xbb}{}
\fi
>>>

%\expandafter\def\csname c:graphics-file:\endcsname#1{\Gin@drafttrue
%   \def\Gin@setfile##1##2##3{%
%     \def\:temp####1####2{#1}\:temp{##3}{\Gin@base}}}
%\pend:defI\Ginclude@graphics{\a:graphics}
% \append:defI\Ginclude@graphics{\b:graphics}

For figures of specific exytensions, we can tailor a configuration
with the command
\`'\Configure{graphics*}{extension}{action}'.  For the other figures,
we can use the configuration
\`'\Configure{graphics}{before}{aafter}'.  

\Verbatim
\Configure{epsfig}
  {\Configure{graphics*}
    {eps}
    {\Needs{"eps22jpg ####1 ####2"}%
     \Needs{File:           ####2}%
     \def\temp{[####2]}%
     \Picture       [\temp]{####2}}}
 {}
\EndVerbatim

Newer version

\Verbatim

\Configure{graphics*}
    {eps}
    { \Needs{"convert -crop 0x0 -density 110x110 -transparent
                '\#FFFFFF' ##3 \csname Gin@base\endcsname.gif"}
      \Picture[pict]{\csname Gin@base\endcsname.gif}
    }

\Configure{graphics*}
    {gif}
    {\Picture[pict]{\csname Gin@base\endcsname.gif}}

\EndVerbatim

For xml

\Verbatim
\def\Ginclude@graphics#1{\Tg<includegraphics file="#1"/>}
\def\Gin@setfile#1#2#3{%
  \ifx\\#2\\\Gread@false\fi
  \ifGin@bbox\else
    \ifGread@
      \csname Gread@%
         \expandafter\ifx\csname Gread@#1\endcsname\relax
           eps%
         \else
           #1%
         \fi
      \endcsname{\Gin@base#2}%
    \else
      \Gin@nosize{#3}%
    \fi
  \fi
  \Gin@viewport@code
  \Gin@nat@height\Gin@ury bp%
  \advance\Gin@nat@height-\Gin@lly bp%
  \Gin@nat@width\Gin@urx bp%
  \advance\Gin@nat@width-\Gin@llx bp%
  \Gin@req@sizes
  \Tg<includegraphics file="#3" width="\the\Gin@req@width"
        height="\the\Gin@req@height"/>
}

\EndVerbatim


Fix for XeTeX graphics - PDF inclusion doesn't work with the default driver, 
dvips needs to be used instead

\<add to usepackage\><<<
\Configure{PackageHooks}{graphics.sty}{graphics-hooks.4ht}
>>>

\<graphics-hooks.4ht\><<<
% graphics-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020-2022 TeX Users Group
|<TeX4ht license text|>
\ifdefined\XeTeXversion
  \PassOptionsToPackage{dvips}{graphics}
\fi
|<disable early sup|>
>>> \AddFile{9}{graphics-hooks}

The \Verb|early^| option can break some packages that changes catcode of 
circumflex too. We need to revert to the original definition for the package
processing, and then return to the TeX4ht definition after the package 
is processed.

\<disable early sup\><<<
\ifdefined\recall:sup
\recall:sup
\:AtEndOfPackage{
  \early:sup
}
\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{graphicx}
%%%%%%%%%%%%%%%%%%%%%%%

\<graphicx.4ht\><<<
% graphicx.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2003. Eitan M. Gurari
|<TeX4ht copywrite|>
   |<fix graphicx|>
\Hinput{graphicx}
\endinput
>>>        \AddFile{4}{graphicx}

\<fix graphicx\><<<
\let\Gin:esetsize\Gin@esetsize
\def\Gin@esetsize{%
   \ifx \Gin@ewidth\Gin@exclamation
      \let\Gin:ewidth\Gin@ewidth
   \else
      \setlength\tmp:dim\Gin@ewidth
      \edef\Gin:ewidth{\the\tmp:dim}%
   \fi
   \ifx \Gin@eheight\Gin@exclamation
      \let\Gin:eheight\Gin@eheight
   \else
      \setlength\tmp:dim\Gin@eheight
      \edef\Gin:eheight{\the\tmp:dim}%
   \fi
   \Gin:esetsize
}

\NewConfigure{rotatebox}{2}
\pend:def\Grot@box{\a:rotatebox}
\append:def\Grot@box{\b:rotatebox}

>>>

Support for the alt key of \Verb!\includegraphics! command.

\<fix graphicx\><<<
\NewConfigure{GraphicsAlt}{1}
\define@key{Gin}{alt}{\Configure{GraphicsAlt}{#1}}
>>>

The calc package redefined \`'\setlength' to allow expressions of the
form `\Verb!width=.625\textwidth+5mm!'.  The macros \`'Gin@ewidth' and
\`'Gin@eheight' allow such values.  Hence, for such macros, we should
use  instructions like \`'\setlength\tmp:dim\Gin@ewidth'  instead of 
\`'\tmp:dim=\Gin@ewidth'.


%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{graphbox}
%%%%%%%%%%%%%%%%%%%%%%%

Graphbox redefines \`'\Gin@setfile'  to make some manipulations with the
graphics box. We want to revert it, because it fatally breaks TeX4ht, and 
it isn't useful in XML anyway.

\<add to usepackage\><<<
\Configure{PackageHooks}{graphbox.sty}{graphbox-hooks.4ht}
>>>

\<graphbox-hooks.4ht\><<<
% graphbox-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
\:AtEndOfPackage{%
  \let\Gin@setfile\old@box@Gin@setfile
}
>>> \AddFile{9}{graphbox-hooks}

%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{pdfpages}
\<pdfpages.4ht\><<<
% pdfpages.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
|<pdfpages configurations|>
\Hinput{pdfpages} 
\endinput
>>> \AddFile{9}{pdfpages}

TeX4ht supports inclusion of PDF thanks to Graphicx package, we just need 
to make it compatible with Pdfpages.

\<pdfpages configurations\><<<
\define@key{Gin}{page}[]{\edef\Gin@page{#1}}

\def\AM@findfile#1{%
  \AM@findfile@i{#1}{pdf}%
  \AM@findfile@ii{#1}%
}
\catcode`\:=12
\renewcommand\AM@output[1]{%
  \@for\@pages:=\AM@pagestemp\do{\includegraphics[page=\@pages]{\AM@currentdocname}}
}
\catcode`\:=11
>>>


%%%%%%%%%%%%%%%%%%%%%%%
\Section{svg}
%%%%%%%%%%%%%%%%%%%%%%%

\<svg.4ht\><<<
% svg.4ht (|version), generated from |jobname.tex
% Copyright 2018-2021 TeX Users Group
|<TeX4ht license text|>
|<svg config|>
\Hinput{svg}
\endinput
>>>  \AddFile{9}{svg}

\<svg config\><<<
\renewcommand\includesvg[2][]{%
  % get file name with \svgpath support
  \svg@get@path{#2}{}%
  % set keys
  \svg@local@param@set{#1}%
  \if@svg@file@found%
    % convert supported parameters from \includesvg for use with \includegraphics
    \edef\svg@tempb{}
    \ifdim\svg@param@height>\z@\relax%
      \edef\svg@tempb{\svg@tempb,height=\svg@param@height}%
    \fi%
    \ifdim\svg@param@width>\z@\relax%
      \edef\svg@tempb{\svg@tempb,width=\svg@param@width}%
    \fi%
    \ifdim\dimexpr\svg@param@angle\p@\relax=\z@\relax\else%
      \edef\svg@tempb{%
        \svg@tempb,origin=\svg@param@origin,angle=\svg@param@angle%
      }%
    \fi%
    \expandafter\includegraphics\expandafter[\svg@tempb]{\svg@file@base.\svg@file@ext}
  \else
    \typeout{SVG file #1 cannot be found}
  \fi
}
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{endfloat}
%%%%%%%%%%%%%%%%%%%%%%%

\<endfloat.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% endfloat.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{endfloat}
\endinput
>>>        \AddFile{9}{endfloat}

%%%%%%%%%%%%%%%%
\Section{mfpic.sty}
%%%%%%%%%%%%%%%%

\<mfpic.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% mfpic.4ht                             |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<mfpic config|>
\Hinput{mfpic}
\endinput
>>>        \AddFile{9}{mfpic}

\<mfpic config\><<<
\expandafter \ifx\csname if@mfp@latexe\endcsname\relax
   |<non 2005 latex mpic|>
\fi
>>>

\<non 2005 latex mpic\><<<
\pend:def\mfpic{\a:mfpic}
\append:def\endmfpic{\b:mfpic}
\NewConfigure{mfpic}{2}
>>>

\''\opengraphsfile' is only used once in the LaTeX document. All
individual pictures generated by \''\mfpic... \endmfpic' go
into this single file.  Therefore \''\Picture+{} ... \EndPicture' should
be wrapped around \''\mfpic ...  \endmfpic',

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{pb-diagram.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<pb-diagram.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% pb-diagram.4ht                        |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{pb-diagram}
\endinput
>>>        \AddFile{9}{pb-diagram}

%%%%%%%%%%%%%%%%%%%
\Section{amscd.sty Commutative Diagrams (CD)}
%%%%%%%%%%%%%%%%%%%

\<amscd.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amscd.4ht                             |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config amscd|>
\Hinput{amscd}
\endinput
>>>        \AddFile{7}{amscd}

 
\<config amscd\><<<
                                    \catcode`\#13 \catcode`\!6  
\def\reg:CD{% 
  \CDat  
  \bgroup\relax\iffalse{\fi\let\ampersand@&\iffalse}\fi  
  \CD@true\vcenter\bgroup 
     \let\\\math@cr\restore@math@cr\default@tag  
\SaveMkHalignConf:g{CD}\HRestore\noalign  
   \MkHalign#{&$\m@th#$}% 
} 
                                    \catcode`\#=6 \catcode`\!=12  
\def\:tempc{\crcr 
  \EndMkHalign\RecallMkHalignConfig \b:CD \egroup\egroup  
}  
\HLet\endCD\:tempc 
\def\:temp{\pic:MkHalign{CD}}  
\HLet\CD\:temp 
\NewConfigure{CD}{6} 
>>>

\<config amscd\><<<
\def\:tempc#1>#2>{\ampersand@  
  \ifCD@ \global\bigaw@\minCDarrowwidth \else \global\bigaw@\minaw@ \fi  
  \setboxz@h{$\m@th\scriptstyle\;{#1}\;\;$}%  
  \ifdim\wdz@>\bigaw@\global\bigaw@\wdz@\fi  
  \@ifnotempty{#2}{\setbox\@ne\hbox{$\m@th\scriptstyle\;{#2}\;\;$}%  
    \ifdim\wd\@ne>\bigaw@\global\bigaw@\wd\@ne\fi}%  
  \ifCD@\enskip\fi  
  \csname a: @>\endcsname
  \mathrel {% 
      \mathop{\hbox to\bigaw@{\rightarrowfill@\displaystyle}}%  
      \if !#2!\limits\sp{#1}\else \limits\sp{#1}\sb{#2}\fi}% 
 \ifCD@\enskip\fi \ampersand@}   
\expandafter\HLet\csname\space @>\endcsname\:tempc
\NewConfigure{ @>}{1}
>>>

\<config amscd\><<<
\def\:tempc#1<#2<{\ampersand@ 
  \ifCD@ \global\bigaw@\minCDarrowwidth \else \global\bigaw@\minaw@ \fi 
  \setboxz@h{$\m@th\scriptstyle\;\;{#1}\;$}% 
  \ifdim\wdz@>\bigaw@ \global\bigaw@\wdz@ \fi 
  \@ifnotempty{#2}{\setbox\@ne\hbox{$\m@th\scriptstyle\;\;{#2}\;$}% 
    \ifdim\wd\@ne>\bigaw@ \global\bigaw@\wd\@ne \fi}% 
  \ifCD@\enskip\fi 
  \csname a: @<\endcsname
    \mathrel{\mathop{\hbox to\bigaw@{\leftarrowfill@\displaystyle}}% 
      \if !#2!\limits\sp{#1}\else \limits\sp{#1}\sb{#2}\fi}% 
  \ifCD@\enskip\fi \ampersand@} 
\expandafter\HLet\csname\space @<\endcsname\:tempc
\NewConfigure{ @<}{1}
>>>

\<config amscd\><<<
\def\:tempc#1V#2V{\CD@check{V..V..V}{%
  \csname a: @V\endcsname{#1}{#2}}%
  \llap{$\m@th\vcenter{\hbox 
  {$\scriptstyle#1$}}$}\Big\downarrow 
  \rlap{$\m@th\vcenter{\hbox{$\scriptstyle#2$}}$}%
  \csname b: @V\endcsname{#1}{#2}%
  &&}
\expandafter\HLet\csname\space @V\endcsname\:tempc
\NewConfigure{ @V}[2]{%
   \expandafter\def\csname a: @V\endcsname##1##2{#1}%
   \expandafter\def\csname b: @V\endcsname##1##2{#2}}
\Configure{ @V}{}{}
>>>


%%%%%%%%%%%%%%%%%%%%%%%
\Section{color.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%

Was \`'\def\color@setgroup{\begingroup \ht:special {color push
    \current@color }% \aftergroup \reset@color }' indirectly through
    \''\set@color'.  It caused an extra leading line for verbatim
    environments.  As a side comment, the \''\aftergroup' might cause
    an ordering problem, if html code is attached to it.

\<color.4ht\><<<
% color.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
\expandafter\ifx \csname color:def\endcsname\relax
    \let\color:def\def
\else  \expandafter\endinput\fi
\let\:temp|=\begingroup 
\HLet\color@setgroup|=\:temp
|<def HColor|>
\NewConfigure{color}{1}
\def\:tempc#1#2#3{\protect\leavevmode{\protect\a:textcolor
      \color#1{#2}#3\protect\b:textcolor}}
\HLet\@textcolor=\:tempc
\NewConfigure{textcolor}{2}
   |<fix color|>
|<boxes of color|>
\Hinput{color}
\endinput
>>>        \AddFile{7}{color}

\<def HColor\><<<
\def\HColor{\:warning{\string\Hcode{...}{...} is deprecated; Use 
   \string\Configure{HColor}{...}{...}}\Configure{HColor}}
\NewConfigure{HColor}[2]{\if !#1!|<internal HColor|>\else
   \expandafter\edef\csname CLR:#1\endcsname{#2}\fi}
>>>

\<\><<<
\def\:temp#1#2{%
   \let\a:fcol|=\empty   \let\b:fcol|=\empty
   \color@b@x\relax{\color#1{#2}}}
\HLet\color@box|=\:temp
\def\:temp#1#2#3{%
   \let\a:fcol|=\a:fcolorbox   \let\b:fcol|=\b:fcolorbox
   \color@b@x{\fboxsep\z@\color#1{#2}\fbox}{\color#1{#3}}}
\HLet\color@fbox|=\:temp
\long\def\:temp#1#2#3{%
   \def\:temp{#1}\def\:tempa{\relax}\ifx\:temp\:tempa\else\leavevmode\fi
   {\a:fcol #1{\ifcolors@ \a:colorbox\fi \leavevmode #2%
      {\set@color#3}\ifcolors@ \b:colorbox\fi}}\b:fcol}
\HLet\color@b@x|=\:temp
>>>

\<boxes of color\><<<
\long\def\:temp#1#2#3{%
   \ifcolors@ 
      \def\:temp{#1}\def\:tempa{\relax}\ifx\:temp\:tempa
      \a:colorbox \else \a:fcolorbox \fi
   \fi
   {#1{\leavevmode #2{\set@color#3}}}%
   \ifcolors@ 
      \def\:temp{#1}\def\:tempa{\relax}\ifx\:temp\:tempa
      \b:colorbox \else \b:fcolorbox \fi
   \fi
}
\HLet\color@b@x\:temp
\NewConfigure{colorbox}{2}
\NewConfigure{fcolorbox}{2}
>>>

\<fix color\><<<
\def\pagecolor{%
  \begingroup \a:pagecolor
      \let\ignorespaces\endgroup
      \let\set@color\set@page@color
      \color}
\NewConfigure{pagecolor}{1}
>>>

\<fix color\><<<
\def\:tempa[#1]#2{\a:color{#1 #2}\o:@undeclaredcolor:[#1]{#2}}
\HLet\@undeclaredcolor\:tempa
\pend:defI\@declaredcolor{\a:color{##1}}
>>>

\<fix color\><<<
\NewConfigure{SetHColor}[2]{{%
   \expandafter\let\expandafter\:temp \csname CLR:#2\endcsname
   \ifx \:temp\relax 
      \edef\:temp{#2 //}\expandafter\get:HColor\:temp
      \ifx \HColor\relax
          |<xcolor SetHColor|>%
      \fi
   \else             \let\HColor=\:temp \fi
   \ifx \HColor\relax
      \:warning{missing \string\Configure{HColor}{#2}{...} 
           (in LaTeX: \csname\string\color @#2\endcsname)}%
      \expandafter\global\expandafter\let\csname CLR:#2\endcsname|=\empty
    \else #1\fi }}
>>>

The first argument to SetHColor above is the XML code to be added for the
color, with the color itself referenced by \''\HColor'.  The second
argument is the same color name as provided to \''\color' of
color.sty.   That is, the configuration is employed in the following manner.

\Verbatim
   \Configure{SetHColor}
        {#1: XML code for color provided in \HColor}
        {#2: latex color name}
\EndVerbatim

The SetHColor typically is requsted indirectly in the following manner

\Verbatim
             \a:color{latex color name}
\EndVerbatim

Where \Verb=\a:color= is similar to.

\Verbatim
\Configure{color}
  {\Configure{SetHColor}
        {...XML code for color provided in \HColor...}%
  }
\EndVerbatim

The \Verb=\get:HColor= does the job of looking for XML color value,
and it assignes that value to \Verb=\HColor=.

\<fix color\><<<
\def\get:HColor#1 #2//{%
  \if\relax#2\relax
  % \expandafter\ifx \csname HColor:#1\endcsname\relax
     \let\HColor=\relax
     |<color from def|>%
  \else
     \csname HColor:#1\endcsname #2 //%
  \fi
}
\def\c:HColor:gray:{\def\HColor:gray##1 ##2//}
\Configure{HColor:gray}{\Configure{HColor}{}{}}
\def\c:HColor:rgb:{\def\HColor:rgb##1,##2,##3 ##4//}
\Configure{HColor:rgb}{\Configure{HColor}{}{}}
\def\c:HColor:cmyk:{\def\HColor:cmyk##1,##2,##3,##4 ##5//}
\Configure{HColor:cmyk}{\Configure{HColor}{}{}}
>>>

\<color from def\><<<
\expandafter\ifx \csname\string\color @#1\endcsname \relax\else 
   \expandafter\ifx \csname colortyp:\endcsname\relax \else
      \csname colortyp:\expandafter\expandafter\expandafter\endcsname
         \csname\string\color @#1\expandafter\endcsname
         \space . //%
\fi \fi
>>>

\<internal HColor\><<<
\if!#2!\let\HColor|=\relax \else \edef\HColor{#2}\fi
>>>

\<def HColor\><<<
\def\:temp#1#2#3{% 
  \@ifundefined{color@#2}% 
    {\c@lor@error{model `#2'}}% 
    {\@ifundefined{\string\color @#1}{}% 
      {\PackageInfo{color}{Redefining color #1}}% 
     \csname color@#2\expandafter\endcsname 
         \csname\string\color @#1\endcsname{#3}}}
\ifx \definecolor\:temp
   \pend:defIII\definecolor{%
     \expandafter\ifx\csname HColor:##2\endcsname\relax\else
        \csname HColor:##2\endcsname ##3 //%
        \edef\:temp{{HColor}{##1}{\HColor}}%
        \expandafter\Configure\:temp
     \fi}
\fi
>>>

The \Verb!\color{red}! instruction might be problematic since it does
not on its own determine the extent of the text to be colored.  As a
result, its effect can cross logical boundaries. That is against the
philosophy of markup languages in general and of XML in particular.

It is possible to implement the \Verb!\color{...}! feature but I'm not
sure it is desirable to do so.  I think it is preferable to expect
users to use commands of the form \Verb!\textcolor{red}{...}! for code
fragments.

%%%%%%%%%%%%%%%%%%%%%%%
\Section{xcolor.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%

\<xcolor.4ht\><<<
% xcolor.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2007. Eitan M. Gurari
|<TeX4ht copywrite|>
\input color.4ht
|<config xcolor|>
\Hinput{xcolor}
\endinput
>>>        \AddFile{7}{xcolor}

\<config xcolor\><<<
\def\rowc@l@rs[#1]#2#3#4% 
 {\global\rownum=\z@ 
  \global\@rowcolorstrue 
  \@ifxempty{#3}% 
    {\def\@oddrowcolor{\@norowcolor}}% 
    {\def\@oddrowcolor{\a:rowcolors{#3}%
                       \gdef\CT@row@color{\CT@color{#3}}}}% 
  \@ifxempty{#4}% 
    {\def\@evenrowcolor{\@norowcolor}}% 
    {\def\@evenrowcolor{\a:rowcolors{#4}%
                        \gdef\CT@row@color{\CT@color{#4}}}}% 
  \if@rowcmd 
    \def\@rowcolors 
     {#1\if@rowcolors 
        \o:noalign:{\relax\ifnum\rownum<#2\@norowcolor\else 
                 \ifodd\rownum\@oddrowcolor\else\@evenrowcolor\fi\fi}% 
      \fi}% 
  \else 
    \def\@rowcolors 
     {\if@rowcolors 
        \ifnum\rownum<#2\o:noalign:{\@norowcolor}\else 
        #1\o:noalign:{\ifodd\rownum\@oddrowcolor\else\@evenrowcolor\fi}\fi 
      \fi}% 
  \fi 
  \CT@everycr{\@rowc@lors\the\everycr}% 
  \ignorespaces} 
\NewConfigure{rowcolors}{1}
>>>

\<config xcolor\><<<
\def\@rowc@lors{\o:noalign:{\global\advance\rownum\@ne}\@rowcolors} 
\def\showrowcolors{\o:noalign:{\global\@rowcolorstrue}\@rowcolors} 
\def\hiderowcolors{\o:noalign:{\global\@rowcolorsfalse\@norowcolor}}
>>>

\<config xcolor\><<<
\def\:temp#1#2#3{{\set@color}}
\HLet\color@block\:temp
\def\:temp#1#2#3{}
\HLet\boxframe\:temp
>>>

% This isn't necessary anymore, it even could cause compilation errors
% \<config xcolor\><<<
% \let\XC:definec@lor\XC@definec@lor
% \def\XC@definec@lor[#1]#2[#3]#4#5{%
%    \expandafter\ifx\csname HColor!#2\endcsname\relax\else
%         \csname HColor!#4\endcsname #3!//%
%         \edef\:temp{{HColor}{#1}{\HColor}}%
%         \expandafter\Configure\:temp
%    \fi
%    \XC:definec@lor[#1]{#2}[#3]{#4}{#5}%
% }
% >>>

\<xcolor SetHColor\><<<
\expandafter\ifx \csname get!HColor\endcsname\relax \else
  \edef\:temp{#2!//}\expandafter\csname get!HColor\expandafter\endcsname\:temp
\fi
>>>

\<config xcolor\><<<
\def\strip:fin:excl#1!{#1} 
\expandafter\def\csname get!HColor\endcsname#1!#2//{%
  \def\current:color:name{#1\if!#2!\else!\strip:fin:excl#2\fi}%
  \if\relax#2\relax
  %\expandafter\ifx \csname HColor!#1\endcsname\relax
     \let\HColor=\relax
     |<xcolor from def|>%
  \else%
     \ifcsname HColor!#1\endcsname%
       \csname HColor!#1\endcsname #2//%
     \else
       \get:xcolorcss{#1!#2}{\HColor}%
       \Configure{HColor}{\current:color:name}{\HColor}%
     \fi%
  \fi
}
\expandafter\def\csname c:HColor!gray:\endcsname{%
     \expandafter\def\csname HColor!gray\endcsname##1!##2//}
\Configure{HColor!gray}{\Configure{HColor}{}{}}
\expandafter\def\csname c:HColor!rgb:\endcsname{%
     \expandafter\def\csname HColor!rgb\endcsname##1,##2,##3!##4//}
\Configure{HColor!rgb}{\Configure{HColor}{}{}}
\expandafter\def\csname c:HColor!cmyk:\endcsname{%
     \expandafter\def\csname HColor!cmyk\endcsname##1,##2,##3,##4!##5//}
\Configure{HColor!cmyk}{\Configure{HColor}{}{}}
>>>

\<xcolor from def\><<<
\expandafter\ifx \csname\string\color @#1\endcsname \relax\else 
   \expandafter\ifx \csname colortyp:\endcsname\relax \else
   \extractcolorspec{#1\if!#2!\else!\strip:fin:excl#2\fi}\tmp:color%
   \expandafter\convertcolorspec\tmp:color{HTML}\tmp:color% 
   \def\HColor{\#\tmp:color}%
   \Configure{HColor}{\current:color:name}{\HColor}%
      \csname colortyp:\expandafter\expandafter\expandafter\endcsname
         \csname\string\color @#1\expandafter\endcsname
         \space .!//%
\fi \fi
>>>

The following command can convert xcolor color specification to formusable
in CSS. The color is extracted to command which needs to b passed as a
second parameter.

\<config xcolor\><<<
\def\get:xcolorcss#1#2{%
   \expandafter\extractcolorspec\expandafter{#1}{\tsf:color}%
   \expandafter\convertcolorspec\tsf:color{HTML}\tsf:color%
   \edef#2{\#\tsf:color}%
}

>>>

This code comes from this \Link[https://tex.stackexchange.com/a/470290/2891]{}{}answer\EndLink.
See the comments for possible shortcommings.

\<config xcolor\><<<
\:CheckOption{color}\if:Option
\pend:defI\@declaredcolor{%
  \ifdefined\end:def:color\end:def:color\else\aftergroup\b:textcolor\fi
  \a:textcolor\def\end:def:color{\b:textcolor}%
}
\fi
>>>


We need to use dvips driver with XeLaTeX

\<add to usepackage\><<<
\Configure{PackageHooks}{xcolor.sty}{xcolor-hooks.4ht}
>>>

\<xcolor-hooks.4ht\><<<
% xcolor-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
\ifdefined\XeTeXversion
  \PassOptionsToPackage{dvips}{xcolor}
\fi
>>> \AddFile{9}{xcolor-hooks}

%%%%%%%%%%%%%%%%%%%%%%%
\Section{framed}
%%%%%%%%%%%%%%%%%%%%%%%

\<framed.4ht\><<<
% framed.4ht (|version), generated from |jobname.tex
% Copyright 2017 TeX Users Group
|<TeX4ht license text|>
\NewConfigure{makeframed}{2}
\def\MakeFramed#1{\a:makeframed}
\def\endMakeFramed{\b:makeframed}
\Hinput{framed}

>>> \AddFile{9}{framed}


%%%%%%%%%%%%%%%%%%%%%%%
\Section{mdframed}
%%%%%%%%%%%%%%%%%%%%%%%

\<mdframed.4ht\><<<
% mdframed.4ht (|version), generated from |jobname.tex
% Copyright 2017-2022 TeX Users Group
|<TeX4ht license text|>

\NewConfigure{mdframed}{2}
\NewConfigure{mdframedstyle}{1}
\NewConfigure{mdframetitle}{2}
\newcount\mdf:env:cnt
\def\mdf:id{mdframed-\the\mdf:env:cnt}
\def\:tempa#1{\global\advance\mdf:env:cnt by1\relax\a:mdframed\a:mdframedstyle%
    \ifdefempty{\mdf@frametitle}{}{\mdfframedtitleenv{\mdf@frametitle}\a:mdframetitle\mdf@@frametitle@use\b:mdframetitle}\let\mdf@frametitle\@empty%
}
\HLet\mdf@trivlist\:tempa

\def\:tempa{\b:mdframed}
\HLet\endmdf@trivlist\:tempa

% disable frame drawing, it can be supported using CSS
\HLet\detected@mdf@put@frame\relax%

\append:def\mdf@@ignorelastdescenders{\let\orig:unskip\unskip\def\unskip{\let\unskip\orig:unskip}}%
\HLet\mdf@lrbox\:gobble
\HLet\endmdf@lrbox\relax
% disable compilation error caused by Mdframed's patch for Amsthm:
\AtBeginDocument{%
  \let\mdf@patchamsthm\relax%
}
\Hinput{mdframed}
\endinput
>>> \AddFile{9}{mdframed}

%%%%%%%%%%%%%%%%%%%%%%%
\Section{tcolorbox}
%%%%%%%%%%%%%%%%%%%%%%%
\<tcolorbox.4ht\><<<
% tcolorbox.4ht (|version), generated from |jobname.tex
% Copyright 2020-2024 TeX Users Group
|<TeX4ht license text|>

% use custom counter that increments for every \tcolorbox
\newcounter{:tcbcolcount}

\ExplSyntaxOn
\def\:tempa{%
  \stepcounter{:tcbcolcount}%
  % save text and background colors for use in CSS
  \get:xcolorcss{tcbcolbacktitle}\:tcbcolbacktitle%
  \get:xcolorcss{tcbcoltitle}\:tcbcoltitle%
  \get:xcolorcss{tcbcolback}\:tcbcolback%
  \get:xcolorcss{tcbcolframe}\:tcbcolframe%
  \get:xcolorcss{tcbcolupper}\:tcbcolupper%
  % make unique ID for this box
  \gdef\:tcbcolid{tcolobox-\arabic{:tcbcolcount}}
  % Open box
  \a:tcolorbox%
  % set label if it exists
  \ifdefined\tcolorbox:label:key%
    \let\@currentlabel\tcolorbox:currentlabel% at this moment, \@currentlabel has wrong value
    %\o:tcb@set@label:{\tcolorbox:label:key}%
    \AnchorLabel% save cross-ref destination
    \o:__tcobox_label:n:{\tcolorbox:label:key}%
    \global\let\tcolorbox:label:key\undefined% 
  \fi%
  % open title
  \b:tcolorbox%
  \ifx\kvtcb@title\@empty\else
    \kvtcb@before@title\kvtcb@title\kvtcb@after@title%
  \fi
  % close title and open main box
  \c:tcolorbox%
  \box\tcb@upperbox%
  % the paragraph opened in the upper box can be unclosed
  % but I cannot find an example where it matters. \RecallEndP caused issues in the following sample:
  % https://github.com/michal-h21/make4ht/issues/142#issuecomment-1891507567
  % \RecallEndP
  % deal with lower box, if it is set
  \iftcb@hasLower%
    \a:tcolorlowerbox%
    \box\tcb@lowerbox%
    \b:tcolorlowerbox%
  \fi%
  % We need to close box in \tcb@endboxanddraw
}
\ExplSyntaxOff

\HLet\tcb@drawcolorbox\:tempa
% overwrite other versions of box drawing macros
\HLet\tcb@drawcolorbox@standalone\:tempa
\HLet\tcb@drawcolorbox@breakable\:tempa

% save the state of paragraph before opening the content box
\pend:def\tcb@set@@upper@and@lower{\SaveEndP}

% we need to close tcolorbox environment here,
% in the box. otherwise, last paragraph end 
% would be ignored and we would get invalid XML
\def\:tempb{\d:tcolorbox\o:tcb@endboxanddraw:}
\HLet\tcb@endboxanddraw\:tempb

% this should correctly close tcolorbox after the \tcbox command
\append:defIII\tcb@ox{\d:tcolorbox}

% tcolorbox supports libraries, but it loads them
% in a way that doesn't register them for the use 
% with .4ht files.
% this fix is for tcblistingscore.code.tex
\NewConfigure{tcblisting}{1}
\def\:tempb{\o:endtcblisting:\d:tcolorbox\a:tcblisting}
\HLet\endtcblisting\:tempb


% this code prevents emptying of the box title when
% some Tcolorbox options are used
\def\:tempb{}
\HLet\tcb@detach@title@code\:tempb

% require end of paragraph before Tcolorbox
\long\def\:tempb[#1]{\EndP\o:tcb@@icolorbox:[#1]}
\HLet\tcb@@icolorbox\:tempb


\NewConfigure{tcolorbox}{4}
\NewConfigure{tcolorlowerbox}{2}

% we need to save current label for a later use
\def\:tempa#1{%
  \xdef\tcolorbox:label:key{#1}%
  \global\let\tcolorbox:currentlabel\@currentlabel%
}

\ExplSyntaxOn
%\HLet\tcb@set@label\:tempa
\HLet\__tcobox_label_label:n\:tempa
\HLet\__tcobox_label_zlabel:n\:tempa
\HLet\__tcobox_label:n\:tempa
\ExplSyntaxOff

|<tcolorbox minipage|>
|<tcolorbox nameref|>

\Hinput{tcolorbox}
\endinput



>>> \AddFile{9}{tcolorbox}


this is a trick to fix issues with paragraphs
where spurious end \`'</p>' tags were inserted
\<tcolorbox minipage\><<<
\pend:def\tcb@minipage{\SaveEndP}
\pend:def\tcb@minipage@top{\SaveEndP}
\pend:def\tcb@minipage@bottom{\SaveEndP}
\pend:def\tcb@minipage@center{\SaveEndP}

>>>

This code fixes nameref support in Tcolorbox.

\<tcolorbox nameref\><<<
\AfterEndPreamble{%
  % fix \nameref support
  \def\:tempa#1{%
    \gdef\NR:Title{\a:newlabel{#1}}%
    \o:tcb@gettitle:{#1}%
  }%
  \HLet\tcb@gettitle\:tempa
}
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{slashbox}
%%%%%%%%%%%%%%%%%%%%%%%
\<slashbox.4ht\><<<
% slashbox.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
|<slashbox config|>
\Hinput{slashbox}
\endinput
>>> \AddFile{9}{slashbox}

\<slashbox config\><<<
\NewConfigure{slashbox}{2}
\def\:tempa[#1][#2]#3#4{\a:slashbox\o:@@@slashbox:[#1][#2]{#3}{#4}\b:slashbox}

\HLet\@@@slashbox\:tempa
\Configure{slashbox}{\Picture+{}}{\EndPicture}
>>>


%%%%%%%%%%%%%%%%%%%%%%%
\Section{dvipsnam}
%%%%%%%%%%%%%%%%%%%%%%%

\<dvipsnam.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% dvipsnam.4ht                          |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<dvipsnam 4ht|>
\Hinput{dvipsnam}
\endinput
>>>        \AddFile{7}{dvipsnam}

\<dvipsnam 4ht\><<<
\let\sv:ProvidesFile=\ProvidesFile
\let\sv:DefineNamedColor=\DefineNamedColor

\def\ProvidesFile#1]{}
\def\DefineNamedColor#1#2#3#4{%
   \let\sv:HColor=\HColor
   \csname HColor:#3\endcsname #4 //%
   \expandafter\ifx \csname HColor\endcsname\relax
     \:warning{Improper \string\Configure{HColor:#3}}%
   \else
      \edef\HColor{\noexpand\Configure{HColor}{#2}{\HColor}}\HColor
   \fi
   \let\HColor=\sv:HColor
}
\input dvipsnam.def

\let\ProvidesFile=\sv:ProvidesFile
\let\DefineNamedColor=\sv:DefineNamedColor
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{svgnam}
%%%%%%%%%%%%%%%%%%%%%%%

\<svgnam.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% svgnam.4ht                            |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<svgnam 4ht|>
\Hinput{svgnam}
\endinput
>>>        \AddFile{7}{svgnam}

\<svgnam 4ht\><<<
\let\sv:ProvidesFile=\ProvidesFile
\let\sv:XC@definec@lor=\XC@definec@lor

\def\ProvidesFile#1]{}
\def\XC@definec@lor[#1]#2[#3]#4#5{%
   \let\sv:HColor=\HColor
   \csname HColor:#4\endcsname #5 //%
   \expandafter\ifx \csname HColor\endcsname\relax
     \:warning{Improper \string\Configure{HColor:#4}}%
   \else
      \edef\HColor{\noexpand\Configure{HColor}{#2}{\HColor}}\HColor
   \fi
   \let\HColor=\sv:HColor
}
\input svgnam.def

\let\ProvidesFile=\sv:ProvidesFile
\let\XC@definec@lor=\sv:XC@definec@lor
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{colortbl.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%

colortbl.sty invokes color.sty, if the last package is not loaded.
The same is true for array.sty.

\<colortbl.4ht\><<<
% colortbl.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>

   |<fix colortbl|>
   |<colortbl.sty shared config|>
\Hinput{colortbl}
\endinput
>>>        \AddFile{7}{colortbl}


\<add to usepackage\><<<
\Configure{PackageHooks}{colortbl.sty}{colortbl-hooks.4ht}
>>>

\<colortbl-hooks.4ht\><<<
% colortbl-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
\:AtEndOfPackage{%
|<colortbl arrayrulecolor|>
}
>>> \AddFile{7}{colortbl-hooks}


color.sty is obsoleted by xcolor, so we will load the latter package in 
order to get access to the color space conversion commands.

\<fix colortbl\><<<
\RequirePackage{xcolor}
>>>

\<fix colortbl\><<<
\CT@everycr{\o:noalign:{\global\let\CT@row@color\relax}\the\everycr}
>>>

We use xcolor's \`|\convertcolorspec| command to convert argument of
\`|\columncolor| to HTML color specification.


\<fix colortbl\><<<
\def\columncolor#1{{\def\current@color{#1}%
                    \csname a:cell-colortbl\endcsname}}
\Odef\columncolor[#1]#2{{\if :#1:\def\current@color{#2}%
                         \else 
                           \gHAdvance\tblcol:N by 1
                           \convertcolorspec{#1}{#2}{HTML}\tmp:tblcolor
                           \Configure{HColor}{tblcol-\tblcol:N}{\#\tmp:tblcolor}%
                           \def\current@color{tblcol-\tblcol:N}%
                         \fi
                    \csname a:cell-colortbl\endcsname}%
   \futurelet\:temp\left:colcol}
\def\left:colcol{%
   \ifx [\:temp \expandafter\left::colcol \fi
}
\def\left::colcol[#1]{
   \futurelet\:temp\right:colcol
}
\def\right:colcol{%
   \ifx [\:temp \expandafter\right::colcol \fi
}
\def\right::colcol[#1]{}
\HAssign\tblcol:N = 0
>>>

We can reuse the code used in \`|\columncolor| to support also the 
\`|\cellcolor| command.

\<fix colortbl\><<<
\def\CT@cellc#1[#2]#3{{\if :#2:\def\current@color{#3}%
                         \else 
                           \gHAdvance\tblcol:N by 1
                           \convertcolorspec{#2}{#3}{HTML}\tmp:tblcolor
                           \Configure{HColor}{tblcol-\tblcol:N}{\#\tmp:tblcolor}%
                           \def\current@color{tblcol-\tblcol:N}%
                         \fi
                    \csname a:cell-colortbl\endcsname}%
   \futurelet\:temp\left:colcol}
>>>

The followning is a redefinition of a macro from array.sty

\<fix colortbl\><<<
\NewConfigure{@classz}{4}
\pend:def\@classz{\pic:gobble\a:@classz}
\append:def\@classz{\pic:gobble\b:@classz}
\pend:def\insert@column{\pic:gobble\c:@classz}
\append:def\insert@column{\pic:gobble\d:@classz}
>>>

\`'\insert@column' is       used only in array.

  Used to have
\`'\let\HRow|=\relax\let\HCol|=\relax' in \`'\pend:def\@classz', but
that caused a problem in \''\multicol'.  Do we still need that
protection in \''\@classz'?

We take \`'\Configure{@classz}
    {before col}{after col}
    {before entry}{efter entry}',  where the last two need protection
if their content is to expand when the item is reached.  Otherwise,
everything expands when the Preamble is visited.

The following is a reduced definition which removes the ruler used in
painting the backrounds.

\<fix colortbl\><<<
\def\:temp{\global\let\CT@do@color|=\relax}
\HLet\CT@@do@color|=\:temp
>>>

The configuration:

\<fix colortbl\><<<
\let\::maketitle|=\o:maketitle:
\def\o:maketitle:{%
   \ifx \EndPicture\:UnDef
      \NewConfigure{@classz}{4}%
      \Configure{@classz}{}{}{}{}%
   \fi
   \::maketitle }
>>>

Don't \''\CT@setup', \''\CT@row@color', and \''\CT@do@color' 
need also a treatment similar to \''\CT@column@color'?

\SubSection{Rows}

\<fix colortbl\><<<
\def\rowcolor{%
  \o:noalign:{\ifnum0=`}\fi
  \global\let\CT@do@color\CT@@do@color
  |<fixed first main body HRow value|>%
  \@ifnextchar[\CT@rowa\CT@rowb}
\def\CT@rowa[#1]#2{%
  \save:color#1 #2//%
  \pic:gobbleII\a:rowcolor{#2}%
  \gdef\CT@row@color{\CT@color{#2}}%
  \CT@rowc}
\def\CT@rowb#1{%
  \pic:gobbleII\a:rowcolor{#1}%
  \gdef\CT@row@color{\CT@color{#1}}%
  \CT@rowc}
>>>

\<fixed first main body HRow value\><<<
\relax
\ifx\LT@head\Un:Def\else
   \ifnum \HRow=0\relax
      \expandafter\ifx\csname lt:sv\endcsname\relax
        \HAssign\HRow = 1\relax
        \ifvoid\LT@head
           \ifvoid\LT@firsthead \else \HAdvance\HRow by 1\relax\fi
        \else \HAdvance\HRow by 1\relax\fi
      \else
        \HAssign\HRow = \lt:sv \relax
        \HAdvance\HRow by 1\relax
      \fi
\fi\fi
>>>

\<fix colortbl\><<<
\NewConfigure{rowcolor}{1}
>>>

Fixes for colored hlines. The \`|\hline:color| can be used in CSS, for instance.
We need to use early hooks file, because this command can be used in the preamble, 
and we want to catch the defined color.

\<colortbl arrayrulecolor\><<<
% default hline color is black
\def\hline:color{000}
% save rule color in format usable in CSS
\newcommand\tmp:arrayrulecolor[2][named]{%
\ifvoid\@arstrutbox% test if we are inside a tabular environment
\convertcolorspec{#1}{#2}{HTML}\:tmp\global\let\hline:color\:tmp% we are not
\else%
\noalign{\convertcolorspec{#1}{#2}{HTML}\:tmp\global\let\hline:color\:tmp}% we are
\fi
}
% \HLet doesn't work in the preamble, so we need to work around it
\let\o:arrayrulecolor:\arrayrulecolor
\let\arrayrulecolor\tmp:arrayrulecolor

\def\convert:colorspec#1 #2 #3 #4{%
  \edef\current:color{%
    \ifx\relax#1\relax\else%
    #1\ifx\relax#2\relax\else%
    , #2\ifx\relax#3\relax\else%
      , #3\ifx\relax#4\relax\else%
        , #4%
        \fi%
      \fi%
    \fi%
  \fi%
  }%
}

>>>

This version of arrayrulecolor will be used after preamble. 
It supports pictures.

\<fix colortbl\><<<
\HRestore\arrayrulecolor
\HLet\arrayrulecolor\tmp:arrayrulecolor
>>>

\SubSection{Utilities}

This should enable use of \`|\color| command in array declaration

\<fix colortbl\><<<
\def\save:color#1 #2//{%
  \convert:colorspec#2 {} {} {} {}
  \convertcolorspec{#1}{\current:color}{HTML}\tmp:col
  \def\current@color{#2}
  \Configure{HColor}{\current@color}{\#\tmp:col}
}

\def\begin:current@color{\let\sv:curcolor|=\current@color}
\def\end:current@color{%
   \ifx \current@color\sv:curcolor 
   \else%
   \expandafter\save:color\current@color//%
   \csname a:text-colortbl\endcsname 
   \fi
}
\NewConfigure{text-colortbl}{1}
\def\GET@column@color{}
\def\color:ii[#1]#2#3|<par del|>{\def\:temp{#1 #2}}
\def\color:i#1#2|<par del|>{\def\:temp{#1}}
>>>

We introduce css for color of text in a cell, only if the color
changed in the cell.  The last color is the that takes effect.

\<\><<<
\Configure{multicolumn}
   {}{}
   {\ifvmode\IgnorePar\fi
    \HCode{<div class="multicolumn"}\HColAlign\HCode{>}%
    \expandafter\MUL:LMN\meaning\@preamble//}
   {\ifvmode\IgnorePar\fi \EndP\HCode{</div>}}
>>>

\<fix colortbl\><<<
\let\ctbl:mcol|=\multicolumn
\def\multicolumn#1#2#3{%
   \ctbl:mcol{#1}{#2}{#3}%
   \expand:after{\expandafter\MUL:LMN\meaning\@preamble}\MUL:PA//%
   \ignorespaces}
{ 
  \def\MUL:PA{\gdef\MUL:PA}
  \def\MUL:LMN{%
  \catcode`\C=12
  \catcode`\T=12
  \catcode`\@=12
  \catcode`\c=12
  \catcode`\o=12
  \catcode`\l=12
  \catcode`\r=12
  \catcode`\t=12
  \catcode`\e=12
  \catcode`\m=12
  \catcode`\p=12
  \catcode`\d=12
  \catcode`\i=12
  \catcode`\b=12
  \gdef\MUL:LMN}  
  \MUL:LMN#1CT@color #2@tempdimb#3//{\::KOLOR{#2}}
  \MUL:PA{CT@color @tempdimb}
}
\def\::KOLOR#1{\if :#1:\else |<set to preamble color|>\fi}
\def\:KOLOR{\@ifnextchar[\mc:clr{\mc:clr[]}}
{
  \catcode`\{=12
  \catcode`\}=12
  \catcode`\(=1
  \catcode`\)=2
  \gdef\mc:clr[#1]{#2}((%
       \def\current@color(\if :#1:\else #1 \fi #2)%
       \csname a:cell-colortbl\endcsname
     )\def\:temp##1//()\:temp)
)
\NewConfigure{cell-colortbl}{1}
>>>

\<set to preamble color\><<<
\:KOLOR#1//%
>>>

%%%%%%%%%%%%%%%%
\Section{dvips}
%%%%%%%%%%%%%%%%

\<dvips.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% dvips.4ht                             |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<postscript colors model|>
\Hinput{dvips}
\endinput
>>>        \AddFile{6}{dvips}

\<postscript colors model\><<<
|<dvips gray|>
|<dvips cmyk|>
|<dvips rgb|>
\def\colortyp:#1 #2//{%
   \expandafter\ifx \csname colortyp:#1:\endcsname\relax \else
     \csname colortyp:#1:\endcsname #2 //\fi}
>>>

% \def\colortyp:hsb:#1//{\hshow{#1}}

\<dvips gray\><<<
\def\colortyp:gray:#1 #2//{%
   \if :#1:%   
      \colortyp:gray:#2 //%
   \else
      \HColor:gray #1 //%
   \fi
}
>>>

\<dvips rgb\><<<
\def\colortyp:rgb:#1 #2 #3 #4//{%
   \if :#1:%
      \colortyp:rgb:#2 #3 #4 //%
   \else\if :#2:%
      \colortyp:rgb:#1 #3 #4 //%
   \else\if :#3:%
      \colortyp:rgb:#1 #2 #4 //%
   \else
      \HColor:rgb #1,#2,#3 //%
   \fi\fi\fi
}
>>>

\<dvips cmyk\><<<
\def\colortyp:cmyk:#1 #2 #3 #4 #5//{%
   \if :#1:%
      \colortyp:cmyk:#2 #3 #4 #5//%
   \else\if :#2:%
      \colortyp:cmyk:#1 #3 #4 #5//%
   \else\if :#3:%
      \colortyp:cmyk:#1 #2 #4 #5//%
   \else\if :#4:%
      \colortyp:cmyk:#1 #2 #3 #5//%
   \else
      \HColor:cmyk #1,#2,#3,#4 //%
   \fi\fi\fi\fi
}
>>>

%%%%%%%%%%%%%%%%
\Section{textures}
%%%%%%%%%%%%%%%%

\<textures.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% textures.4ht                          |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<textures colors model|>
\Hinput{textures}
\endinput
>>>        \AddFile{9}{textures}

\<textures colors model\><<<
\def\colortyp:cmyk:#1. #2. #3. #4. #5//{\HColor:cmyk #1,#2,#3,#4 //}
\def\colortyp:rgb:#1. #2. #3. #4//{\HColor:rgb #1,#2,#3 //}
\def\colortyp:#1 #2//{%
   \expandafter\ifx \csname colortyp:#1:\endcsname\relax \else
     \csname colortyp:#1:\endcsname #2 //\fi}
>>>

% \def\colortyp:hsb:#1//{\hshow{#1}}

%%%%%%%%%%%%%%%%
\Section{dvipdf}
%%%%%%%%%%%%%%%%

\<dvipdf.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% dvipdf.4ht                            |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<postscript colors model|>
\Hinput{dvipdf}
\endinput
>>>        \AddFile{9}{dvipdf}

%%%%%%%%%%%%%%%%
\Section{dvipsone}
%%%%%%%%%%%%%%%%

\<dvipsone.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% dvipsone.4ht                          |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<postscript colors model|>
\Hinput{dvipsone}
\endinput
>>>        \AddFile{9}{dvipsone}

%%%%%%%%%%%%%%%%
\Section{fig4tex}
%%%%%%%%%%%%%%%%

\<fig4tex.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% fig4tex.4ht                           |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|> 
|<fig4tex hooks|>
\Hinput{fig4tex}
\endinput
>>>        \AddFile{9}{fig4tex}

\<fig4tex hooks\><<<
\ifx \AtBeginDocument\UnDef
   |<config figvisu|>
\else
  \AtBeginDocument{|<config figvisu|>}
\fi
\NewConfigure{figvisu}{2}
\Configure{figvisu}{\Picture+{}}{\EndPicture}
>>>

\<config figvisu\><<<
\def\:tempc#1#2#3{%
   \let\sv:EndPicture\EndPicture
     \let\EndPicture\empty
   \o:figvisu:{#1}{#2}{#3}%
   \let\EndPicture\sv:EndPicture
}%
\HLet\figvisu\:tempc
>>>

\<config figvisu\><<<
\def\:tempc#1#2#3{%  
   \let\svEndPicture\EndPicture  
     \let\EndPicture\empty  
   \o:figvisu:{#1}{#2}{#3}%  
   \let\EndPicture\svEndPicture  
}%  
\HLet\figvisu\:tempc  
\def\:tempc#1{% 
    \a:figvisu 
    \raise -\dp#1 \rlap{\vrule width .001pt height .001pt depth 0pt}%  
    \edef\:temp{\the\ht#1}%  
    \box#1%  
    \raise \:temp \llap{\vrule width .001pt height .001pt depth 0pt}% 
    \b:figvisu 
} 
\HLet\figbox\:tempc  
\def\:tempc#1{% 
    \a:figvisu 
    \raise -\dp#1 \rlap{\vrule width .001pt height .001pt depth 0pt}%  
    \edef\:temp{\the\ht#1}%  
    \copy#1%  
    \raise \:temp \llap{\vrule width .001pt height .001pt depth 0pt}% 
    \b:figvisu 
} 
\HLet\figcopy\:tempc 
>>>

As far as latex is concerned fig4tex is correct, but for tex4ht the
typesetting of code occurs too early within movable boxes
positional-wise.  The solution to the problem results in a tiny dirt
at opposite corners of the figure.

%%%%%%%%%%%%%%%%
\Section{pctex32}
%%%%%%%%%%%%%%%%

\<pctex32.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% pctex32.4ht                           |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<postscript colors model|>
\Hinput{pctex32}
\endinput
>>>        \AddFile{9}{pctex32}

%%%%%%%%%%%%%%%%
\Section{overpic}
%%%%%%%%%%%%%%%%

\<overpic.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% overpic.4ht                           |version %
% Copyright (C) |CopyYear.2005.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{overpic}
\endinput
>>>        \AddFile{9}{overpic}

%%%%%%%%%%%%%%%%%
\Chapter{DraTeX}
%%%%%%%%%%%%%%%%%

\Section{Gif for DraTex}

MOVE INTO DraTeX.

The comand  \`'\Draw' gives \`'\Picture*{}' and the option
 \`'\Draw[replacement]' gives
\`'\Picture*[replacement]{}'.

\<dratex.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% dratex.4ht                            |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<dratex.sty|>
\Hinput{dratex}
\endinput
>>>        \AddFile{9}{dratex}

\<dratex.sty\><<<
   \Define\html:Draw{|<definition of /:Draw in DraTeX|>%
      }

   \let\old:Draw|=\:Draw
   \def\:Draw{%
      \ifx \EndPicture\:UnDef
         \expand:after{|<html into /Draw|>}%
      \else   \expandafter\old:Draw \fi }
   |<utilities for /:Draw|>
   |<arguments of Draw into IMG|>
   |<image maps for /Draw|>
>>>

To avoid cloging the memory, when possible, move the pictures to new
pages.

\<html into /Draw\><<<
\ifvmode \vfill\break \fi
\pic:cond\:GifDraw\html:Draw
>>>

We get into \`'\Draw...\EndDraw' with the following \''\futurelet', so
we'll better ger the catcodes right.

\<utilities for /:Draw\><<<
\def\:GifDraw{\bgroup\:DraCatCodes   \futurelet\:tempa\gif:draw}
\def\gif:draw{%
  \ifx \:tempa[\g:fdr\g:ifdraw
  \else        \g:fdr\gi:fdraw \fi}
\def\g:ifdraw[#1]{\Picture*[#1]{ \a:@Picture{Draw}}\html:Draw}
\def\gi:fdraw{\Picture*{ \a:@Picture{Draw}}\html:Draw}
\def\g:fdr{\egroup\a:Draw\append:def\end:condpic{\b:Draw}\expandafter}
\NewConfigure{Draw}{2}
>>>

\<html into /EndDraw\><<<
|<measure dimension of drawing|>%
\global\let\in:pic|=\empty
\box\:box    \end:condpic 
\global\let\in:pic|=\:UnDef
>>>

\SubSection{Dimensions}

We put the picture into a box so that we will be able to measure its
dimensions. Now, we must be careful not to introduce strange stuff
into the box that will ruin the measurements.  In DraTeX we might be
less careful because
spaces are ignored due to their catcode of 9.

\<put picture in box\><<<
\setbox\:box=>>>

\<measure dimension of drawing\><<<
{\:X|=\wd\:box  \:Y|=\ht\:box  \advance\:Y by\dp\:box 
 \xdef\DrawWidth{\:InCons\:X}%
 \xdef\DrawHeight{\:InCons\:Y}%
 \xdef\MinDrawX{\:InCons\:LBorder}%
 \:X|=\:UBorder \xdef\MaxDrawy{\:InCons\:X}%
}%
>>>

\SubSection{Definition of /Draw.../EndDraw in DraTeX}

When \`'\DrawOn' is active, we have the definition
\`'\def\Draw{\:Draw}'.

\<definition of /:Draw in DraTeX\><<<
\ifvmode \noindent\hfil\fi
\global\:TeXLoc\z@
|<put picture in box|>\vbox\bgroup 
        \begingroup
\def\EndDraw{%
        \endgroup   \:SetDrawWidth 
      \egroup    |<html into /EndDraw|>%
      |<image map after /Draw|>}%
|<postscript for /Draw|>%
\:DraCatCodes      \parindent\z@    \ht:everypar{}%
\linepenalty10
\leftskip\z@     \rightskip\z@    \boxmaxdepth\maxdimen
\let\FigSize\:FigSize
\def\Draw{\:wrn1{}}%
\:CommonIID   \:InDraw 
>>>

\<postscript for /Draw\><<<
\def\PsCode##1{{\Text(--\ht:special{\PsCodeSpecial##1}--)}}%
>>>

In DraTeX dimensions don't care about the color of the pixels, but
once we go to dvips and/or convert we loose the invisible character
around the visible picture.  This causes a statement for improper
dimensions, and so for a distortion of the picture when the dimensions
are stated in \`'IMG'.  To avoid this, we can put rulers 
\`'\hrule height 1pt  \vskip2pt  \vbox\bgroup'
and
\`'\egroup  \vskip2pt  \hrule height 1pt'
at the start and end of the vbox that span to the full width.
However, such rulers are not alway desirable.

Hence, we go for the following instead of
\`'\DrawIMG{ WIDTH="\DrawWidth" HEIGHT="\DrawHeight"}'.

\<arguments of Draw into IMG\><<<
\def\DrawIMG#1{\def\Pic:Img{ \ifx \in:pic\:UnDef \at:IMG
                                \else \u:map#1\fi}}
\DrawIMG{}
\let\u:map|=\empty
>>>

\Section{Image Maps}

Origin at left-top corner of picture.

Possible options for textual links.

The <A USEMAP=...> tag is ignored by drawing displayer.

\<image maps for /Draw\><<<
\def\DrawMap{%
  \NewHaddr\:temp
  \xdef\:Map{{<map name="\:temp">}}%
  \edef\u:map{ usemap="\:sharp\:temp" }%
  \NewHaddr\alt:map
  \def\after:dra{\EndLink
      \HPage[\alt:map]{}{\expandafter\map:menu\:Map}\EndHPage{}%
      {\expandafter\HCode\:Map}\HCode{</map>}%
      \let\u:map|=\empty \let\after:dra|=\empty }%
  \Link[\RefFile{\alt:map}]{}{}\Draw[textual map]}

\let\after:dra=\empty
>>>

\<image map after /Draw\><<<
\after:dra
>>>

\SubSection{Recording Rectangles}

PUT warnings

PUT ALT ONLy IN PLACE!!!

\<image maps for /Draw\><<<
\Odef\GetRectArea[#1]#2#3{{%
  \ifnum \Point:N>0
     \MarkPoint     \area:env \gHAssign\Point:N |= 0
     \xdef\:Map{\:Map
        \rect:area{#1}\gt:crd{point:1}\gt:crd{point:2}{#2}{#3}}%
  \fi}}
\def\rect:area#1#2#3#4#5#6#7{%
   \trns:pt\:X{#2}\:Y{#3}%
   \trns:pt\:Z{#4}\:W{#5}%
   \Ar:a[#1 shape="rect"
     coords="\M:n\:X\:Z,\M:n\:Y\:W,\M:x\:X\:Z,\M:x\:Y\:W"
     \if "#7"\else alt="#7"\fi]{#6}}
>>>

\SubSection{Recording Circles}

\<image maps for /Draw\><<<
\Odef\GetCircleArea[#1]#2#3{{%
  \ifnum \Point:N>0
    \MarkPoint    \:distance(point:1,point:2)\tmp:dim|=\Map:x
    \:d|=\:Cons\tmp:dim\:d \area:env
    \gHAssign\Point:N |= 0
    \xdef\:Map{\:Map
       \circle:area{#1}\gt:crd{point:1}{\:InCons\:d}{#2}{#3}}%
  \else\fi}}
>>>

\<image maps for /Draw\><<<
\def\circle:area#1#2#3#4#5#6{%
   \trns:pt\:X{#2}\:Y{#3}%
   \Ar:a[#1 shape="circle" coords="\:X,\:Y,#4" 
       \ifx "#6"\else alt="#6"\fi]{#5}}
>>>

\SubSection{Recording Polygons}

\<image maps for /Draw\><<<
\Odef\GetPolyArea[#1]#2#3{{%
  \ifnum \Point:N>0
     \MarkPoint   \area:env  \let\:tempb|=\empty
     \Do(1,\Point:N){\edef\:tempb{\gt:crd{point:\the\DoReg}\:tempb}}%
     \gHAssign\Point:N |= 0
     \xdef\:Map{\:Map\poly:area{#1}{\:tempb}{#2}{#3}}%
  \fi}}

\def\ply:pts#1#2{%
   \def\:temp{#1}\ifx \:temp\empty\else
     \trns:pt\:X{#1}\:Y{#2}%
     \edef\:Z{\:Z\ifx \:Z\empty\else,\fi \:X,\:Y}%
     \expandafter\ply:pts
   \fi }
>>>

\<image maps for /Draw\><<<
\def\poly:area#1#2#3#4{%
   \let\:Z|=\empty  \ply:pts#2{}{}%
   \Ar:a[#1 shape="poly" coords="\:Z" 
      \ifx "#4"\else  alt="#4"\fi]{#3}}
>>>

\SubSection{alternative Textual Menues}

\<image maps for /Draw\><<<
\def\map:menu#1{\let\rect:area|=\r:mnu \let\circle:area|=\c:mnu
   \let\poly:area|=\p:mnu}

\def\r:mnu#1#2#3#4#5#6#7{[\Link[#1]{#6}{}#7\EndLink] }
\def\c:mnu#1#2#3#4#5#6{[\Link[#1]{#5}{}#6\EndLink] }
\def\p:mnu#1#2#3#4{[\Link[#1]{#3}{}#4\EndLink] }
>>>

\SubSection{Utilities}

\<image maps for /Draw\><<<
\gHAssign\Point:N |= 0
\def\MarkPoint{\gHAdvance\Point:N |by 1
   \MarkGLoc(point:\Point:N)}

\def\area:env{\def\:X##1.##2\:Y##3.##4,{{##1}{##3}}%
    \let\rect:area|=\relax
    \let\circle:area|=\relax
    \let\poly:area|=\relax }

\def\gt:crd#1{\csname Loc\space#1:\endcsname,}
>>>

\<image maps for /Draw\><<<
\def\trns:pt#1#2#3#4{%
   \ifnum #2<\MinDrawX  \HAssign#1|=0
   \else   \HAssign#1 |= #2 \Advance:#1 |by -\MinDrawX  
      \tmp:dim|=\Map:x \multiply\tmp:dim |by #1 
      \HAssign #1|=\:InCons\tmp:dim
   \fi
   \ifnum  #4>\MaxDrawy   \HAssign#3|=\MaxDrawy 
   \else   \HAssign#3|=-#4  \Advance:#3 |by \MaxDrawy 
   \fi
   \tmp:dim|=\Map:y \multiply\tmp:dim |by #3  \HAssign#3|=\:InCons\tmp:dim
}
>>>

\<image maps for /Draw\><<<
\def\MapDensity(#1,#2){%
   \tmp:dim=#1pt \divide\tmp:dim by 72 \edef\Map:x{\the\tmp:dim}%
   \tmp:dim=#2pt \divide\tmp:dim by 72 \edef\Map:y{\the\tmp:dim}}
\MapDensity(72,72)
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Curriculum Vitas}
%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%
\Section{europecv.sty}
%%%%%%%%%%%%%

\<europecv.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% europecv.4ht                          |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<europecv configurations|>
\Hinput{europecv}
\endinput
>>>        \AddFile{9}{europecv}

\<europecv configurations\><<<
\expandafter\def\csname \string
    \ecvlanguagefooter\endcsname[#1]#2{\ecvitem [#1]{}{\quad 
       \footnotesize {${}\sp{\hbox {\tiny #2}}$\textit
       {\ecv@langfooterkey }}}}
\def\ecvlanguageheader#1{%
  {\large\textit{\ecv@assesskey}}\\ 
   \textit{\ecv@levelkey}${}\sp{\hbox{\scriptsize#1}}$&
  \a:languageheader
  \begin{tabular}[t]{m{\ecv@langparwidth}m{\ecv@langparwidth}%
                     m{\ecv@langparwidth}m{\ecv@langparwidth}%
                     m{\ecv@langparwidth}}
     \multicolumn{2}{c}{\textbf{\ecv@understandkey}}%
              &\multicolumn{2}{c}{\textbf{\ecv@speakkey}}%
              &\centering\textbf{\ecv@writekey}\tabularnewline
     \centering\small{\ecv@listenkey}    & 
     \centering \small{\ecv@readkey}     &
     \centering \small{\ecv@interactkey} &
     \centering \small{\ecv@productkey}  & 
     \tabularnewline
  \end{tabular}\b:languageheader \tabularnewline
  }
\NewConfigure{languageheader}{2}
>>>

\<europecv configurations\><<<
\expandafter\def\csname \string\ecvlanguage\endcsname[#1]#2#3#4#5#6#7{
  {\textbf{#2}} &
  \a:language
  \begin{tabular}{m{\ecv@langparwidth}m{\ecv@langparwidth}%
                  m{\ecv@langparwidth}m{\ecv@langparwidth}m{\ecv@langparwidth}}
   #3 & #4 & #5 & #6 & #7\tabularnewline  \midrule
  \end{tabular}\b:language
  \tabularnewline
  }
\expandafter\def\csname \string\ecvlastlanguage\endcsname[#1]#2#3#4#5#6#7{
  {\textbf{#2}} &
  \a:lastlanguage
  \begin{tabular}{m{\ecv@langparwidth}m{\ecv@langparwidth}%
                  m{\ecv@langparwidth}m{\ecv@langparwidth}m{\ecv@langparwidth}}
   #3 & #4 & #5 & #6 & #7\tabularnewline \bottomrule
  \end{tabular}\b:lastlanguage
  \tabularnewline
  }
\pend:defII\ecvCEF{\a:ecvCEF}
\append:defII\ecvCEF{\b:ecvCEF}
\NewConfigure{ecvCEF}{2}
\NewConfigure{language}{2}
\NewConfigure{lastlanguage}{2}
>>>

\<europecv configurations\><<<
\pend:def\europecv{|<europecv entries|>}
>>>

\<europecv entries\><<<
\ifx\@empty\ecv@telephone\else
   \ifx\@empty\ecv@telephone\else 
      \pend:def\ecv@telephone{\a:telephone}
      \append:def\ecv@telephone{\b:telephone}
   \fi
   \ifx\@empty\ecv@mobile\else
      \pend:def\ecv@mobile{\c:telephone}
      \append:def\ecv@mobile{\d:telephone}
   \fi
\fi
>>>
\<europecv configurations\><<<
\NewConfigure{telephone}{4}
>>>

%%%%%%%%%%%%%
\Section{Resume.sty}
%%%%%%%%%%%%%

Due to Stephen Gildea.

\<resume.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% resume.4ht                            |version %
% Copyright (C) |CopyYear.2006.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<resume configurations|>
\Hinput{resume}
\endinput
>>>        \AddFile{9}{resume}

\<resume configurations\><<<
\pend:defI\name{\a:name}
\append:defI\name{\b:name}
\NewConfigure{name}{2}
\def\addresses#1#2{\a:addresses\@tablebox{#1}\b:addresses
                               \@tablebox{#2}\c:addresses}
\NewConfigure{addresses}{3}
\def\location#1{\a:location{#1}\b:location}
\NewConfigure{location}{2}
\def\:tempc{\o:llist:\def\sectiontitle##1{\item[{\bf ##1}]}}
\HLet\llist\:tempc
>>>

%%%%%%%%%%%%%
\Section{Curve.sty}
%%%%%%%%%%%%%

A style file for resumes. 

\<curve.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% curve.4ht                             |version %
% Copyright (C) |CopyYear.2006.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<curve configurations|>
\Hinput{curve}
\endinput
>>>        \AddFile{9}{curve}

\<curve configurations\><<<
\def\makeheaders@#1{% 
  \setlength\leftheader@width{\header@scale\textwidth}% 
  \setlength\rightheader@width{\textwidth - \leftheader@width}% 
  \a:makeheaders 
  \@leftheader  \b:makeheaders   \@rightheader  \c:makeheaders} 
\NewConfigure{makeheaders}{3} 
>>>

\<curve configurations\><<<
\renewcommand\subrubric[1]{% 
  \@nextentry 
  \noalign{\gdef\@nextentry{}}% 
  \@subrubric{\a:subrubric#1\b:subrubric}\\*} 
\NewConfigure{subrubric}{2}
>>>

\<curve configurations\><<< 
\def\@@rubrichead#1{\@rubricfont\a:rubrichead 
    #1\b:rubrichead\par\vspace\rubricspace} 
\renewcommand\maketitle{%  
  \a:maketitle 
  \begin{center}  
    \c:maketitle{\@titlefont\@title}\d:maketitle 
    \ifx\@subtitle\@undefined\else\\% 
        \e:maketitle\@subtitlefont\@subtitle\f:maketitle 
    \fi  
  \end{center} 
  \b:maketitle  
  \vspace\titlespace}  
\NewConfigure{rubrichead}{2} 
\NewConfigure{maketitle}{6} 
>>>

\<curve configurations\><<<
\renewcommand\@entry[2][]{% 
  \gdef\@nextentry{}\egroup 
  \a:key\@key{#1}\b:key&\a:prefix\@prefix\b:prefix&#2\\} 
\renewcommand\@sentry[1][]{% 
  \gdef\@nextentry{\\}\egroup 
  \a:key\@key{#1}\b:key&\a:prefix\@prefix \b:prefix&} 
\renewcommand\entry{% 
  \@nextentry 
  \bgroup\gdef\@beforespace{-\subrubricbeforespace}% 
  \@ifstar{\@sentry}{\@entry}} 
\NewConfigure{key}{2} 
\NewConfigure{prefix}{2} 
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{moderncv}
%%%%%%%%%%%%%%%%%%%%%%%%%

\<moderncv.4ht\><<<
% moderncv.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
|<moderncv configs|>
\Hinput{moderncv}
\endinput
>>>\AddFile{9}{moderncv}

This is a bit messy. We had to redefine a bunch of commands from various 
files that Moderncv uses, mostly to prevent compilation errors and to 
insert some basic formatting.

\<moderncv configs\><<<
\NewConfigure{section}{2}
\RenewDocumentCommand\section{sm}{\a:section #2\b:section}

\NewConfigure{subsection}{2}
\RenewDocumentCommand\subsection{sm}{\a:subsection #2\b:subsection}


\NewConfigure{cvitem}{3}
\renewcommand*{\cvitem}[3][.25em]{
\a:cvitem  #2\b:cvitem #3\c:cvitem
}

\NewConfigure{cvdoubleitem}{2}
\renewcommand*{\cvdoubleitem}[5][.25em]{%
\a:cvdoubleitem
\cvitem{#2}{#3}
\cvitem{#4}{#5}
\b:cvdoubleitem
}

\NewConfigure{cvlistitem}{2}
\renewcommand*{\cvlistitem}[2][.25em]{%
  \a:cvlistitem\cvitem[#1]{\listitemsymbol}{#2}\b:cvlistitem
}

\NewConfigure{cvlistdoubleitem}{2}
\renewcommand*{\cvlistdoubleitem}[3][.25em]{%
  \a:cvlistdoubleitem%
  \cvitem[#1]{\listitemsymbol}{#2}%
  \cvitem[#1]{\listitemsymbol}{#3}%
  \b:cvlistdoubleitem%
}

\NewConfigure{cvhead}{2}
\NewConfigure{cvphoto}{2}


\renewcommand*{\makecvhead}{%
  \a:cvhead 
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \recomputecvlengths%
  % optional detailed information (pre-rendering)
  \@initializebox{\makecvheaddetailsbox}%
  \if@details%
    \def\phonesdetails{}%
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
    \def\socialsdetails{}%
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
    \savebox{\makecvheaddetailsbox}{%
      \addressfont\color{color2}%
      \if@left\begin{tabular}[b]{@{}r@{}}\fi%
      \if@right\begin{tabular}[b]{@{}l@{}}\fi%
        \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
          \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
          \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
        \ifthenelse{\isundefined{\@born}}{}{\makenewline\bornsymbol\@born}%
        \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
        \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
        \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}%
        \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict
        \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
      \end{tabular}
    }\fi%
  % optional photo (pre-rendering)
  \@initializebox{\makecvheadpicturebox}%
  \savebox{\makecvheadpicturebox}{%
    \ifthenelse{\isundefined{\@photo}}%
      {}%
      {%
        \a:cvphoto\includegraphics[]{\@photo}\b:cvphoto}%
          }%
  % name and title (pre-rendering)
  \@initializelength{\makecvheaddetailswidth}\settowidth{\makecvheaddetailswidth}{\usebox{\makecvheaddetailsbox}}%
  \@initializelength{\makecvheadpicturewidth}\settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}%
  \ifthenelse{\lengthtest{\makecvheadnamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvheadnamewidth=0pt)
    {\setlength{\makecvheadnamewidth}{\textwidth-\makecvheaddetailswidth-\makecvheadpicturewidth}}%
    {}%
  \@initializebox{\makecvheadnamebox}%
  \savebox{\makecvheadnamebox}{%
    \begin{minipage}[b]{\makecvheadnamewidth}%
      \if@left\raggedright\fi%
      \if@right\raggedleft\fi%
      \namestyle{\@firstname\ \@lastname}%
      \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
    \end{minipage}}%
  % rendering
  \if@left%
    \usebox{\makecvheadnamebox}%
    \hfill%
    \llap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced
    \usebox{\makecvheadpicturebox}\fi%
  \if@right%
    \usebox{\makecvheadpicturebox}%
    \rlap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced
    \hfill%
    \usebox{\makecvheadnamebox}\fi%
  \\[2.5em]%
  % optional quote
  \ifthenelse{\isundefined{\@quote}}%
    {}%
    {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
  \b:cvhead\par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvhead


\RenewDocumentCommand\cvskilllegend{s +O{.25em} +O{\skillLegend@defaultLevelOne} +O{\skillLegend@defaultLevelTwo} +O{\skillLegend@defaultLevelThree} +O{\skillLegend@defaultLevelFour} +O{\skillLegend@defaultLevelFive} +m}{%
\begin{tabular}{l l l l l l}
                \raggedleft\hintstyle{#8}  & \cvskill{1}\, & \,{\skillLegend@FontSize #3} & \cvskill{3}\, &\,{\skillLegend@FontSize #5 } \\%
                            %
                        & \cvskill{2}\, & \,\multirow{2}{\cvskilllegend@leftdescriptorwidth}{{\skillLegend@FontSize #4}} & \cvskill{4}\,  &\,{\skillLegend@FontSize #6 } \\%
                    %         
                        &  &   & \cvskill{5}\, &\,{\skillLegend@FontSize #7 }%
            \end{tabular}%
}%


\NewConfigure{cvskill}{2}
\def\:tempa#1{\def\:cvskillamount{#1}\a:cvskill\o:cvskill:{#1}\b:cvskill}
\HLet\cvskill\:tempa

\NewConfigure{cvskillhead}{2}
\NewConfigure{cvskillentry}{2}
\RenewDocumentCommand\cvskillhead{O{.25em} +O{\skillMatrix@HeaderDefaultOne} +O{\skillMatrix@HeaderDefaultTwo} +O{\skillMatrix@HeaderDefaultThree} +O{\skillMatrix@HeaderDefaultFour}}{%
    \begingroup
    \a:cvskillhead
        \begin{tabular}{ p{6em}  p{12em} p{4em} p{20em}}%
            { #2} & { #3} & { #4} & { #5}  
        \end{tabular}%
    \b:cvskillhead
    \endgroup
    \par\addvspace{#1}
}

\RenewDocumentCommand\cvskillentry{s +O{.25em} +m +m +m +m +m}{%
\a:cvskillentry
\cvitem{#3}{
    \begin{tabular}{ p{6em}  p{12em} p{4em} p{20em}}
            \centering \cvskill{#4} &\centering {#5} & \centering {#6} &{\itshape#7}%
        \end{tabular}}%
  \b:cvskillentry
        \par\addvspace{#2}
}

>>>

%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Small Ones}
%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%
\Section{vowel.sty}
%%%%%%%%%%%%%

\<vowel.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% vowel.4ht                          |version %
% Copyright (C) |CopyYear.2009.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<vowel config|>
\Hinput{vowel}
\endinput
>>>        \AddFile{9}{vowel}

%%%%%%%%%%%%%
\Section{enumitem.sty}
%%%%%%%%%%%%%

\<enumitem.4ht\><<<
% enumitem.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2009. Eitan M. Gurari
|<TeX4ht copywrite|>
|<enumitem config|>
|<enumitem newlist|>
\Hinput{enumitem}
\endinput
>>>        \AddFile{9}{enumitem}

If user opens a new environment in Enumitem's "before" key,
it will prevent execution of the closing command for the 
original environment, and generated tags will be mismatched.

This code postpones execution of code from the "after" key after
closing of the Enumitem environment, so it can be correctly closed.

See \Link[https://tex.stackexchange.com/q/642439/2891]{}{} this example
what can go wrong\EndLink.

\<enumitem config\><<<
\AddToHook{env/enumerate/end}{\ifx\enit@after\@empty\else%
  \let\enit:after\enit@after
  \let\enit@after\@empty
  \let\enumerate:executed\@empty
  \append:def\end:DL{\enit:after}
\fi}
>>>

This should prevent enumitem from changing of items in description lists,
because this can lead to errors.

See \Link[https://github.com/hendricius/the-sourdough-framework/pull/312]{}{}for an example\EndLink.



\<enumitem config\><<<
\def\enit@postlabel{}
>>>

We need to provide a configuration for environments defined using \Verb+\newlist+. 
Because they are defined in the preamble, we must catch them using the early hooks 
file. 

The test file and report can be found \Link[https://github.com/michal-h21/make4ht/issues/150]{}{}here\EndLink.


\<add to usepackage\><<<
\Configure{PackageHooks}{enumitem.sty}{enumitem-hooks.4ht}
>>>

\<enumitem-hooks.4ht\><<<
% enumitem-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
\:AtEndOfPackage{%
|<enumitem patch newlist|>
}
>>> \AddFile{9}{enumitem-hooks}


We save all defined environments in \Verb+\enumitem:newlist+. This command 
is then called in the \Verb+\Configure{enumitemnewlist}+, which can 
be used in the output format configuration.

\<enumitem patch newlist\><<<
\def\enumitem:newlist{}
\def\:tempa#1#2#3#4{\concat:config\enumitem:newlist{\Configure{enumitemenv}{#2}}\o:enit@newlist{#1}{#2}{#3}{#4}}
\let\o:enit@newlist\enit@newlist
\let\enit@newlist\:tempa
>>>


This configuration is called automatically by \Verb+\Configure{enumitenewlist}+ for each 
declared environment. The environment name is saved in \Verb+\a:enumitemenv+,
and then we call \Verb+\enumitem:newlist+, which should provide a configuration for lists 
in the current output format. 

\<enumitem newlist\><<<
\NewConfigure{enumitemenv}[1]{%
\def\a:enumitemenv{#1}%
\enumitem:newlistconfig
}
>>>

This configuration should provide a configuration for a list in the current output format. 
Name of the configured environment is saved in \Verb+\a:enumitemenv+.

\<enumitem newlist\><<<
\NewConfigure{enumitemnewlist}[1]{
  \def\enumitem:newlistconfig{#1}
  \enumitem:newlist
}
>>>


%%%%%%%%%%%%%
\Section{esperanto.sty}
%%%%%%%%%%%%%

\<esperanto.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% esperanto.4ht                      |version %
% Copyright (C) |CopyYear.2009.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<esperanto config|>
\Hinput{esperanto}
\endinput
>>>        \AddFile{9}{esperanto}

\<esperanto config\><<<
\AtBeginDocument{\catcode`\^\active} 
\def\:tempc{\^{h}\allowhyphens}
\expandafter\HLet\csname esperanto@sh@\string^@h@\endcsname\:tempc
>>>

%%%%%%%%%%%%%
\Section{IEEEtran.cls}
%%%%%%%%%%%%%

\<IEEEtran.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% IEEEtran.4ht                      |version %
% Copyright (C) |CopyYear.2009.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<IEEEtran config|>
\Hinput{IEEEtran}
\endinput
>>>        \AddFile{9}{IEEEtran}

\<IEEEtran config\><<<
\let\twocolumn\onecolumn
\@restonecoltrue\onecolumn
\let\@restonecolfalse\@restonecoltrue
>>>

%%%%%%%%%%%%%
\Section{enumerate.sty}
%%%%%%%%%%%%%

\<enumerate.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% enumerate.4ht                      |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\Hinput{enumerate}
\endinput
>>>        \AddFile{9}{enumerate}

%%%%%%%%%%%%%
\Section{accents.sty}
%%%%%%%%%%%%%

\<accents.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% accents.4ht                        |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config accents|> 
\Hinput{accents}
\endinput
>>>        \AddFile{9}{accents}

\<config accents\><<<
\def\:tempc#1#2{{%
   \let\cc@style\empty 
   \a:accentset #2\b:accentset 
                #1\c:accentset
}}
\HLet\accentset\:tempc
\def\:tempc#1#2{{%
   \let\cc@style\empty 
   \a:underaccent #2\b:underaccent 
                  #1\c:underaccent
}}
\HLet\underaccent\:tempc
\NewConfigure{accentset}{3}
\NewConfigure{underaccent}{3}
>>>

%%%%%%%%%%%%%
\Section{linguex}
%%%%%%%%%%%%%

\<linguex.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% linguex.4ht                        |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config linguex|> 
\Hinput{linguex}
\endinput
>>>        \AddFile{9}{linguex}

\<cgloss4e.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% cgloss4e.4ht                          |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config cgloss4e|> 
\Hinput{cgloss4e}
\endinput
>>>        \AddFile{9}{cgloss4e}

\<config cgloss4e\><<<
\gdef\twosent#1\\ #2\\{%
    \getwords(\lineone,\eachwordone)#1 \\% 
    \getwords(\linetwo,\eachwordtwo)#2 \\% 
    \loop\lastword{\eachwordone}{\lineone}{\wordone}% 
         \lastword{\eachwordtwo}{\linetwo}{\wordtwo}% 
         \global\setbox\gline=\hbox{\unhbox\gline 
                                    \hskip\glossglue 
                                    \vtop{\a:tsent\box\wordone 
                                          \c:tsent 
                                          \box\wordtwo
                                          \b:tsent 
                                         }% 
                                   }% 
         \testdone 
         \ifnotdone 
    \repeat 
    \egroup
   \gl@stop}
\gdef\threesent#1\\ #2\\ #3\\{% 
    \getwords(\lineone,\eachwordone)#1 \\% 
    \getwords(\linetwo,\eachwordtwo)#2 \\% 
    \getwords(\linethree,\eachwordthree)#3 \\% 
    \loop\lastword{\eachwordone}{\lineone}{\wordone}% 
         \lastword{\eachwordtwo}{\linetwo}{\wordtwo}% 
         \lastword{\eachwordthree}{\linethree}{\wordthree}% 
         \global\setbox\gline=\hbox{\unhbox\gline 
                                    \hskip\glossglue 
                                    \vtop{\a:tsent\box\wordone   
                                          \c:tsent
                                          \box\wordtwo 
                                          \c:tsent
                                          \box\wordthree 
                                          \b:tsent
                                         }% 
                                   }% 
         \testdone 
         \ifnotdone 
    \repeat 
    \egroup 
   \gl@stop} 
\NewConfigure{tsent}{3}
>>>

\<config cgloss4e\><<<
\pend:def\gll{\a:gll}
\pend:def\glll{\a:gll}
\NewConfigure{gll}{3}
>>>

\<config cgloss4e\><<<
\def\:tempc{{\hskip -\glossglue}\unhbox\gline\end{flushleft}}
\ifx \gl@stop\:tempc
   \def\:tempc{\b:gll\unhbox\gline\end{flushleft}\c:gll}
   \HLet\gl@stop\:tempc
\fi
>>>

\<config linguex\><<<
\def\:tempc{{\hskip -\glossglue}\unhbox\gline\end{flushleft}% 
         \global\glossfalse% 
         \ifindex\expandafter\lookforwords\fi {} }
\ifx \gl@stop\:tempc
   \def\gl@stop{\b:gll\unhbox\gline\end{flushleft}% 
         \c:gll
         \global\glossfalse% 
         \ifindex\expandafter\lookforwords\fi {} }
\fi
>>>

\<config linguex\><<<
\ifx \o:b:\:UnDef\else \let\b\o:b: \let\o:b:\:UnDef\fi
\def\:tempc.#1\par{\a:ex \o:ex:.#1\par \b:ex}
\HLet\ex\:tempc
\NewConfigure{ex}{2}
>>>

\<config linguex\><<<
\def\a.{\ifindex\firstwordtrue\fi
        \ifnum\theExDepth=0 \unembeddedtrue
        \trivex.\fi
     \csname a:a.list\endcsname
     \refstepcounter{ExDepth}% 
     \begin{list}{\makebox[\labelwidth][l]{% 
         \ifnum\theExDepth=1 \SubExLeftBracket\alph{ABC}\SubExRightBracket%
          \else
           \ifnum\theExDepth=2 %
           \ifdim\currentlabel<\lessthanthousand%
           \ifalignSubEx 
              \llap{\hbox to \alignSubExnegindent{\ifunembedded%
                  \SubExLeftBracket\alph{SubExNo}\SubExRightBracket
                  \else\SubExlabel\fi\hss}}%
            \else\SubExlabel\fi%
              \else\ifunembedded%
                  \SubSubExLeftBracket\roman{SubExNo}\SubSubExRightBracket
                  \else\SubExlabel\fi\fi
            \else
             \ifnum\theExDepth=3 %
             \if@noftnote%\ifunembedded\mbox{$\bullet$!}\else 
                    \SubSubExLeftBracket\roman{SubSubExNo}\SubSubExRightBracket
                    %\fi
               \else\arabic{SubSubExNo}\SubSubExRightBracket\fi
         \fi\fi\fi}}%
    {\labelsep\z@ 
     \ifnum\theExDepth=2\topsep .3\Extopsep\else\topsep 0pt\fi 
     \parsep\z@\itemsep\z@
     \ifnum\theExDepth=1 %
       \usecounter{ABC}%
       \settowidth{\currentlabel}{\theExNo}%
       \listdecl%   
     \else
      \ifnum\theExDepth=2 %
         \usecounter{SubExNo}%
           \ifalignSubEx\ifdim\currentlabel<\lessthanthousand%
           \leftmargin\z@\else\leftmargin=\SubExleftmargin\fi%
           \else\leftmargin=\SubExleftmargin\fi%
         \else
            \ifnum\theExDepth=3 \usecounter{SubSubExNo}\fi
         \leftmargin=\SubSubExleftmargin%
         \fi
    \labelwidth=\leftmargin%
    \fi}%
    \ifnum\theExDepth=1 \setlength{\Exlabelwidth}{4em}\fi%
        %previous line added 2000/12/22
        \b.}
\NewConfigure{a.list}{1}
>>>

%%%%%%%%%%%%%
\Section{Covington}
%%%%%%%%%%%%%

\<covington.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% covington.4ht                        |version %
% Copyright (C) |CopyYear.2009.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config covington|> 
\Hinput{covington}
\endinput
>>>        \AddFile{9}{covington}

\<config covington\><<<
\pend:defI\sentence{\a:sentence}
\append:defI\sentence{\b:sentence}
\NewConfigure{sentence}{2}
>>>

\<config covington\><<<
\bgroup
\catcode`\^^M=12 \endlinechar=-1 % 12 = other
|<covington twosent|>
|<covington threesent|>
\egroup
\NewConfigure{tsent}{3}
\pend:def\gll{\a:gll}
\pend:def\glll{\a:gll}
\NewConfigure{gll}{3}
\def\:tempc{\b:gll\end{flushleft}\c:gll} 
\HLet\glend\:tempc 
>>>

\<config covington\><<<
\def\glt{{\hskip -\glossglue}\unhbox\gline\smallskip\a:glt} 
\NewConfigure{glt}{1}
\def\gln{{\hskip -\glossglue}\unhbox\gline\hfill\a:gln} 
\NewConfigure{gln}{1}
>>>

\<covington twosent\><<<
\gdef\twosent#1^^M#2^^M%
   {\getwords(\lineone,\eachwordone)#1 ^^M%
    \getwords(\linetwo,\eachwordtwo)#2 ^^M%
    \loop\lastword{\eachwordone}{\lineone}{\wordone}%
         \lastword{\eachwordtwo}{\linetwo}{\wordtwo}%
         \global\setbox\gline=\hbox{\unhbox\gline
                                    \hskip\glossglue
                                    \vtop{\a:tsent\box\wordone
                                          \c:tsent
                                          \box\wordtwo
                                          \b:tsent
                                         }%
                                   }%
         \testdone
         \ifnotdone
    \repeat
    \egroup % matches \bgroup in \gloss
}
>>>

\<covington threesent\><<<
\gdef\threesent#1^^M#2^^M#3^^M%
   {\getwords(\lineone,\eachwordone)#1 ^^M%
    \getwords(\linetwo,\eachwordtwo)#2 ^^M%
    \getwords(\linethree,\eachwordthree)#3 ^^M%
    \loop\lastword{\eachwordone}{\lineone}{\wordone}%
         \lastword{\eachwordtwo}{\linetwo}{\wordtwo}%
         \lastword{\eachwordthree}{\linethree}{\wordthree}%
         \global\setbox\gline=\hbox{\unhbox\gline
                                    \hskip\glossglue
                                    \vtop{\a:tsent\box\wordone
                                          \c:tsent
                                          \box\wordtwo
                                          \c:tsent
                                          \box\wordthree
                                          \b:tsent
                                         }%
                                   }%
         \testdone
         \ifnotdone
    \repeat
    \egroup % matches \bgroup in \gloss
   }
>>>

%%%%%%%%%%%%%
\Section{pst-jtree}
%%%%%%%%%%%%%

\<pst-jtree.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% pst-jtree.4ht                        |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config pst-jtree|> 
\Hinput{pst-jtree}
\endinput
>>>        \AddFile{9}{pst-jtree}

\<config pst-jtree\><<<
\pend:def\jtree@a{\csname a:jtree\endcsname\Picture+[jtree]{}}
\append:def\endjtree{\EndPicture \csname b:jtree\endcsname}
\NewConfigure{jtree}{2}
>>>

%%%%%%%%%%%%%%%%%
\Section{diagram (chess)}
%%%%%%%%%%%%%%%%%%

\<diagram.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% diagram.4ht                          |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config diagram|> 
  \let\:EndIgnore\relax
  \def\:Ignore{\bgroup 
     \catcode`\\=12
     \long\def\:temp##1:EndIgnore{\egroup}\:temp
  }
  \ifx \setboardwidth\:UnDef \expandafter\:Ignore\fi
     |<config diagram 08|> 
  \:EndIgnore
  \ifx \setboardwidth\:UnDef \else \expandafter\:Ignore\fi
     |<config diagram 95|>
  \:EndIgnore
\Hinput{diagram}
\endinput
>>>        \AddFile{9}{diagram}

\<config diagram 95\><<<
\def\@dia@stipulation{%
   \a:stipulation
   \bgroup%
   \stipfont%
   \hbox{%
      \a:piececounter
      \if@show@computer%
         C\if@computer +\else --\fi
      \fi%
      \iffigcnt%
         \if@show@computer\ \ \fi{} (\the\w@cnt+\the\b@cnt
                \ifnum\z@<\n@cnt+\the\n@cnt\fi)%
      \fi%
      \b:piececounter
      \if@stipulation \c:stipulation\the
                   \stipulation@tk \d:stipulation\fi
      \ifx@twins \@dia@twins\fi%
      \ifx@cond \@dia@condition\fi%
   }%
   \egroup%
   \b:stipulation
}
>>>

\<config diagram 08\><<<
\def\@dia@stipulation{%
   \if@stipulation%
      \a:stipulation
      \bgroup%
      \stipfont%
      \c:stipulation \the\stipulation@tk \d:stipulation
      \ifx@twins%
         \let\below@newline\@twinskip%
         \@dia@twins%
      \else\ifx@cond%
         \let\below@newline\@twinskip%
         \@dia@condition%
      \fi\fi%
      \egroup%
      \b:stipulation
      \let\below@newline\newline%
   \else%
      \x@twinsfalse%
      \x@condfalse%
      \let\below@newline\relax%
   \fi%
}
\def\put@count{%
   % First we build the box with the figure count
   \ifthenelse{\boolean{piececounter}}{%
        \a:piececounter
        \if@show@computer%
            C\if@computer +\else --\fi
            \ \ 
        \fi%
            (\arabic{cpd@whitePieces}+\arabic{cpd@blackPieces}%
        \ifthenelse{\value{cpd@neutralPieces}>0}{+\arabic{cpd@neutralPieces}}{})%
          \b:piececounter
   }{}%
}
>>>

\<config diagram 95\><<<
\def\put@plane{%
   % We might want gridchess
     \if@stdgrid%
        \@stdgrid%
     \fi%
   % Let us first set the fieldframes
   \if@fieldframe%
      \let\@action\read@square%
      \let\plane@job\set@frame%
      \@addToPlane\fieldframe@tk%
   \fi%
   % Then we should add the gridlines
   \if@gridlines%
      \let\@action\read@plane%
      \let\plane@job\@selGrid%
      \@addToPlane\gridlines@tk%
   \else%
      \if@stereo%
        \stereo@center%
     \fi%
   \fi%
   % Now we should clear the board
   \clear@board%
   % Let us now parse the list of pieces
   \if@pieces%
      \let\@action\p@rsepieces%
      \let\piece@job\l@@k\let\plane@job\set@piece%
      \@parseTokenlist\pieces@tk,%
   \fi%
   % Now we clear all fields, which are given using \nofields
   \if@nofields%
      \let\@action\read@square%
      \let\plane@job\set@nofield%
      \@parseTokenlist\nofields@tk,%
   \fi%
   \global\setbox\plane@box=\hbox{
   % Now we can put the pieces to the board
      \vbox{\IgnorePar\box\plane@box}%
      \vbox{%
        \a:diagram 
        \chessfont%
         \baselineskip=\z@\lineskip=\z@%
         \@rows=\rows@max%
         \multiply\@rows by \lines@max%
         \loop%
            \advance\@rows -\lines@max%
            \tmp:cnt=\@rows \divide\tmp:cnt by 8 \advance\tmp:cnt by 1
            \edef\HRow{\the\tmp:cnt}%
            \c:diagram  \put@line\@rows \d:diagram
         \ifnum\@rows>\z@\repeat%
         \b:diagram
      }%
   }%
}
>>>

\<config diagram 08\><<<
\def\put@plane{%
   % We might want gridchess
     \if@stdgrid%
        \@stdgrid%
     \fi%
   % Let us first set the fieldframes
   \if@fieldframe%
      \let\@action\read@square%
      \let\plane@job\set@frame%
      \@addToPlane\fieldframe@tk%
   \fi%
   % Now we set text to all squares which are given using \fieldtext
   \if@fieldtext%
      \let\@action\p@rsetext%
      \let\plane@job\set@text%
      \@addToPlane\fieldtext@tk%
   \fi%
   % Then we should add the gridlines
   \if@gridlines%
      \let\@action\read@plane%
      \let\plane@job\@selGrid%
      \@addToPlane\gridlines@tk%
   \else%
      \if@stereo%
        \stereo@center%
     \fi%
   \fi%
   % Now we should clear the board
   \clear@board%
   % Let us now parse the list of pieces
   \if@pieces%
      \let\@action\p@rsepieces%
      \let\piece@job\l@@k\let\plane@job\set@piece%
      \@parseTokenlist\pieces@tk,%
   \fi%
   % Now we clear all fields, which are given using \nofields
   \if@nofields%
      \let\@action\read@square%
      \let\plane@job\set@nofield%
      \@parseTokenlist\nofields@tk,%
   \fi%
   % Now we can put the pieces to the board
   \global\setbox\plane@box=\hbox{%
      \vbox{\rlap{\box\plane@box}}%
      \vbox{%
         \a:diagram
         \chessfont%
         \baselineskip=\z@\lineskip=\z@%
         \@rows=\rows@max%
         % \multiply\@rows by \lines@max%
         \loop%
            % \advance\@rows -\lines@max%
            % \put@line\@rows%
            % Remove \put@line in future versions
            \advance\@rows \m@ne%
            \tmp:cnt=\@rows \advance\tmp:cnt by 1
            \edef\HRow{\the\tmp:cnt}%
            \c:diagram \put@row\@rows \d:diagram
         \ifnum\@rows>\z@\repeat%
         \b:diagram 
     }%
   }%
}
>>>

\<config diagram 95\><<<
\def\put@line#1{%
   \lin@\z@%
   \help@b=#1\advance\help@b\brd@ff%
   \hbox{%
      \if@stereo%
         \ifnum\current@plane>\z@%
            \ifnum\@rows=12%
               \llap{\raise .5\sq@width\hbox{\boardfont c6\ }}%
            \fi%
         \fi%
      \fi%
      \hbox to \z@{\vbox to \sq@width{}}%
      \loop%
         \tmp:cnt=\lin@ \advance\tmp:cnt by 1\relax
         \edef\HCol{\the\tmp:cnt}%
         \e:diagram
         \ifnum\count\help@b=\m@ne\wF%
         \else  \char\count\help@b\fi%
         \advance\lin@\@ne\advance\help@b\@ne%
         \f:diagram
      \ifnum\lin@<\lines@max\repeat%
   }%
}
>>>

What \Verb+\put@line+ of the 08 version does?

\<config diagram 08\><<<
\def\put@row#1{%
   \lin@\z@%
   \help@b=#1%
   \advance\help@b\brd@ff%
   \hbox{%
      \if@stereo%
         \ifnum\current@plane>\z@%
            \ifnum\@rows=12%
               \llap{\raise .5\sq@width\hbox{\boardfont c6\ }}%
            \fi%
         \fi%
      \fi%
      \hbox to \z@{\vbox to \sq@width{}}%
      \set@current@square@index{\lin@}{#1}%
      \loop%
         \tmp:cnt=\lin@ \advance\tmp:cnt by 1\relax
         \edef\HCol{\the\tmp:cnt}%
         \e:diagram
         \get@current@square@value%
         \ifthenelse{\value{cpd@current@square@value}=\m@ne}%
          {\wF}%
          {\char\value{cpd@current@square@value}}%
         % \ifnum\count\help@b=\m@ne\wF%
         % \else\char\count\help@b\fi%
         \advance\lin@\@ne%
         \addtocounter{cpd@current@square@index}{1}%
         % \advance\help@b\@ne%
         \f:diagram
      \ifnum\lin@<\lines@max\repeat%
   }%
}
>>>

\<config diagram\><<<
\inner@frame = 0pt
\outer@frame = 0pt

\NewConfigure{diagram}{6}

\NewConfigure{stipulation}{4}

\NewConfigure{piececounter}{2}

\pend:def\@dia@authors{\ifauth@r \a:authors\fi}
\append:def\@dia@authors{\ifauth@r \b:authors \fi}
\NewConfigure{authors}{2}
\pend:def\@dia@condition{\if@condition \a:condition\fi}
\append:def\@dia@condition{\if@condition \b:condition \fi}
\NewConfigure{condition}{2}
\pend:def\@dia@solution{\a:solution}
\append:def\@dia@solution{\b:solution }
\NewConfigure{solution}{2}
\pend:def\@dia@award{\if@award\a:award\fi}
\append:def\@dia@award{\if@award\b:award\fi }
\NewConfigure{award}{2}
\pend:def\@dia@dedic{\if@dedication\a:dedic\fi}
\append:def\@dia@dedic{\if@dedication\b:dedic \fi}
\NewConfigure{dedic}{2}
\pend:def\@dia@number{\ifdi@no\a:number\fi}
\append:def\@dia@number{\ifdi@no\b:number\fi}
\NewConfigure{number}{2}

\pend:def\@dia@twins{\ifauth@r \a:twins\fi}
\append:def\@dia@twins{\ifauth@r \b:twins\fi}
\NewConfigure{twins}{2}
\pend:def\@dia@remark{\ifauth@r \a:remark\fi}
\append:def\@dia@remark{\ifauth@r \b:remark \fi}
\NewConfigure{remark}{2}

\pend:def\dia@above{\a:above}
\append:def\dia@above{\b:above }
\NewConfigure{above}{2}

\pend:def\dia@below{\a:below}
\append:def\dia@below{\b:below }
\NewConfigure{below}{2}

\pend:def\@dia@correction{\if@correction\a:correction\fi}
\append:def\@dia@correction{\if@correction\b:correction\fi }
\NewConfigure{correction}{2}
\def\putsol{\immediate\closeout\s@lfd\input\jobname.sol}%\cl@arsol}
\pend:def\putsol{\HAssign\solNum=0}
\def\showlabel#1{\if@develop\a:showlabel\hbox{\labelfont#1}\b:showlabel\fi}
\NewConfigure{showlabel}{2}

\def\@dia@solution{%
   \bgroup%
   \parindent\z@%
   \csname a:sol-title\endcsname
   {\bf
      \noindent\if@label\showlabel{\the\label@tk}\fi
      \csname a:sol-number\endcsname
      \the\number@tk       \csname b:sol-number\endcsname) %
      \ifauth@r%
         \csname a:sol-author\endcsname
         \ifnormal@names%
            \the\aut@tk%
         \else%
            {\@notfirstfalse% We are the first one
            \let\@action=\@solname%
            \@parseTokenlist\aut@tk;}:%
         \fi%
         \csname b:sol-author\endcsname
      \fi%
   }%
   \if@develop\if@judgement\a:judgement\the\judgement@tk\b:judgement\fi\fi%
   \csname b:sol-title\endcsname
   \par%
   \the\sol@tk\par%
   \if@comment\the\comment@tk\par\fi%
   \egroup%
}
\NewConfigure{judgement}{2}
\NewConfigure{sol-number}{2}
\NewConfigure{sol-author}{2}
\NewConfigure{sol-title}{2}
\def\@dia@source{%
   {\if@source%
      \a:source
      \sourcefont%
      \if@sourcenr\the\sourcenr@tk\ \fi
      \the\source@tk%
      \a:date
      \ifnum\from@month>\z@%
         \if@day%
            \ \ \the\day@tk .\write@month\from@month%
         \else%
            \ \ \write@month\from@month%
         \fi%
         \ifnum\to@month>\z@ -\write@month\to@month\fi%
         \if@day .\else /\fi%
      \else%
         \ \ %
      \fi%
      \if@year\the\year@tk\fi%
      \b:date
      \if@issue /\a:issue\the\issue@tk\b:issue\fi%
      \if@pages ,\ \a:pages\the\pages@tk\b:pages\fi%
      \par%
      \b:source
   \fi}%
}
\NewConfigure{source}{2}
\NewConfigure{source}{2}
\NewConfigure{date}{2}
\NewConfigure{issue}{2}
\NewConfigure{pages}{2}
>>>

%%%%%%%%%%%%%%%%%
\Section{subeqnarray}
%%%%%%%%%%%%%%%%%%

\<subeqnarray.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% subeqnarray.4ht                      |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config subeqnarray|>
\Hinput{subeqnarray}
\endinput
>>>        \AddFile{9}{subeqnarray}

\<config subeqnarray\><<<
\def\:tempc 
   {\stepcounter{equation}\anc:lbl r{equation}% 
    \def\@currentlabel{\p@equation\theequation}% 
    \global\c@subequation\@ne 
    \global\@eqnswtrue\m@th 
    \global\@eqcnt\z@\let\\\@subeqncr 
\def\dd:subeqnarray{\a:subeqnarray
                    \global\let\sv:eqhro=\HRow
                    \gHAssign\HRow=0
                    \gdef\dd:subeqnarray{\d:subeqnarray}}%
\let\halign\TeXhalign
    \subeqn@start 
     \bgroup
         \dd:subeqnarray
         \gHAdvance\HRow by 1
         \c:subeqnarray
         \HAssign\HCol=1
         \e:subeqnarray$\displaystyle\tabskip\z@skip{##}$\f:subeqnarray
         \@eqnsel 
      &\global\@eqcnt\@ne 
         \HAssign\HCol=2
         \hfil\e:subeqnarray${##}$\f:subeqnarray\hfil 
      &\global\@eqcnt\tw@ 
         \HAssign\HCol=3
         \e:subeqnarray$\displaystyle{##}$\f:subeqnarray
         \hfil \tabskip\@centering 
      &\global\@eqcnt\thr@@ 
         \HAssign\HCol=4
         \hbox to\z@\bgroup\hss
         \e:subeqnarray##\f:subeqnarray\egroup\tabskip\z@skip\cr} 
\HLet\subeqnarray\:tempc

\def\:tempc{\@@subeqncr
  \o:noalign:{\d:subeqnarray\b:subeqnarray
              \global\let\HRow=\sv:eqhro}\egroup$$\global\@ignoretrue}
\HLet\endsubeqnarray\:tempc

\def\:tempc{\let\@tempa\relax 
    \ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &} 
      \or \def\@tempa{&}\else 
       \let\@tempa\@empty 
       \@latexerr{Too many columns in subeqnarray environment}\@ehc\fi 
     \@tempa \if@eqnsw\@subeqnnum
         \SkipRefstepAnchor\refstepcounter{subequation}\fi 
     \global\@eqnswtrue\global\@eqcnt\z@\cr} 
\HLet\@@subeqncr\:tempc
\NewConfigure{subeqnarray}{6}
>>>

\<config subeqnarray\><<<
\def\slabel#1{% 
  \@bsphack 
  \if@filesw 
    {\let\thepage\relax 
     \def\protect{\noexpand\noexpand\noexpand}% 
     \a:@newlabel
     \append:def\label:addr{\thesubequation}%
     \Make:Label{\label:addr}{}%
     \edef\@tempa{\write\@auxout{\string 
        \newlabel{#1}{{\a:newlabel\thesubequation}{\thepage}}}}% 
     \expandafter}\@tempa 
     \if@nobreak \ifvmode\nobreak\fi\fi 
  \fi\@esphack} 
>>>

%%%%%%%%%%%%%%%%%%
\Section{eurosym}
%%%%%%%%%%%%%%%%%%

\<eurosym.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% eurosym.4ht                           |version %
% Copyright (C) |CopyYear.2008.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config eurosym|>
\Hinput{eurosym}
\endinput
>>>        \AddFile{9}{eurosym}

\<config eurosym\><<<
\def\:temp{\a:geneuro}
\expandafter\HLet\csname geneuro \endcsname\:temp
\NewConfigure{geneuro}{1}
\def\:temp{\a:geneuronarrow}
\expandafter\HLet\csname geneuronarrow \endcsname\:temp
\NewConfigure{geneuronarrow}{1}
\def\:temp{\a:geneurowide}
\expandafter\HLet\csname geneurowide \endcsname\:temp
\NewConfigure{geneurowide}{1}
>>>

%%%%%%%%%%%%%%%%%%
\Section{SIunits}
%%%%%%%%%%%%%%%%%%

\<SIunits.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% SIunits.4ht                           |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config SIunits|>
\Hinput{SIunits}
\endinput
>>>        \AddFile{9}{SIunits}

\<config SIunits\><<<
\expandafter\def\csname power\endcsname#1#2{\ensuremath 
                                   {\SI@fstyle {#1}\sp {\SI@fstyle {#2}}}} 
\expandafter\def\csname squared\endcsname{\ensuremath {\sp {\mathrm {2}}}} 
\expandafter\def\csname cubed\endcsname{\ensuremath {\sp {\mathrm {3}}}} 
\expandafter\def\csname rpsquared\endcsname{\ensuremath {\sp {\mathrm {-2}}}} 
\expandafter\def\csname rpcubed\endcsname{\ensuremath {\sp {\mathrm {-3}}}} 
\def\:tempc{\a:degree}
\HLet\degree\:tempc
\NewConfigure{degree}{1}
\Configure{degree}
   {\ensuremath {\SI@fstyle {\no@qsk \ensuremath {\sp{\circ }}}}}
>>>

%%%%%%%%%%%%%%%
\Section{Siunitx}

\<siunitx.4ht\><<<
% siunitx.4ht (|version), generated from |jobname.tex
% Copyright 2021-2024 TeX Users Group
|<TeX4ht license text|>
|<siunitx require color|>
\ExplSyntaxOn
|<siunitx ang|>
|<siunitx disable tight space|>
|<siunitx disable S columns|>
\ExplSyntaxOff
\Hinput{siunitx}
\endinput
>>> \AddFile{9}{siunitx}

In the ODT output, Siunitx leads to some catcode errors. It is caused by
requiring of the Color package at begin document. The simple fix for
that is to require color earlier.

\<siunitx require color\><<<
\RequirePackage{color}
>>>

This should bring support for the \Verb+\ang+ command, which can be used
to input angles.

\<siunitx ang\><<<
\cs_set_protected:Npn \__siunitx_angle_arc_print_auxv_fourht:w
  #1 \q_nil #2 \q_nil #3 \q_nil #4 \q_nil #5 \q_nil #6 \q_stop
{\bgroup\siunitx_print_number:n {#1#2#3#4#5}\egroup}

\HLet\__siunitx_angle_arc_print_auxv:w\__siunitx_angle_arc_print_auxv_fourht:w


\cs_set_protected:Npn \__siunitx_angle_arc_print_auxvi_fourht:n #1
{
  % we need to define these commands here
  \def\degree{\ht:special{t4ht@+&{35}x2218;}x}
  \def\arcminute{\prime}
  \def\arcsecond{\prime\prime}
  \ensuremath{\NoFonts\sp{#1}\EndNoFonts}
}

\HLet\__siunitx_angle_arc_print_auxvi:n\__siunitx_angle_arc_print_auxvi_fourht:n 
>>>

It seems that the tight-spacing option can cause errors with TeX4ht. 
We disable the boolean that is set by this option to prevent that. 

\<siunitx disable tight space\><<<
% https://tex.stackexchange.com/q/707485/2891
\bool_set_false:N \l__siunitx_number_tight_bool
>>>

Siunitx provides special column specification in tables. It enables alignment
of cells based on the floating point of numbers. Unfortunatelly, it
also completelly breaks TeX4ht table processing, so tables that use
it come out as a complete mess. 

\<siunitx disable S columns\><<<
% disable S columns for tables
% https://tex.stackexchange.com/q/707485/2891
\cs_set_protected:Npn \siunitx_cell_begin:w {}
\cs_set_protected:Npn \siunitx_cell_end: {}
>>>

%%%%%%%%%%%%%%%
\Section{Mhchem}
%%%%%%%%%%%%%%%

\<mhchem.4ht\><<<
% mhchem.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
% Copyright 2015-2021 Martin Hensel
|<TeX4ht license text|>
|<mhchem redefinitions|>

\Hinput{mhchem}
\endinput
>>> \AddFile{9}{mhchem}

\<mhchem redefinitions\><<<
\ExplSyntaxOn
% basic mhchem containers
\NewConfigure{mhchemce}{2}
\NewConfigure{mhchemcf}{2}

\pend:def\__mhchem_output_begin_ce:{\a:mhchemce}
\append:def\__mhchem_output_end_ce:{\b:mhchemce}
\pend:def\__mhchem_output_begin_cf:{\a:mhchemcf}
\append:def\__mhchem_output_end_cf:{\b:mhchemcf}

% alternative version of coreFivd

\NewConfigure{mhchemisotope}{3}

\NewConfigure{mhchemsub}{2}

\NewConfigure{mhchemsup}{2}

\NewConfigure{mhchemsupsub}{3}

\cs_set_protected:Npn \__mhchem_output_coreFivefourht:nnnnnnn #1#2#3#4#5#6#7
  {
    \bool_if:nT
      { \tl_if_empty_p:n {#7}  &&  ! \tl_if_empty_p:n {#5} }
      { \bool_set_true:N \l__mhchem_option_superscriptsStacked_bool }
      
    \tl_if_empty:nF {#1#2} 
      {
        \a:mhchemisotope
        \__mhchem_output_withFont:n { #1 } 
        \b:mhchemisotope
        \__mhchem_output_withFont:n { #2 }
        \c:mhchemisotope
      }
    \__mhchem_output_withFont:n { #3 } 
    \bool_if:NTF \l__mhchem_option_superscriptsStacked_bool
      {
        \tl_if_empty:nTF {#4#5#7} 
          {
            \tl_if_empty:nF {#6}
              {
                \a:mhchemsub
                \__mhchem_output_withFont:n { #6 }
                \b:mhchemsub
              }
          }
          {
            \tl_if_empty:nTF {#6}
              {
                \a:mhchemsup
                \__mhchem_output_withFont:n { #4#5#7 }
                \b:mhchemsup
              }
              { 
                \a:mhchemsupsub
              	\__mhchem_output_withFont:n { #4#5#7 }
                \c:mhchemsupsub
              	\__mhchem_output_withFont:n { #6 }
                \b:mhchemsupsub
             }
          }
      }
      {
        \tl_if_empty:nF {#4}
          {
            \a:mhchemsup
            \__mhchem_output_withFont:n { #4 }
            \b:mhchemsup
          }
		\tl_if_empty:nF {#6}
		  { 
            \a:mhchemsub
            \__mhchem_output_withFont:n { #6 }
            \b:mhchemsub
		  }
        \tl_if_empty:nF {#5#7} 
          { 
            \a:mhchemsup
            \__mhchem_output_withFont:n { #5#7 }
            \b:mhchemsup
          }
      }
  }

% replace original coreFive with our alternative version. it will work in picture math
\HLet\__mhchem_output_coreFive:nnnnnnn\__mhchem_output_coreFivefourht:nnnnnnn

\cs_set_protected:Npn \__mhchem_output_withFontfourht:n #1  %. output #1 as math or text
  {
    \bool_if:NTF \l__mhchem_output_isMathMode_bool
      { \begingroup\mathrm {#1}\endgroup }
      { \begingroup\text {#1}\endgroup }
  }

\HLet\__mhchem_output_withFont:n\__mhchem_output_withFontfourht:n

\NewConfigure{mhchemoperator}{2}

\def\:tempa#1#2{%
 \cs_set_protected:Npn\:tempb:{#2}%
 \HLet#1\:tempb:%
}

\:tempa \__mhchem_output_skipAfterAmount: {\HCode { ~ } }  % space for copy & paste
\:tempa \__mhchem_output_skipBeforeStateOfAggregation: {}
\:tempa \__mhchem_output_minus: {\HCode{&\#x2212;}} % minus
\:tempa \__mhchem_output_operatorPlus:{ \HCode {\a:mhchemoperator + \b:mhchemoperator  }}
\:tempa \__mhchem_output_operatorMinus:{ \HCode {\a:mhchemoperator&\#x2212; \b:mhchemoperator }} % minus
\:tempa \__mhchem_output_operatorEquals:{ \HCode {\a:mhchemoperator =  \b:mhchemoperator }}
\:tempa \__mhchem_output_operatorPlusMinus:{\HCode {\a:mhchemoperator &\#xB1; \b:mhchemoperator }} % plusmn
\:tempa \__mhchem_output_electronDot: { \HCode {&\#x2022;} } % bull
\:tempa \__mhchem_output_additionCompound: { \HCode {&\#xB7;} } % middot
\:tempa \__mhchem_output_excited: { \HCode { &\#x2731; } }
\:tempa \__mhchem_output_commaDecimal: { , }
\:tempa \__mhchem_output_commaEnumeration: {,\HCode {&\#x2009;} } % thinsp
\:tempa \__mhchem_output_commaEnumerationSmall: {,\HCode{&\#x2009;} } % thinsp

\:tempa \__mhchem_output_bond_single: { \HCode { \a:mhchemoperator&\#x2212;\b:mhchemoperator}}
\:tempa \__mhchem_output_bond_double: { \HCode { \a:mhchemoperator=\b:mhchemoperator}}
\:tempa \__mhchem_output_bond_triple: { \HCode { \a:mhchemoperator&\#x2261;\b:mhchemoperator}}
            
% todo: add MathML support for these
\:tempa \__mhchem_output_bond_half:{\a:mhchembondhalf}
\:tempa \__mhchem_output_bond_oneAndHalf:{\a:mhchembondoneandhalf}
\:tempa \__mhchem_output_bond_twoAndHalf:{\a:mhchembondtwoandhalf}
\:tempa \__mhchem_output_bond_twoAndHalff:{\a:mhchembondtwoandhalff}

\:tempa \__mhchem_output_bond_dotdotdot: { \HCode { &\#xB7;&\#xB7;&\#xB7;} } % &middot;&middot;&middot; 
\:tempa \__mhchem_output_bond_dotdotdotdot: { \HCode { &\#xB7;&\#xB7;&\#xB7;&\#xB7;} } %  &middot;&middot;&middot;&middot; 
\:tempa \__mhchem_output_bond_rightArrow: { \HCode {\a:mhchemoperator &\#x2192;\b:mhchemoperator } }
\:tempa \__mhchem_output_bond_leftArrow: {\HCode {\a:mhchemoperator &\#x2190;\b:mhchemoperator }}


\NewConfigure{mhchembondhalf}{1}
\NewConfigure{mhchembondoneandhalf}{1}
\NewConfigure{mhchembondtwoandhalf}{1}
\NewConfigure{mhchembondtwoandhalff}{1}


\NewConfigure{mhchemarrow}{2}
\NewConfigure{mhchemarrowabove}{2}

\NewConfigure{mhchemarrowyields}{1}
\NewConfigure{mhchemarrowyieldsLeft}{1}
\NewConfigure{mhchemarrowyieldsLeftRight}{1}
\NewConfigure{mhchemarrowmesomerism}{1}
\NewConfigure{mhchemarrowequilibrium}{1}
\NewConfigure{mhchemarrowequilibriumRight}{1}
\NewConfigure{mhchemarrowequilibriumLeft}{1}




\cs_set_protected:Npn \__mhchem_arrow_deployfourht:nnnnn #1#2#3#4#5
  {
    \a:mhchemarrow
    \tl_if_empty:nF {#3#5}
      {
        \a:mhchemarrowabove
        \str_case:nnF {#2}
          {
            {   } { \ce { #3 } }
            { M } { \ensuremath { #3 } }
            { T } { \text { #3 } }
            { C } { \ce { #3 } }
          }
          { \msg_error:nnn { mhchem } { unexpected-arrow-type } {#2} }
          \b:mhchemarrowabove
      }
    \str_case:nnF {#1}
      {
        { yields } {\a:mhchemarrowyields }
        { yieldsLeft } {\a:mhchemarrowyieldsLeft }
        { yieldsLeftRight } {\a:mhchemarrowyieldsLeftRight }  % todo: improve
        { esomerism } {\a:mhchemarrowesomerism }  % todo: improve
        { equilibrium } {\a:mhchemarrowequilibrium }  % todo: improve
        { equilibriumRight } {\a:mhchemarrowequilibriumRight }  % todo: improve
        { equilibriumLeft } {\a:mhchemarrowequilibriumLeft }  % todo: improve
      }
      { \msg_error:nnn { mhchem } { unexpected-arrow-type } {#1} }
    \tl_if_empty:nF {#3#5}
      {
        \a:mhchemarrowabove
        \str_case:nnF {#2}
          {
            {   } { \ce { #5 } }
            { M } { \ensuremath { #5 } }
            { T } { \text { #5 } }
            { C } { \ce { #5 } }
          }
          { \msg_error:nnn { mhchem } { unexpected-arrow-type } {#2} }
        \b:mhchemarrowabove
      }
    \b:mhchemarrow
  }

\HLet\__mhchem_arrow_deploy:nnnnn\__mhchem_arrow_deployfourht:nnnnn
  
\ExplSyntaxOff


% Additional configurations for MathML

% print mathml command or html, depending on if we are inside mathml or not
\newcommand\:mhmathmlorhtml[2]{\ifmathml\a:mathml #1\else #2\fi}
\newcommand\:mhonlyinmathml[1]{\ifmathml #1\fi}


>>>

%%%%%%%%%%%%%%%
\Section{Chemfig}
%%%%%%%%%%%%%%%

\<chemfig.4ht\><<<
% chemfig.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
|<chemfig redefinitions|>

\Hinput{chemfig}
\endinput
>>> \AddFile{9}{chemfig}

The chemname command should print label under chemical diagram, so we need to
envelop both of these elements in hooks, to handle this structure in the configuration 
for output formats.

\<chemfig redefinitions\><<<
\ExplSyntaxOn
\NewConfigure{chemname}{3}
\def\:tempa[#1]#2#3{%
	\setbox\CF_boxstuff\hbox{#2}%
	\edef\CF_wdstuffbox{\the\wd\CF_boxstuff}\edef\CF_dpstuffbox{\the\dp\CF_boxstuff}%
	\leavevmode
	\ifdim\CF_dpmax<\CF_dpstuffbox
		\ifboolKV[chemfig]{gchemname}\global{}\let\CF_dpmax\CF_dpstuffbox
	\fi
  \a:chemname
	\vtop{%
		\box\CF_boxstuff
		\nointerlineskip
		\kern\dimexpr#1\ifCF_adjust_name_dp+\CF_dpmax-\CF_dpstuffbox\fi\relax
    \b:chemname
		\CF_parsemolname#3\\\_nil
	}%
  \c:chemname
}
\HLet\CF_chemnameb\:tempa
\ExplSyntaxOff
>>>

%%%%%%%%%%%%%%%
\Section{Esvect}
%%%%%%%%%%%%%%%

\<esvect.4ht\><<<
% esvect.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
|<esvect redefinitions|>

\Hinput{esvect}
\endinput
>>> \AddFile{9}{esvect}


\<esvect redefinitions\><<<
>>>


%%%%%%%%%%%%%
\Section{Ushort}
%%%%%%%%%%%%%

\<sistyle.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% sistyle.4ht                           |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config sistyle|>
\Hinput{sistyle}
\endinput
>>>        \AddFile{9}{sistyle}

\<config sistyle\><<<
\def\:tempc{{\a:thousandsep}}
\HLet\SI@thousandsep\:tempc
\NewConfigure{thousandsep}{1}
\Configure{thousandsep}{\,}
>>>

\<config sistyle\><<<
\def\SI@numexp#1#2{% 
   \SI@ifempt{#1}{}{% 
      \def\SI@tmpb{#1}% 
      \ifx\SI@tmpb\SI@p@tst\ensuremath{+}\else 
      \ifx\SI@tmpb\SI@m@tst\ensuremath{-}\else 
         \SI@realp{#1}{}\SI@prod% 
      \fi\fi}% 
   \ifmmode 
     {10}\sp{\SI@realp{#2}{}}% 
   \else 
     {10}\textsuperscript{\SI@realp{#2}{}}% 
   \fi
}
>>>

\<config sistyle\><<<
\AtBeginDocument{%
    \@ifpackageloaded{textcomp}{}{%
         \def\degC{%
             \ensureupmath{{\csname HCode\endcsname{}}\sp
                                        {\circ}\kern-\scriptspace C}}%
         \def\degF{%
             \ensureupmath{{\csname HCode\endcsname{}}\sp
                                        {\circ}\kern-\scriptspace F}}%
         \def\arcdeg{\ensureupmath{{\csname HCode\endcsname{}}\sp{\circ}}}%
    }%
   \def\:tempc{\a:degC}%
   \HLet\degC\:tempc
   \def\:tempc{\a:degF}%
   \HLet\degF\:tempc
   \def\:tempc{\a:arcdeg}%
   \HLet\arcdeg\:tempc
   \def\arcsec{\ensureupmath{{\csname HCode\endcsname{}}\sp{\prime\prime}}}%
   \def\:tempc{\a:arcsec}%
   \HLet\arcsec\:tempc
   \def\arcmin{\ensureupmath{{\csname HCode\endcsname{}}\sp{\prime}}}%
   \def\:tempc{\a:arcmin}%
   \HLet\arcmin\:tempc
   \def\:tempc{\a:ohm}%
   \HLet\ohm\:tempc
   \def\:tempc{\a:micro}%
   \HLet\micro\:tempc
   \def\:tempc{\a:angstrom}%
   \HLet\angstrom\:tempc
}
\NewConfigure{degC}{1}
\Configure{degC}{\o:defC:}
\NewConfigure{degF}{1}
\Configure{degF}{\o:defF:}
\NewConfigure{arcdeg}{1}
\Configure{arcdeg}{\o:arcdeg:}
\NewConfigure{arcsec}{1}
\Configure{arcsec}{\o:arcsec:}
\NewConfigure{arcmin}{1}
\Configure{arcsec}{\o:arcmin:}
\NewConfigure{ohm}{1}
\Configure{ohm}{\o:ohm:}
\NewConfigure{micro}{1}
\Configure{micro}{\o:micro:}
\NewConfigure{angstrom}{1}
\Configure{angstrom}{\o:angstrom:}
>>>

%%%%%%%%%%%%%
\Section{Ushort}
%%%%%%%%%%%%%

\<ushort.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ushort.4ht                            |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config ushort|>
\Hinput{ushort}
\endinput
>>>        \AddFile{9}{ushort}

\<config ushort\><<<
\def\:tempc#1{\relax\ifvmode\leavevmode\fi 
   \a:ushort \o:ushort:{#1}\b:ushort} 
\HLet\ushort\:tempc 
\NewConfigure{ushort}{2} 
\def\:tempc#1{\relax\ifvmode\leavevmode\fi 
   \a:ushortw \o:ushortw:{#1}\b:ushortw} 
\HLet\ushortw\:tempc 
\NewConfigure{ushortw}{2} 
\def\:tempc#1{\relax\ifvmode\leavevmode\fi 
   \a:ushortd \o:ushortd:{#1}\b:ushortd} 
\HLet\ushortd\:tempc 
\NewConfigure{ushortd}{2} 
\def\:tempc#1{\relax\ifvmode\leavevmode\fi 
   \a:ushortdw \o:ushortdw:{#1}\b:ushortdw} 
\HLet\ushortdw\:tempc 
\NewConfigure{ushortdw}{2} 
\def\:tempc#1{\relax\ifvmode\leavevmode\fi 
   \a:ushortdline \o:ushortdline:{#1}\b:ushortdline} 
\HLet\ushortdline\:tempc 
\NewConfigure{ushortdline}{2} 
>>>

%%%%%%%%%%%%%
\Section{Chapterbib}
%%%%%%%%%%%%%

\<chapterbib.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% chapterbib.4ht                        |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<disable chapterbib|>
\Hinput{chapterbib}
\endinput
>>>        \AddFile{9}{chapterbib}

%%%%%%%%%%%%%
\Section{microtype.sty}
%%%%%%%%%%%%%

\<microtype.4ht\><<<
% microtype.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2007. Eitan M. Gurari
|<TeX4ht copywrite|>
  |<disable microtype|>
  |<microtype textls|>
\Hinput{microtype}
\endinput
>>>        \AddFile{9}{microtype}

\<disable microtype\><<< 
\MT@protrusionfalse 
\MT@expansionfalse 
\let\MT@setupfont\relax 
\let\microtypesetup\@gobble 
\renewcommand{\UseMicroTypeSet}[2][]{} 
\renewcommand{\SetProtrusion}[3][]{} 
\renewcommand{\SetExpansion}[3][]{} 
>>>

We can try to provide a letterspacing command:

\<microtype textls\><<<
\NewConfigure{textls}{2}
\ExplSyntaxOn
\ifx\MT@letterspace\m@ne
\edef\:letterspacedefault{\fp_eval:n{\MT@letterspace@default/1000}}
\else
\edef\:letterspacedefault{\fp_eval:n{\MT@letterspace/1000}}
\fi
\providecommand\:textls[2][]{%
  \begingroup%
    \ifx\relax#1\relax\else%
      \edef\:letterspacing{\fp_eval:n{#1/1000}}%
    \fi%
    \a:textls%
    #2%
    \b:textls%
  \endgroup%
}
\ExplSyntaxOff
\HLet\MT@textls\:textls
>>>
%%%%%%%%%%%%%
\Section{Bm.sty}
%%%%%%%%%%%%%

\<bm.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% bm.4ht                                |version %
% Copyright (C) |CopyYear.2005.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<bm configurations|>
\Hinput{bm}
\endinput
>>>        \AddFile{9}{bm}

\<bm configurations\><<<
\def\:tempc#1{\expandafter\a:bm\csname o:bm :\endcsname{#1}\b:bm} 
\expandafter\HLet\csname bm \endcsname\:tempc 
\NewConfigure{bm}{2}
>>>

The bm commands produces bold printing by overprinting the characters
with small  shifting.

%%%%%%%%%%%%%
\Section{Beton.sty}
%%%%%%%%%%%%%

\<beton.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% beton.4ht                             |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<beton configurations|>
\Hinput{beton}
\endinput
>>>        \AddFile{9}{beton}

\<beton configurations\><<<
\AtBeginDocument  
   {\let\@setfontsize =\beton@old@setfontsize 
    \let\beton@new@setfontsize=\beton@old@setfontsize}  
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{everyshi(pment)}

\<everyshi.4ht\><<<
% everyshi.4ht (|version), generated from |jobname.tex
% Copyright (C) |CopyYear.2004. Eitan M. Gurari
|<TeX4ht copywrite|>
  |<everyshi configurations|>
\Hinput{everyshi}
\endinput
>>>        \AddFile{9}{everyshi}

\<everyshi configurations\><<<
\let\@EveryShipout@Init\empty
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
\Section{quoting.4ht}

\<quoting.4ht\><<<
% quoting.4ht (|version), generated from |jobname.tex
% Copyright 2015 TeX Users Group
|<TeX4ht license text|>
\newtoks\quoting@parht
\NewConfigure{quoting}{2}
\Configure{quoting}
{\ifvmode \IgnorePar\fi \EndP\HCode{<blockquote>}\HtmlParOn}
{\ifvmode \IgnorePar\fi \EndP\HCode{</blockquote>}\HtmlParOn\par}

\ConfigureEnv{quoting}
{\quoting@parht=\everypar%
\a:quoting\par\ShowPar}
{\par%
\b:quoting%
\everypar=\quoting@parht\par\ShowPar}
{}{}

\ConfigureList{quoting}{}{}
{%
\everypar=\quoting@parht\par\ShowPar%
}{}
\endinput
\Hinput{quoting}
>>>        \AddFile{9}{quoting}

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{titling}

\<titling.4ht\><<<
% tex4ht.4ht (|version), generated from |jobname.tex
% Copyright 2019 TeX Users Group
|<TeX4ht license text|>
|<titling configurations|>
\Hinput{titling}
\endinput
>>>     \AddFile{9}{titling}


\<titling configurations\><<<
\let\titling:maketitle\maketitle
\def\new:titling:maketitle{\titling:maketitle\let\maketitle\new:titling:maketitle}
\def\maketitle{\new:titling:maketitle}
>>>


%%%%%%%%%%%%%%%%%%%%%%%%
\Section{appendix}

\<appendix.4ht\><<<
% appendix.4ht (|version), generated from |jobname.tex
% Copyright 2019 TeX Users Group
|<TeX4ht license text|>
\renewcommand{\@chap@pppage}{%
  \chapter*{\appendixpagename}
}

\renewcommand{\@sec@pppage}{%
  \section*{\appendixpagename}
  \nobreak
  \@afterheading
}

\ifdefined\theHchapter\else\newcommand\theHchapter{\Alph{chapter}}\fi
\ifdefined\theHsection\else\newcommand\theHsection{\Alph{section}}\fi
\Hinput{appendix}
\endinput
>>> \AddFile{9}{appendix}

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{res}

\<res.4ht\><<<
% res.4ht                               |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  \Hinclude{\input res-a.4ht}{article} 
\endinput
>>>        \AddFile{9}{res}

\<res-a.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% res-a.4ht                             |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<res cfg|>
\Hinput{res}
\endinput
>>>        \AddFile{9}{res-a}

\<res cfg\><<<
\def\section{\no:section}
\csname pend:def\endcsname\endresume{%
  \csname d:section\endcsname
  \global\expandafter\let\csname d:section\endcsname\empty
}
\Configure{section}
   {\ifx \@@section\boxed@sectiontitle \csname a:boxed-section\endcsname
    \else \csname a:overlapped-section\endcsname \fi }
   {\ifx \@@section\boxed@sectiontitle \csname b:boxed-section\endcsname
    \else \csname b:overlapped-section\endcsname \fi }
   {\ifx \@@section\boxed@sectiontitle \csname c:boxed-section\endcsname
    \else \csname c:overlapped-section\endcsname \fi }
   {\ifx \@@section\boxed@sectiontitle \csname d:boxed-section\endcsname
    \else \csname d:overlapped-section\endcsname \fi }
\NewConfigure{overlapped-section}{4}
\NewConfigure{boxed-section}{4}
>>>

\<res cfg\><<<
\let\:temp\empty
\ifx \print@name\@printcentername 
   \def\:temp{\let\print@name\@printcentername}
\fi
\ifx \print@name\@linename 
   \def\:temp{\let\print@name\@linename}
\fi
   |<center name|>
   |<line name|>
\:temp
\NewConfigure{centername}{2}
\NewConfigure{centeraddresses}{5}
\NewConfigure{linename}{2}
\NewConfigure{lineaddress}{3}
>>>

\<center name\><<<
\def\@printcentername{\begingroup
  \a:centername\hbox{\@tablebox{\namefont\@name}}\b:centername
  \@ifundefined{@addressone}{}{%
    \@ifundefined{@addresstwo}{
      \a:centeraddresses
      \hbox{\@tablebox{\@addressone}}\b:centeraddresses
    }{
      \c:centeraddresses
      \hbox{\@tablebox{\@addressone}}\d:centeraddresses
      \hbox{\@tablebox{\@addresstwo}}\e:centeraddresses
    }%
  }%
  \endgroup}
>>>

\<line name\><<<
\def\@linename{\begingroup
  \def\\{, }%
  \a:linename{\namefont\@name}\b:linename
  \@ifundefined{@addressone}{}{%
      \a:lineaddress\hbox{\@addressone}\b:lineaddress
                    \hbox{\@addresstwo}\c:lineaddress
  }
\endgroup}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{algorithmic}
%%%%%%%%%%%%%%%%%%%%%%%%

\<algorithmic.4ht\><<<
% algorithmic.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2003. Eitan M. Gurari
|<TeX4ht copywrite|>
|<algorithmic cfg|>
\Hinput{algorithmic}
\endinput
>>>        \AddFile{9}{algorithmic}

\<algorithmic cfg\><<<
\append:def\algorithmicthen{%
    \ConfigureEnv{ALC@if}
      {\a:ALCif}
      {\b:ALCif}
      {}{}%
}
\append:def\algorithmicelse{%
    \ConfigureEnv{ALC@if}
      {\c:ALCif}
      {\d:ALCif}
      {}{}%
}
\NewConfigure{ALCif}{4}
\pend:defI\algorithmiccomment{\a:algorithmiccomment}
\append:defI\algorithmiccomment{\b:algorithmiccomment}
\NewConfigure{algorithmiccomment}{2}
\let\ALC:item=\ALC@item
\def\ALC@item[#1]{\ALC:item[\a:ALCitem #1\b:ALCitem]}
\NewConfigure{ALCitem}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{algorithmicx}
%%%%%%%%%%%%%%%%%%%%%%%%

\<algorithmicx.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% algorithmicx.4ht                      |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<algorithmicx cfg|>
\Hinput{algorithmicx}
\endinput
>>>        \AddFile{9}{algorithmicx}

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{algorithm}
%%%%%%%%%%%%%%%%%%%%%%%%

\<algorithm.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% algorithm.4ht                         |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<algorithm cfg|>
\Hinput{algorithm}
\endinput
>>>        \AddFile{9}{algorithm}

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{booktabs.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<booktabs.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% booktabs.4ht                          |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\ifx \@BTfnslthree\:UnDef
   |<pre booktabs 2003|>
\else
   \def\:temp{\hrule 
      \@height \@thisrulewidth\futurenonspacelet\@tempa\@BTendrule}
   \ifx \@BTnormal\:temp
      |<pre booktabs 2005|>
   \else
      |<booktabs 2005|>
   \fi
   |<booktabs 2003|>
\fi
|<shared booktabs|>
\Hinput{booktabs}
\endinput
>>>        \AddFile{9}{booktabs}

\<shared booktabs\><<<
\def\:temp{\o:noalign:{\ifnum0=`}\fi
    \@ifnextchar[{\@addspace}{\@addspace[\defaultaddspace]}}
\HLet\addlinespace=\:temp
>>>

\<pre booktabs 2005\><<<
\def\@BTnormal{\hbox{\cur:rule}\futurenonspacelet\@tempa\@BTendrule}
\def\@cmidrulea{\multispan\@cmidla&\multispan\@cmidlb \a:cmidrule \hfill \cr} 
\def\@cmidruleb{\multispan\@cmidlb \a:cmidrule \hfill \cr} 
>>>

\<booktabs 2005\><<<
\def\:tempc{% 
    %{\CT@arc@\hrule\@height\@thisrulewidth}% 
    \hbox{\cur:rule}\futurenonspacelet\@tempa\@BTendrule} 
\HLet\@BTnormal\:tempc
\def\:tempc{% 
   \multispan\@cmidla&\multispan\@cmidlb 
   \a:cmidrule
   \unskip\hskip\cmrkern@l% 
   %{\CT@arc@\leaders\hrule \@height\@thisrulewidth\hfill}% 
   \hskip\cmrkern@r\cr}% 
\HLet\@cmidrulea\:tempc
\def\:tempc{% 
    \multispan\@cmidlb 
    \a:cmidrule
    \unskip\hskip \cmrkern@l% 
    %{\CT@arc@\leaders\hrule \@height\@thisrulewidth\hfill}% 
    \hskip\cmrkern@r\cr}% 
\HLet\@cmidruleb\:tempc
>>>

\<booktabs 2003\><<<
\def\gobble:if#1\fi{}

\let\:tempc\toprule
\pend:def\:tempc{\o:noalign:{\ifnum0=`}\fi
   \let\cur:rule\a:toprule
   \gobble:if}
\HLet\toprule=\:tempc
\NewConfigure{toprule}{1}

\let\:tempc\midrule
\pend:def\:tempc{\o:noalign:{\ifnum0=`}\fi
   \let\cur:rule\a:midrule
   \gobble:if}
\HLet\midrule=\:tempc
\NewConfigure{midrule}{1}

\let\:tempc\bottomrule
\pend:def\:tempc{\o:noalign:{\ifnum0=`}\fi 
  \let\cur:rule\a:bottomrule
  \gobble:if}
\HLet\bottomrule=\:tempc
\NewConfigure{bottomrule}{1}
>>>

\<booktabs 2003\><<<
\def\@@BLTrule(#1){\@setrulekerning{#1}% 
\global\@cmidlb\LT@cols 
\ifnum0=`{\fi}% 
\@cmidruleb 
\o:noalign:{\ifnum0=`}\fi 
\futurenonspacelet\@tempa\@BTendrule} 
>>>

\<pre booktabs 2003\><<<
\def\:temp{\o:noalign:{\ifnum0=`}\fi
   \let\A:midrule=\a:midrule
   \@ifnextchar[{\@midrule}{\@midrule[\lightrulewidth]}}
\HLet\midrule=\:temp
\def\:temp[#1]{\o:@midrule:[\z@\A:midrule]}
\HLet\@midrule=\:temp
\NewConfigure{midrule}{1}

\def\:temp{\o:noalign:{\ifnum0=`}\fi
    \@ifnextchar[{\@toprule}{\@toprule[\heavyrulewidth]}}   
\HLet\toprule=\:temp
\def\:temp[#1]{\o:@toprule:[\z@\a:toprule]}
\HLet\@toprule=\:temp
\NewConfigure{toprule}{1}

\def\:temp{\o:noalign:{\ifnum0=`}\fi
   \let\A:midrule=\a:bottomrule
    \@ifnextchar[{\@midrule}{\@midrule[\heavyrulewidth]}}      
\HLet\bottomrule=\:temp
\NewConfigure{bottomrule}{1}
>>>

\<shared booktabs\><<<
\def\:temp#1#2#3{\o:noalign:{\a:specialrule}}
\HLet\specialrule=\:temp
\NewConfigure{specialrule}{1}

\def\:temp{\o:noalign:{\ifnum0=`}\fi
    \@ifnextchar[{\@cmidrule}{\@cmidrule[\cmidrulewidth]}}
\HLet\cmidrule=\:temp
\NewConfigure{cmidrule}{1}  

\def\:temp{\o:noalign:{\relax}} 
\HLet\morecmidrules=\:temp
\NewConfigure{morecmidrules}{1}
>>>

\<booktabs 2003\><<< 
\def\@@@cmidrule[#1-#2]#3#4{\global\@cmidla#1\relax 
    \global\advance\@cmidla\m@ne 
    \ifnum\@cmidla>0\global\let\@gtempa\@cmidrulea\else 
    \global\let\@gtempa\@cmidruleb\fi 
    \global\@cmidlb#2\relax 
    \global\advance\@cmidlb-\@cmidla 
    \global\@thisrulewidth=#3
    \@setrulekerning{#4} 
    \ifnum\@lastruleclass=\z@\vskip \aboverulesep\fi 
    \ifnum0=`{\fi}\@gtempa 
    \o:noalign:{\ifnum0=`}\fi\futurenonspacelet\@tempa\@xcmidrule} 
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{tocloft.sty}
%%%%%%%%%%%%%%%%%%%%%

Just turn off tocloft tables of contents. For details, see
\Link[http://tex.stackexchange.com/q/190991/2891]{}{} this item on
TeX.sx\EndLink and the
\Link[http://puszcza.gnu.org.ua/bugs/?220]{}{}tex4ht bug report\EndLink.
Contributed by Michal Hoftich.

\<tocloft.4ht\><<<
% tocloft.4ht (|version), generated from |jobname.tex
% Copyright 2014-2015 TeX Users Group
|<TeX4ht license text|>
|<tocloft.sty|>
\Hinput{tocloft}
\endinput
>>>       \AddFile{9}{tocloft}

\<tocloft.sty\><<<
\@cftnctoctrue
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{minitoc.sty}
%%%%%%%%%%%%%%%%%%%%%

\<minitoc.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% minitoc.4ht                           |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

  |<minitoc.sty|>
\Hinput{minitoc}
\endinput
>>>        \AddFile{7}{minitoc}

\<minitoc.sty\><<<
|<minitoc.sty Configure|>
\let\minitoc:\minitoc@
\def\minitoc@[#1]{%
   \a:minitoc@
   \minitoc:[#1]
   \b:minitoc@
} 
\NewConfigure{minitoc@}{2}
>>>

%%%%%%%%%%%%%%%%%%%5
\SubSection{Part tocs}
%%%%%%%%%%%%%%%%%%%%

\<fix minitoc\><<<
\def\parttoc@[#1]{{\mini:opt{#1}\parttoc:ttl \a:parttoc
  \csname gobble:\TocOption\endcsname{\c:parttoc
     \ptifont \ptctitle\d:parttoc}%
  \end:parttoc
  \strt:minitoc{\end:partmem,|<parttoc members|>}\b:parttoc}\par}
>>>

\<fix minitoc\><<<
\def\partlof@[#1]{{\mini:opt{#1}\partlof:ttl \a:partlof
  \csname gobble:\TocOption\endcsname{\c:partlof
     \ptifont \plftitle\d:partlof}%
  \end:parttoc
  \strt:minitoc{\end:partmem,lof}\b:partlof}\par}
>>>

\<fix minitoc\><<<
\def\partlot@[#1]{{\mini:opt{#1}\partlot:ttl \a:partlot
  \csname gobble:\TocOption\endcsname{\c:partlot
     \ptifont \plttitle\d:partlot}%
  \end:parttoc
  \strt:minitoc{\end:partmem,lot}\b:partlot}\par}
>>>

%%%%%%%%%%%%%%%%%%%5
\SubSection{Mini Tocs}
%%%%%%%%%%%%%%%%%%%%

\<fix minitoc\><<<
\def\minitoc@[#1]{{\mini:opt{#1}\minitoc:ttl \a:minitoc
  \csname gobble:\TocOption\endcsname{\c:minitoc
     \mtifont \mtctitle\d:minitoc}
  \end:minitoc
  \strt:minitoc{\end:minimem,|<minitoc members|>}\b:minitoc}\par}
>>>

\<fix minitoc\><<<
\def\minilof@[#1]{{\mini:opt{#1}\minilof:ttl \a:minilof
  \csname gobble:\TocOption\endcsname{\c:minilof
     \mtifont \mlftitle\d:minilof}
  \end:minitoc
  \strt:minitoc{\end:minimem,lof}\b:minilof}\par}
>>>

\<fix minitoc\><<<
\def\minilot@[#1]{{\mini:opt{#1}\minilot:ttl \a:minilot
  \csname gobble:\TocOption\endcsname{\c:minilot
     \mtifont \mlttitle\d:minilot}
  \end:minitoc
  \strt:minitoc{\end:minimem,lot}\b:minilot}\par}
>>>

%%%%%%%%%%%%%%%%%%%5
\SubSection{Sect tocs}
%%%%%%%%%%%%%%%%%%%%

\<fix minitoc\><<<
\ifx \stc@ssect\:UnDef \else
   |<sect toc / lof / lot|>
\fi
>>>

\<sect toc / lof / lot\><<<
\def\secttoc@[#1]{{\mini:opt{#1}\secttoc:ttl \a:secttoc
  \csname gobble:\TocOption\endcsname{\c:secttoc\stifont
      \stctitle\d:secttoc}%
  \end:secttoc 
  \strt:minitoc{\end:sectmem,|<secttoc members|>}\b:secttoc}\par}
>>>

\<sect toc / lof / lot\><<<
\def\sectlof@[#1]{{\mini:opt{#1}\sectlof:ttl \a:sectlof
  \csname gobble:\TocOption\endcsname{\c:sectlof\stifont
      \slftitle\d:sectlof}%
  \end:secttoc 
  \strt:minitoc{\end:sectmem,lof}\b:sectlof}\par}
>>>

\<sect toc / lof / lot\><<<
\def\sectlot@[#1]{{\mini:opt{#1}\sectlot:ttl \a:sectlot
  \csname gobble:\TocOption\endcsname{\c:sectlot\stifont
      \slttitle\d:sectlot}%
  \end:secttoc 
  \strt:minitoc{\end:sectmem,lot}\b:sectlot}\par}
>>>

%%%%%%%%%%%%%%%%%%%5
\SubSection{Restore Pre-Minitoc Definitions}
%%%%%%%%%%%%%%%%%%%%

\<sect toc / lof / lot\><<<
\let\no@ssect=\stc@ssect    
>>>

\<fix minitoc\><<<
\let\no@schapter=\mtc@schapter 
\let\no@spart=\ptc@spart
>>>

%%%%%%%%%%%%%%%%%%%5
\SubSection{Entries for Tables}
%%%%%%%%%%%%%%%%%%%%

\<parttoc members\><<<
chapter,appendix,%
\ifnum 1>\c@parttocdepth \else section,\fi
\ifnum 2>\c@parttocdepth \else subsection,\fi
\ifnum 3>\c@parttocdepth \else subsubsection,\fi
\ifnum 4>\c@parttocdepth \else paragraph,\fi
\ifnum 5>\c@parttocdepth \else subparagraph,\fi
UnDFexyz%
>>>

\<minitoc members\><<<
\ifnum \z@>\c@minitocdepth\else section,\fi
\ifnum 1>\c@minitocdepth \else subsection,\fi
\ifnum 2>\c@minitocdepth \else subsubsection,\fi
\ifnum 3>\c@minitocdepth \else paragraph,\fi
\ifnum 4>\c@minitocdepth \else subparagraph,\fi
UnDFexyz%
>>>

\<secttoc members\><<<
\ifnum 1>\c@secttocdepth \else subsection,\fi
\ifnum 2>\c@secttocdepth \else subsubsection,\fi
\ifnum 3>\c@secttocdepth \else paragraph,\fi
\ifnum 4>\c@secttocdepth \else subparagraph,\fi
UnDFexyz%
>>>

%%%%%%%%%%%%%%%%%%%5
\SubSection{Start and Points for Tables}
%%%%%%%%%%%%%%%%%%%%

\<fix minitoc\><<<
\def\strt:minitoc#1{%
  \par  \let\old:toc=\:doTocEntry
  \def\:doTocEntry{\HAdvance\TocCount by 1
     \ifnum \TocCount=\TitleCount  \let\doTocEntry=\old:toc\fi
     \:gobbleIV}%
  \edef\:temp{[#1]}\expandafter\:tableofcontents\:temp}
>>>

\<sect toc / lof / lot\><<<
\def\end:sectmem{\end:minimem,section,likesection,}
\def\end:secttoc{%
  \def\tocsection{\endinput\:gobbleIII}%
  \def\toclikesection{\endinput\:gobbleIII}%
  \end:minitoc
}
>>>

\<fix minitoc\><<<
\def\end:minimem{\end:partmem,chapter,likechapter,appendix}
\def\end:minitoc{%
  \def\tocchapter{\endinput\:gobbleIII}%
  \def\toclikechapter{\endinput\:gobbleIII}%
  \def\tocappendix{\endinput\:gobbleIII}%
  \end:parttoc
}
>>>

\<fix minitoc\><<<
\def\end:partmem{part,likepart}
\def\end:parttoc{%
  \def\tocpart{\endinput\:gobbleIII}%
  \def\toclikepart{\endinput\:gobbleIII}%
}
>>>

%%%%%%%%%%%%%%%%%%%5
\SubSection{Package Options}
%%%%%%%%%%%%%%%%%%%%

\Verbatim
% positioning would have been nicer here, but currently it
% is too slow

% d -default (initially l but can be changed by
% set in doparttoc), l (left), c (center), r (right),
% e, n empty/none
\EndVerbatim

\<fix minitoc\><<<
\def\mini:opt#1#2{\def\TocOption{#1}\def\:temp{d}\ifx 
  \:temp\TocOption \let\TocOption|=#2\fi}
>>>

\<fix minitoc\><<<
\let\gobble:n=\:gobble
\let\gobble:e=\:gobble
\let\gobble:d=\:gobbleIII
>>>

\<fix minitoc\><<<
\def\doparttoc@[#1]{\def\parttoc:ttl{#1}}
\def\parttoc:ttl{l}
\def\dominitoc@[#1]{\def\minitoc:ttl{#1}}
\def\minitoc:ttl{l}
>>>

\<sect toc / lof / lot\><<<
\def\dosecttoc@[#1]{\def\secttoc:ttl{#1}}
\def\secttoc:ttl{l}
>>>

\<fix minitoc\><<<
\def\dopartlot@[#1]{\def\partlot:ttl{#1}}
\def\partlot:ttl{l}
\def\dominilot@[#1]{\def\minilot:ttl{#1}}
\def\minilot:ttl{l}
\def\dosectlot@[#1]{\def\sectlot:ttl{#1}}
\def\sectlot:ttl{l}
>>>

\<fix minitoc\><<<
\def\dopartlof@[#1]{\def\partlof:ttl{#1}}
\def\partlof:ttl{l}
\def\dominilof@[#1]{\def\minilof:ttl{#1}}
\def\minilof:ttl{l}
\def\dosectlof@[#1]{\def\sectlof:ttl{#1}}
\def\sectlof:ttl{l}
>>>

%%%%%%%%%%%%%%%%%%%5
\SubSection{Html Configuration}
%%%%%%%%%%%%%%%%%%%%

\<minitoc.sty Configure\><<<
\NewConfigure{minitoc}{4}
\NewConfigure{parttoc}{4}
\NewConfigure{secttoc}{4}
\NewConfigure{minilof}{4}
\NewConfigure{partlof}{4}
\NewConfigure{sectlof}{4}
\NewConfigure{minilot}{4}
\NewConfigure{partlot}{4}
\NewConfigure{sectlot}{4}
>>>

%%%%%%%%%%%%%%%%
\Section{gloss}
%%%%%%%%%%%%%%%%%%

\Link[ftp://ctan.tug.org/tex-archive/macros/latex/contrib/supported/gloss/]{}{}ctan\EndLink

\Verbatim
 > latex sample
 > bibtex sample.gls
 > latex sample
 > latex sample
\EndVerbatim

\<gloss.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% gloss.4ht                             |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|<shared gloss|>
|<2002 gloss|>
\Hinput{gloss}
\endinput
>>>                  \AddFile{9}{gloss}

\<shared gloss\><<<
\def\:tempc{\a:glosslist\o:glosslist:}
\HLet\glosslist=\:tempc
\append:def\endglosslist{\b:glosslist}
\renewcommand\setglosslabel[1]{%
   \def\gls@label##1##2##3{\def\gls@short{##3}%
      \c:glosslist #1\d:glosslist }}
\NewConfigure{glosslist}{4}
\NewConfigure{gloss}{2}
>>>

\<2002 gloss\><<<
\AtBeginDocument{% 
     \def\gls@hyperlink#1#2{\a:gloss{#1}{}#2\b:gloss}%
     \def\gls@raisedlink#1{\gls:raisedlink#1}}
\def\gls:raisedlink#1#2#3{%
   \c:glosslist\a:GlossAnchor{}{#2}\b:GlossAnchor
   \let\gls:label=\gls@label
   \def\gls@label##1##2##3{\gls:label{##1}{##2}{##3}%
      \let\gls@label=\gls:label
      \d:glosslist }%
}
\Configure{gloss}  {\Link}  {\EndLink}
\NewConfigure{GlossAnchor}{2}
\Configure{GlossAnchor} {\Link} {\EndLink}
>>>

\<pre 2002 gloss\><<<
\pend:def\glso@default{\append:def\glso@word{%
   \def\:tempc{%  
      \let\gls@refpage=\gls:refpage
      \csname gls@refpage\endcsname
      \let\gls:printtext=\gls@printtext
      \let\gls@printtext=\gls:prtxt 
   }%
   \ifx \gls@refpage\:tempc  \else
     \ifx   \gls:refpage\:UnDef   \let\gls:refpage=\gls@refpage \fi
     \let\gls@refpage=\:tempc
   \fi
}}
\def\gls:prtxt#1\fi{\a:gloss \gls:printtext#1\b:gloss\fi}
>>>

\<pre 2002 gloss\><<<
\let\o:glossitem:=\glossitem
\def\glossitem#1{\gdef\GlossLabel{#1}\o:glossitem:{#1}}
\expandafter\let\csname glossitem*\endcsname\glossitem           
>>>

\<pre 2002 gloss\><<<
\pend:defIII\gls@label{\c:glosslist}
\append:defIII\gls@label{\d:glosslist}
>>>

%%%%%%%%%%%%%%%%
\Section{dsfont}
%%%%%%%%%%%%%%%%

\<dsfont.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% dsfont.4ht                            |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{dsfont}
\endinput
>>>        \AddFile{9}{dsfont}

%%%%%%%%%%%%%%%%
\Section{afterpage}
%%%%%%%%%%%%%%%%

\<afterpage.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% afterpage.4ht                         |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config afterpage|>
\:warning{afterpage.sty not supported}
\Hinput{afterpage}
\endinput
>>>        \AddFile{9}{afterpage}

\<config afterpage\><<<
\let\clearpage\AP@clearpage
\pend:def\clearpage{\IgnorePar} 
\let\enddocument\AP@enddocument
\AtBeginDocument{%
  \long\def\afterpage#1{#1}%
  \let\AP@\empty
}
>>>

%%%%%%%%%%%%%%%%%%
\Section{euler}
%%%%%%%%%%%%%%%%%%

\<euler.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% euler.4ht                             |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<euler configs|>
\Hinput{euler}
\endinput
>>>        \AddFile{8}{euler}

\<euler configs\><<<
\let\mathbf=\un:Def
\let\mathsf=\un:Def
\let\mathit=\un:Def
\let\mathtt=\un:Def
\AtBeginDocument{%
   \def\:tempd#1{%
      \def\:tempc{\choose:mfont {#1}}%
      \expandafter\HLet\csname @#1\endcsname\:tempc
   }
   \:tempd{mathbf}%
   \:tempd{mathsf}%
   \:tempd{mathit}%
   \:tempd{mathtt}%
}
>>>

%%%%%%%%%%%%%%%%%%
\Section{eucal}
%%%%%%%%%%%%%%%%%%

\<eucal.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% eucal.4ht                             |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{eucal}
\endinput
>>>        \AddFile{8}{eucal}

%%%%%%%%%%%%%%%%%%
\Section{longdiv}
%%%%%%%%%%%%%%%%%%

\<longdiv.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% longdiv.4ht                           |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<longdiv.sty|>
\Hinput{longdiv}
\endinput
>>>        \AddFile{9}{longdiv}

\<longdiv.sty\><<<
\def\longdiv#1#2{{%
   \def\showdig{\edef\temp{&{\the\scratch}}\temp\cr
                &{\the\rtot}\cr}%
   \global\rtot=#1\relax
   \count0=\rtot\divide\count0by#2\edef\quotient{\the\count0}%
   \def\temp##1{\ifx##1\temp\else \noexpand\dodig ##1\expandafter\temp\fi}%
   \edef\routine{\expandafter\temp\quotient\temp}%
   \def\dodig##1{\global\multiply\gpten
     by10\relax}\global\gpten=1\relax\routine 
   \def\dodig##1{\global\divide\gpten by10\relax
      \scratch =\gpten
      \multiply\scratch  by##1\relax
      \multiply\scratch  by#2\relax
      \global\advance\rtot-\scratch \relax
      \ifnum\scratch>0 \showdig \fi
   }%
   \a:longdiv \long:div{#2}\b:longdiv
}}
\catcode`\#=13
\catcode`\@=6
\def\long:div@1{\halign{#&#\cr 
     &\quotient\cr
     @1&\the\rtot\cr
     \routine \cr 
}}
\catcode`\#=6
\catcode`\@=11

\NewConfigure{longdiv}{2}
>>>

\Section{physics.sty}

\<physics.4ht\><<<
% physics.4ht (|version), generated from |jobname.tex 
% Copyright 2023 TeX Users Group 
|<TeX4ht license text|> 
|<physics argopen|>
\Hinput{physics}
\endinput
>>> \AddFile{9}{physics}

argopen and argclose cause issues in MathML, so we make a dummy definition, which is then
used outside of Pictures. The original version added automatically left and right, which is
not necessary in MathML anyway.

\<physics argopen\><<<
\DeclareDocumentCommand\physics:argopen{s}{} % Special open grouping for argument of a function
\DeclareDocumentCommand\physics:argclose{s}{} % Special close grouping for argument of a function
\HLet\argopen\physics:argopen
\HLet\argclose\physics:argclose
>>> 

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Indexes}
\SubSection{index.sty}

\<index.4ht\><<<
% index.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
% Copyright 2024 TeX Users Group
|<TeX4ht copywrite|>
|<index shared|>
\expandafter\ifx \csname @vwritefile\endcsname\relax
  |<index 4.01beta|>
\else 
  |<index 3.02|>
\fi
|<latex caption index optional|>
\Hinput{index}
\endinput
>>>        \AddFile{7}{index}

\Link[file://localhost/usr/local/teTeX/share/texmf/tex/latex/misc/index.sty]{}{}%
index.sty\EndLink

\<index 4.01beta\><<<
\pend:defII\@wrindex{\warn:idx{##1}\title:chs{\html:addr
   \hbox{\Link-{}{|<haddr prefix|>\last:haddr}\EndLink}}{}%
   \edef\:temp{\write\@auxout{%
      \string\@writefile{##1}{\expandafter\string\a:idxmake{\RefFileNumber
         \FileNumber}{\title:chs{|<haddr prefix|>\last:haddr}{\cur:th
         \:currentlabel}}{\a:makeindex}}}}\:temp
}
\pend:def\printindex{\def\indexname{\the\@nameuse{idxtitle@\@indextype}}}
|<index 4.1beta warning|>
>>>

\<index 4.1beta ext I\><<<
\expandafter
\expandafter\expandafter\idx:extI \csname idx@#1\endcsname//%
>>>

\<index 4.1beta ext II\><<<
\expandafter
\expandafter\expandafter\idx:extII \csname idx@#1\endcsname//%
>>>

\<index 4.1beta warning\><<<
\bgroup
\@ifpackageloaded{imakeidx}{
   \expandafter\gdef\csname idx:extI\endcsname#1{#1}
   \expandafter\gdef\csname idx:extII\endcsname#1{#1}
}{
   \catcode`\:=12
   \expandafter\gdef\csname idx:extI\endcsname#1:#2//{#1}
   \expandafter\gdef\csname idx:extII\endcsname#1:#2:#3//{#2}
}

\egroup
>>>

\<index 3.02\><<<
\pend:defII\@wrindex{\warn:idx{##1}\title:chs{\html:addr
   \hbox{\Link-{}{|<haddr prefix|>\last:haddr}\EndLink}}{}%
   \edef\:temp{\write\@auxout{%
      \string\@vwritefile{##1}{\expandafter\string\a:idxmake{\RefFileNumber
         \FileNumber}{\title:chs{|<haddr prefix|>\last:haddr}{\cur:th
         \:currentlabel}}{\a:makeindex}}}}\:temp
}
>>>

\<index shared\><<<
\ifx \a:makeindex\:UnDef
   \NewConfigure{makeindex}{1} \Configure{makeindex}{}
\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{multind.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<multind.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% multind.4ht                           |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<multind.sty|>
\Hinput{multind}
\endinput
>>>        \AddFile{7}{multind}

\Link[file://localhost/usr/local/teTeX/share/texmf/tex/latex/misc/multind.sty]{}{}%
multind.sty\EndLink

\<multind.sty\><<<
\pend:defII\@wrindex{\warn:idx{##1}\@ifundefined{##1@idxfile}{}{\html:addr
   \hbox{\Link-{}{|<index haddr|>}\EndLink}%
   \edef\:temp{\expandafter
      \write\csname ##1@idxfile\endcsname{\string
        \beforeentry{\RefFileNumber
        \FileNumber}{|<index haddr|>}{\a:makeindex}}}\:temp
}}
\ifx \a:makeindex\:UnDef 
   \NewConfigure{makeindex}{1} \Configure{makeindex}{}
\fi
\def\printindex#1#2{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
  {\def\indexname{#2}\@input{#1.ind}}}
>>>


%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{imakeidx.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<imakeidx.4ht\><<<
% imakeidx.4ht (|version), generated from |jobname.tex
% Copyright 2019-2024 TeX Users Group
|<TeX4ht license text|>

|<imakeidx.sty|>
|<latex caption index optional|>

\Hinput{imakeidx}
\endinput
>>> \AddFile{7}{imakeidx}

This code would be used with the splitindex option, but it seems index handling is
already done, so it is not useful.

\<imakeidx-do-not-use\><<<
\def\:temp#1#2#3{\html:addr%
\hbox{\Link-{}{|<index haddr|>}\EndLink}%
\protected@write\@indexfile{}%
{\string\beforeentry{\RefFileNumber\FileNumber}{|<index haddr|>}{\a:makeindex}}
\o:imki@wrindexentryunique:{#1}{#2}{#3}%
}
\HLet\imki@wrindexentryunique\:temp
>>>

Patch the index writting commands to introduce the index destination and link to the
destination to the idx file
\<imakeidx.sty\><<<
\def\:temp#1#2#3{\html:addr%
\hbox{\Link-{}{|<index haddr|>}\EndLink}%
\expandafter\protected@write\csname#1@idxfile\endcsname{}%
{\string\beforeentry{\RefFileNumber\FileNumber}{|<index haddr|>}{\a:makeindex}}%
\o:imki@wrindexentrysplit:{#1}{#2}{#3}%
}
\HLet\imki@wrindexentrysplit\:temp

\ifx \a:makeindex\:UnDef
\NewConfigure{makeindex}{1}\Configure{makeindex}{}
\fi
>>>

Support for the intoc option of Imakeidx and the \`'\indexprologue' command.

\<imakeidx.sty\><<<
\Configure{@begin}{theindex}{\ind:defs\imki@maybeaddtotoc\imki@idxprologue\global\let\imki@idxprologue\relax}
>>>

Prevent the automatic index compilation, the index produced by tex4ht
needs a special treatment.

\<add to usepackage\><<<
\Configure{PackageHooks}{imakeidx.sty}{imakeidx-hooks.4ht}
>>>

\<imakeidx-hooks.4ht\><<<
% imakeidx-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
\PassOptionsToPackage{noautomatic}{imakeidx}
>>> \AddFile{9}{imakeidx-hooks}

\<index haddr\><<<
d|<haddr prefix|>\last:haddr
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{indextools.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<indextools.4ht\><<<
% indextools.4ht (|version), generated from |jobname.tex
% Copyright 2022-2024 TeX Users Group
|<TeX4ht license text|>
|<indextools index|>
|<indextools defs|>
|<indextools disable options|>
|<latex caption index optional|>

\Hinput{indextools}
\endinput
>>> \AddFile{7}{indextools}




Insert destinations for index items in text, and save the link to the .idx file

\<indextools index\><<<
\def\:tempa[#1]#2{\html:addr%
	\ifindtl@splitindex\else% with splitindex, we would get duplicate index entry destinations
		\hbox{\Link-{}{dx\last:haddr}\EndLink}%
		\expandafter\protected@write\csname#1@idxfile\endcsname{}%
		{\string\beforeentry{\RefFileNumber\FileNumber}{dx\last:haddr}{\a:makeindex}}%
	\fi%
	\o:@index:[#1]{#2}%
}
\HLet\@index\:tempa%

\ifx \a:makeindex\:UnDef
	\NewConfigure{makeindex}{1}\Configure{makeindex}{}
\fi
>>>

\<indextools defs\><<<
\Configure{@begin}{theindex}{\ind:defs}
>>>

\<indextools disable options\><<<
% disable redefiniton of \theindex in \AtBeginDocument
\indtl@originaltrue

% prevent automatic compilation of the index
\let\KV@indtl@noautomaticfalse\KV@indtl@noautomatictrue
\KV@indtl@noautomatictrue
\indtl@disableautomatictrue
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{tugboat}
%%%%%%%%%%%%%%%%%%%%%%%%

\<tugboat.4ht\><<<
% tugboat.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2004. Eitan M. Gurari
|<TeX4ht copyright|>
|<tugboat cfg|>
|<tugboat cmn|>
\Hinput{tugboat}
\endinput
>>>        \AddFile{9}{tugboat}

\<tugboat cfg\><<<
\let\:tempb\head
\Def:Section\head{}{#1} 
\let\:head\head
\let\head\:tempb
\def\@domainhead{\:head{\the\@argument}}
\let\:tempb\subhead
\Def:Section\subhead{}{#1} 
\let\:subhead\subhead
\let\subhead\:tempb
\def\@dosubhead{\:subhead{\the\@argument}}
\let\:tempb\subsubhead
\Def:Section\subsubhead{}{#1} 
\let\:subsubhead\subsubhead
\let\subsubhead\:tempb
\def\@dosubsubhead{\:subsubhead{\the\@argument}}
>>>

\<tugboat cfg\><<<
\let\o:figure:\figure
\def\figure{\bgroup \a:figure \o:figure:}
\append:def\endfigure{\b:figure\egroup}
\NewConfigure{figure}{2}
>>>

\<tugboat cfg\><<<
\pend:def\endverbatim{% 
   \append:def\@beforeverbinline{\a:verb}%
   \pend:def\@afterverbinline{\b:verb}%
   \append:def\@beforeverbdisplay{\a:verbatim}%
   \pend:def\@afterverbdisplay{\b:verbatim}%
   \expandafter\def\expandafter\pre:everypar\expandafter{\the\everypar}%
   \append:def\@altdisplaystyle{%  
      \expandafter\def\expandafter\:temp\expandafter{\the\everypar}%
      \ifx \:temp\pre:everypar \else
         \expandafter\everypar\expandafter{\expandafter\HtmlPar\the\everypar}%
      \fi }%
}
\pend:def\verbatim{\bgroup \Configure{obeylines}{}{}{}}
\append:def\endverbatim{\egroup}
\let\:setupverbatim\setupverbatim
\def\setupverbatim{\:setupverbatim
    \let\:ruled\empty\def\ruled{\def\:ruled{-ruled}}}
\let\:ruled\empty
\NewConfigure{verbatim}{2}
\NewConfigure{verb}{2}
>>>

\<tugboat cfg\><<<
\let\:beginlist\@beginlist
\def\@beginlist{%
    \ifx\@liststyle\@displaystyle 
       \Configure{list}
          {\csname a:display-list\endcsname}
          {\csname b:display-list\endcsname}
          {\csname c:display-list\endcsname}
          {\csname d:display-list\endcsname}%
    \else
       \Configure{list}
          {\csname a:inline-list\endcsname}
          {\csname b:inline-list\endcsname}
          {\csname c:inline-list\endcsname}
          {\csname d:inline-list\endcsname}%
    \fi
    \a:list \begingroup
    \:beginlist
    \let\:tagform=\tagform
    \def\tagform##1{\c:list\:tagform{##1}\d:list}%
      \expandafter\def\expandafter\:temp\expandafter{\the\everypar}%
      \ifx \:temp\pre:everypar \else
         \expandafter\everypar\expandafter{\expandafter\HtmlPar\the\everypar}%
      \fi 
      \def\colsep{\ignoreendline}%
     } 
\append:def\endlist{\b:list\endgroup}
\NewConfigure{list}{4}
\NewConfigure{display-list}{4}
\NewConfigure{inline-list}{4}
>>>

\<tugboat rtitle\><<<
\a:rtitle \rtitlex\qquad \midrtitle \b:rtitle
>>>

\<tugboat cfg\><<<
\NewConfigure{rtitle}{2}
\let\rtitle\empty
\let\rfoot\empty
\global\SecTitletrue 
\pend:def\article{|<tugboat rtitle|>\ifx\thetitle\relax 
  \else 
    \pend:defI\thetitle{\a:title}%
    \append:defI\thetitle{\b:title}%
  \fi
}
\NewConfigure{title}{2} 
\pend:defI\theauthor{\a:author} 
\append:defI\theauthor{{}\b:author} 
\NewConfigure{author}{2} 
\pend:defI\theaddress{\a:address} 
\append:defI\theaddress{{}\b:address} 
\NewConfigure{address}{2} 
\pend:defI\thenetaddress{\a:netaddress} 
\append:defI\thenetaddress{{}\b:netaddress} 
\NewConfigure{netaddress}{2} 
\pend:def\@defaultauthorlist{\a:authorlist\:defaultauthorlist}    
\append:def\@defaultauthorlist{\b:authorlist}    
\def\:defaultauthorlist{%
   \let\@defaultauthorlist\empty
   \count@=\authornumber 
   \loop 
   \ifnum\count@>0 
      \expandafter\pend:def\csname theauthor\number\count@\endcsname{\a:author}%
      \expandafter\append:def\csname theauthor\number\count@\endcsname{\b:author}%
      \advance\count@ by -1 
   \repeat 
  } 
\NewConfigure{authorlist}{2}
>>>

\<tugboat cmn\><<<
\append:def\makesignature{\egroup}
\pend:def\makesignature{\bgroup 
  \pend:def\@signature{%
     \expandafter\everypar\expandafter{\expandafter\HtmlPar\the\everypar}%
     \a:signature}%
  \append:def\@signature{\b:signature}%
  \let\sv:rightline\rightline
  \def\rightline{\let\rightline=\sv:rightline}%
}
\NewConfigure{signature}{2}
\pend:def\signaturemark{\a:signaturemark} 
\append:def\signaturemark{\b:signaturemark} 
\NewConfigure{signaturemark}{2}
>>>

\<tugboat cmn\><<<
\def\v@lx{\gdef\volx{Volume~\a:volno\volno\b:volno
                           ~(\a:volyr\volyr\b:volyr),
                        No.~\a:issno\issno\b:issno}} 
\NewConfigure{issno}{2}
\NewConfigure{volyr}{2}
\NewConfigure{volno}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{ltugboat, ltugproc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<ltugboat.4ht\><<<
% ltugboat.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>
\@ifclassloaded{ltugproc}{}{%
   \@ifpackageloaded{ltugproc}{}{\Hinclude{\input ltugboat-a.4ht}{article}}
   \InputIfFileExists{tugboat.dates}%
}
\endinput
>>>        \AddFile{9}{ltugboat}

\<ltugboat-a.4ht\><<<
% ltugboat-a.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copyright|>
|<ltugboat cfg|>
\Hinput{ltugboat}
\endinput
>>>        \AddFile{9}{ltugboat-a}

\<ltugboat cfg\><<<
\def\TB@nolimelabel{}
\long\def\:temp#1{{\a:textSMC \o:textSMC:{#1}\b:textSMC}} 
\HLet\textSMC|=\:temp 
\NewConfigure{textSMC}{2}
>>>

\<ltugboat cfg\><<<
\pend:defI\theauthor{\a:author}
\append:defI\theauthor{{}\b:author}
\NewConfigure{author}{2}
\pend:defI\theaddress{\a:address}
\append:defI\theaddress{{}\b:address}
\NewConfigure{address}{2}
\pend:defI\thenetaddress{\a:netaddress}
\append:defI\thenetaddress{{}\b:netaddress}
\NewConfigure{netaddress}{2}
\pend:defI\thePersonalURL{\a:PersonalURL}
\append:defI\thePersonalURL{{}\b:PersonalURL}
\NewConfigure{PersonalURL}{2}
\pend:def\signaturemark{\a:signaturemark}
\append:def\signaturemark{{}\b:signaturemark}
\NewConfigure{signaturemark}{2}
\pend:def\@makesectitle{\ifSecTitle \a:sectitle}
\append:def\@makesectitle{\b:sectitle \else\par\fi}
\NewConfigure{sectitle}{2}
>>>

\<ltugboat cfg\><<<
\long\def\:tempc[#1]{\a:makesignature\bgroup 
   \pend:def\@signature{\everypar{\HtmlPar}\a:signature}\csname 
                     o:\string\makesignature:\endcsname[#1]\egroup
   \b:makesignature}
\expandafter\HLet\csname \string\makesignature\endcsname\:tempc
\NewConfigure{makesignature}{2}
\NewConfigure{signature}{1}
>>>

\<ltugboat cfg\><<<
\def\:tempc{\a:titlex\o:rtitlex:\b:titlex} 
\HLet\rtitlex\:tempc
\NewConfigure{titlex}{2}
>>>

\<ltugproc.4ht\><<<
% ltugproc.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copyright|>
\Hinclude{\input ltugboat-a.4ht
          \input ltugproc-a.4ht}{article}    
\endinput
>>>        \AddFile{9}{ltugproc}

\<ltugproc-a.4ht\><<<
% ltugproc-a.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copyright|>
|<ltug proc|>
\Hinput{ltugproc}
\endinput
>>>        \AddFile{9}{ltugproc-a}

\<ltug proc\><<<
\pend:def\@maketitle{%
   \def\theauthor####1{\expandafter
      \ifx \csname theauthor####1\endcsname\relax \else
         \a:author\csname theauthor####1\endcsname\b:author
      \fi}%
   \if@abstract
      \expandafter\abstract@toks\expandafter{\expandafter
          \a:abstract \the\abstract@toks}%
      \expandafter\abstract@toks\expandafter{%
           \the\abstract@toks \b:abstract}%
   \fi
}
\NewConfigure{abstract}{2}
>>>

\<ltug proc\><<<
\pend:def\TITLEfont{%
   \if@abstract \aftergroup\abstract:head\fi
}
\def\abstract:head{%
   \let\tug:centerline\centerline
   \def\centerline##1{%
      \a:abstractHead \tug:centerline{##1}\b:abstractHead
      \let\centerline\centerline:tug
   }%
}
\NewConfigure{abstractHead}{2}
>>>

%%%%%%%%%%%%%%%%%%%
\Section{mls}
%%%%%%%%%%%%%%%%%%%

\<mls.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% mls.4ht                             |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<mls hooks|>
|<mlstrans hooks|>
|<mlsgalig hooks|>
|<temporary mls accents patch|>
\Hinput{mls}
\endinput
>>>        \AddFile{9}{mls}

\<temporary mls accents patch\><<<
\expandafter\HLet\csname OT1\string\"\expandafter\endcsname
     \csname n:":\endcsname
\HRestore\"
>>>

\<mls hooks\><<<
\Configure{writetoc}
   {\let\SetDocumentEncodingNeutral\relax
    \let\SetDocumentEncodingLMC\relax
    \let\SetDocumentEncodingBicig\relax
    \let\mnr\relax
    \let\mbc\relax
    \let\blr\relax
    \let\rnm\relax
   }
\renewcommand{\mbosoo}[1]{\def\:temp{#1}\ifx \:temp\empty\else
     \bosoo{{\bcg #1}}\fi}
>>>

\<mlstrans hooks\><<<
\pend:def\do@galiglist{\let\mls:sp=\  \let\ =\sp:c }
\append:def\end@galiglist{\let\ =\mls:sp}
>>>

\<mlsgalig hooks\><<<
\pend:def\do@mlsgalig{\let\mls:sp=\  \let\ =\sp:c }
\append:def\end@mlsgalig{\let\ =\mls:sp}
\pend:def\prettify@mls{\let\mls:sp=\  \let\ =\sp:c }
\append:def\prettify@mls{\let\ =\mls:sp}
>>>

%%%%%%%%%%%%%%%%%%%
\Section{rotating}
%%%%%%%%%%%%%%%%%%%

\<rotating.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% rotating.4ht                        |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config rotating|>
\Hinput{rotating}
\endinput
>>>        \AddFile{9}{rotating}

\<config rotating\><<<
\def\@xrotfloat#1[#2]{\@float{#1}[#2]}
\def\end@rotfloat{\end@float}
\def\endsidewaysfigure{\end@float}
\def\endsidewaystable{\end@float}
>>>

%%%%%%%%%%%%%%%%%%%
\Section{boxedminipage}
%%%%%%%%%%%%%%%%%%%

\<boxedminipage.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% boxedminipage.4ht                   |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<boxedminipage configs|>
\Hinput{boxedminipage}
\endinput
>>>        \AddFile{9}{boxedminipage}

\<boxedminipage configs\><<<
\let\o:@iboxedminipage:=\@iboxedminipage
\def\@iboxedminipage[#1]{\o:@iboxedminipage:[b]}
>>>

%%%%%%%%%%%%%%%%%%%
\Section{ulem}
%%%%%%%%%%%%%%%%%%%

\<ulem.4ht\><<<
% ulem.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2001. Eitan M. Gurari
|<TeX4ht copywrite|>

|<ulem sty|>
\Hinput{ulem}
\endinput
>>>        \AddFile{9}{ulem}

We use different configurations, depending on the fact if we are inside math mode or not.
Configurations in math mode are named after the command with the "-math" suffix.

\<ulem sty\><<<
\def\:ulemchoose#1#2{\relax\ifmmode\csname a:#1-math\endcsname#2\csname b:#1-math\endcsname\else\csname a:#1\endcsname#2\csname b:#1\endcsname\fi}

\NewConfigure{uline}{2}
\NewConfigure{uline-math}{2}
\def\:tempa#1{\:ulemchoose{uline}{#1}}
\HLet\uline\:tempa

\NewConfigure{uuline}{2}
\NewConfigure{uuline-math}{2}
\def\:tempa#1{\:ulemchoose{uuline}{#1}}
\HLet\uuline\:tempa

\NewConfigure{sout}{2}
\NewConfigure{sout-math}{2}
\def\:tempa#1{\:ulemchoose{sout}{#1}}
\HLet\sout\:tempa

\NewConfigure{xout}{2}
\NewConfigure{xout-math}{2}
\def\:tempa#1{\:ulemchoose{xout}{#1}}
\HLet\xout\:tempa

\NewConfigure{uwave}{2}
\NewConfigure{uwave-math}{2}
\def\:tempa#1{\:ulemchoose{uwave}{#1}}
\HLet\uwave\:tempa

\NewConfigure{dashuline}{2}
\NewConfigure{dashuline-math}{2}
\def\:tempa#1{\:ulemchoose{dashuline}{#1}}
\HLet\dashuline\:tempa

\NewConfigure{dotuline}{2}
\NewConfigure{dotuline-math}{2}
\def\:tempa#1{\:ulemchoose{dotuline}{#1}}
\HLet\dotuline\:tempa

\def\:temp{\z@}
\HLet\ULthickness\:temp
>>>

%%%%%%%%%%%%%%%%%%%
\Section{cancel}
%%%%%%%%%%%%%%%%%%%

\<cancel.4ht\><<< 
% cancel.4ht (|version), generated from |jobname.tex 
% Copyright 2022 TeX Users Group 
|<TeX4ht license text|> 
|<cancel config|>
\Hinput{cancel} 
\endinput 
>>> \AddFile{9}{cancel}

\<cancel config\><<<
\def\:cancelchoose#1#2{\relax\ifmmode\csname a:#1-math\endcsname#2\csname b:#1-math\endcsname\else\csname a:#1\endcsname#2\csname b:#1\endcsname\fi}
\NewConfigure{cancel}{2}
\NewConfigure{cancel-math}{2}
\def\:tempa#1{\:cancelchoose{cancel}{#1}}
% \def\:tempa#1{\ifmmode\a:cancelmath#1\b:cancelmath\else\a:cancel#1\b:cancel\fi}
\HLet\cancel\:tempa

\NewConfigure{bcancel}{2}
\NewConfigure{bcancel-math}{2}
\def\:tempa#1{\:cancelchoose{bcancel}{#1}}
% \def\:tempa#1{\ifmmode\a:bcancelmath#1\b:bcancelmath\else\a:bcancel#1\b:bcancel\fi}
\HLet\bcancel\:tempa

\NewConfigure{xcancel}{2}
\NewConfigure{xcancel-math}{2}
\def\:tempa#1{\:cancelchoose{xcancel}{#1}}
% \def\:tempa#1{\ifmmode\a:xcancelmath#1\b:xcancelmath\else\a:xcancel#1\b:xcancel\fi}
\HLet\xcancel\:tempa

\NewConfigure{cancelto}{3}
\def\:tempa#1#2{\a:cancelto#1\b:cancelto#2\c:cancelto}
\HLet\cancelto\:tempa

>>>

%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%
\Section{go}
%%%%%%%%%%%%%%%%%%%

\<go.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% go.4ht                              |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<go sty|>
\Hinput{go}
\endinput
>>>        \AddFile{9}{go}

\<go sty\><<<
\let\o:pos:=\pos
\def\pos#1#2=#3#4{\let\empty=\ht:empty
   \o:pos:{#1}{#2}=#3{#4}\def\empty{}}
\let\o:showdiagram:=\showdiagram
\def\showdiagram#1-#2-#3 {\a:showdiagram\let\empty=\ht:empty 
   \o:showdiagram:#1-#2-#3 \def\empty{} \b:showdiagram}
\let\o:inidiagram:=\inidiagram
\def\inidiagram#1-#2-#3 {\let\empty=\ht:empty
   \o:inidiagram:#1-#2-#3 \def\empty{}}
\NewConfigure{showdiagram}{2}
>>>

%%%%%%%%%%%%%%%%%%%
\Section{paralist}
%%%%%%%%%%%%%%%%%%%

\<paralist.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% paralist.4ht                          |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
   |<paralist hooks|>
\Hinput{paralist}
\endinput
>>>        \AddFile{9}{paralist}

\<paralist hooks\><<<
\:CheckOption{enum}\if:Option
   \HRestore\@roman
   \HRestore\@Roman
\fi
>>>

\<pifont.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% pifont.4ht                            |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{pifont}
\endinput
>>>        \AddFile{9}{pifont}

%%%%%%%%%%%%%%%%%%
\Section{listings}

\<listings.4ht\><<<
% listings.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2001. Eitan M. Gurari
|<TeX4ht copywrite|>
|<listings sty|>
|<lstmisc sty|>
\Hinput{listings}
\endinput
>>>        \AddFile{9}{listings}

We use Xcolor's features to extract color information for syntax highlighting.
We need to load it if it isn't used  yet
\<listings sty\><<<
\@ifpackageloaded{xcolor}{}{%
\RequirePackage{xcolor}
}
>>>

For some reason we need the followng version of \`|\@makecaption| in order to
get correct cross-references. There were duplicate IDs sometimes.

\<listings sty\><<<
\def\lst@makecaption#1#2{\cptA: #1\if :#1:\else\cptB:\fi \cptC: #2\cptD:}
>>>

I don't know why there used to be clearing of math environment, it 
disabled  listings option to work correctly. Also patching of 
\`|\lsthk@EveryLine| should be done in every call to this command.

\<listings sty\><<<

\newif\iflstnest
\append:defII\lst@EnterMode{%
  \ifx \lsthk:EveryLine\:UnDef
     \let\lsthk:EveryLine\lsthk@EveryLine
  \fi
  \ifx \lsthk:EveryLine\lsthk@EveryLine 
      \pend:def\lsthk@EveryLine{\c:listings
             \def\dd:listings{\d:listings\let\dd:listings\empty}}%
  \fi  
  \append:def\lsthk@EveryPar{\dd:listings}%
  \iflstnest\else
  \a:listings\fi\bgroup  
  %\Configure{$}{}{}{}%
  \aftergroup\lst:EnterMode  }
\def\lst:EnterMode{\iflstnest\else\b:listings\fi\egroup}
\NewConfigure{listings}{4}
\let\dd:listings=\empty
>>>

Configure listings: befoe env, after env, before ln, between \# and
content.

\<listings sty\><<<
\append:defI\lst@Init{\csname a:listings-init\endcsname\global\lstnesttrue}
\pend:def\lst@DeInit{\csname b:listings-init\endcsname\global\lstnestfalse}
\NewConfigure{listings-init}{2}
>>>

Use the TextStyle hook to insert markup for inline listings. This hook can 
be used also in other contexts, so we need to execute it conditionally, 
based on the \Verb|\lst@ifmode| condition. 
See \Link[https://tex.stackexchange.com/q/719828/2891]{}{}for example\EndLink.

\<listings sty\><<<
\lst@AddToHook{TextStyle}{%
   \Configure{listings}{}{}{}{}%
   \lst@ifmode\else%
   \a:lstinline \bgroup \aftergroup\b:lstinline\aftergroup\egroup%
   \fi%
  }
\NewConfigure{lstinline}{2}
>>>

\<listings sty\><<<
\pend:defI\lst@MakeCaption{%
  \let\lst:addcontentsline\addcontentsline
  \def\addcontentsline{\gHAdvance\TitleCount by 1
                       \lst:addcontentsline}%
}
\append:defI\lst@MakeCaption{%
  \let\addcontentsline\lst:addcontentsline
}
>>>

\<lstmisc sty\><<<
\HLet\lst@frameInit=\empty
\HLet\lst@frameExit=\empty
>>>

Configure list of listings

\<listings sty\><<<
\ConfigureToc{lol} {}{\empty}{}{\newline}
\lst@UserCommand\lstlistoflistings{\bgroup%
    \ifdefined\chapter\chapter*{\lstlistlistingname}\else\section*{\lstlistlistingname}\fi%
    \TableOfContents[lol]%
  \egroup}
>>>

\<listings sty\><<<
\def\:tempa{%
   \ifx\lst@OutputBox\@gobble\else \the\everypar \fi
   \global\advance\lst@newlines\m@ne
   \lst@newlinetrue
}%
\HLet\lst@NewLine\:tempa
\def\:tempa#1{
    \begingroup%
      \lsthk@PreSet\gdef\lst@intname{#1}% 
      \expandafter\lstset\expandafter{\lst@set}% 
      \lsthk@DisplayStyle%
      \catcode\active=\active%
      \a:lstinputlisting\ht:special{t4ht@[}
      \pend:def\cptA:{\ht:special{t4ht@]}}
      \append:def\cptD:{\ht:special{t4ht@[}}
      \lst@Init\relax \let\lst@gobble\z@%
      \lst@SkipToFirst%
      \lst@ifprint \def\lst@next{\input{#1}}% 
             \else \let\lst@next\@empty \fi%
      \ht:special{t4ht@]}\lst@next\ht:special{t4ht@[}\lst@DeInit\ht:special{t4ht@]}%
      \b:lstinputlisting%
    \endgroup} 

\HLet\lst@InputListing\:tempa 
\NewConfigure{lstinputlisting}{2}
>>>

\<listings sty\><<<
\def\:tempa#1{% 
   \setbox\z@\hbox{{\lst@currstyle{\kern#1}}}% 
   \global\advance\lst@currlwidth \wd\z@ 
   \tmp:dim=#1 \let\:tempc=\empty
   \loop \ifdim \tmp:dim>\a:lst@Kern
      \advance \tmp:dim by -\a:lst@Kern
      \advance \tmp:dim by -\b:lst@Kern
      \append:def\:tempc{\:nbsp}%
   \repeat
   \setbox\z@\hbox{{\lst@currstyle{\:tempc}}}%
   \lst@OutputBox\z@} 
\HLet\lst@Kern\:tempa
>>>

Configure lst@Kern: character width, inter character space size

\<listings sty\><<<
\NewConfigure{lst@Kern}{2}
\Configure{lst@Kern}{0.499em}{0.1em}
\def\lst@outputspace{\HCode{ }}
>>>

Test cases:

\List{*}

\item

\Verbatim
  \documentclass{article}  
     \usepackage{listings}  
  \begin{document}  
     \lstset{language=C}  
     \lstinputlisting[caption=my caption]{a.c}  
  \end{document}  
\EndVerbatim

a.c

\Verbatim
main()  
{  
  /* hello  
   * there  
   */  
  return 0;  
}  
\EndVerbatim

\EndList


%%%%%%%%%%%%%%%%%%%
\Section{fancyhdr}
%%%%%%%%%%%%%%%%%%%

The Fancyhdr package breaks the sectioning support, it is necessary to suppress
the fancy page style.
\Link[https://tex.stackexchange.com/q/511350/2891]{}{}More info\EndLink.

\<add to usepackage\><<<
\Configure{PackageHooks}{fancyhdr.sty}{fancyhdr-hooks.4ht}
>>>

\<fancyhdr-hooks.4ht\><<<
% fancyhdr-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht copywrite|>
\:AtEndOfPackage{%
\def\ps@fancy{}%
}
>>> \AddFile{9}{fancyhdr-hooks}

%%%%%%%%%%%%%%%%%%%
\Section{fancyhdr}
%%%%%%%%%%%%%%%%%%%


\<tasks.4ht\><<<
% tasks.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht copywrite|>
\ExplSyntaxOn
% generate normal \item for tasks instead of coffins
\cs_set_protected:Npn \__tasks_task_fourht:nnn #1#2#3
{\item[#1]{\__tasks_setup: #2 {#3}}}
\cs_generate_variant:Nn \__tasks_task_fourht:nnn {VVV}

\HLet\__tasks_task:nnn\__tasks_task_fourht:nnn
\HLet\__tasks_task:VVV\__tasks_task_fourht:VVV

\ExplSyntaxOff
\Hinput{tasks}
\endinput
>>> \AddFile{9}{tasks}

%%%%%%%%%%%%%%%%%%%
\Section{alphanum}
%%%%%%%%%%%%%%%%%%%

\<alphanum.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% alphanum.4ht                          |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<alphanum sty|>
\Hinput{alphanum}
\endinput
>>>        \AddFile{9}{alphanum}

\<alphanum sty\><<<
\append:def\J@SetCurrent{\global\let\jura:currentlabel=\@currentlabel}
\Configure{@newlabel}
   {\ifx  \jura:currentlabel\:UnDef \else
      \let\@currentlabel=\jura:currentlabel
      \global\let\jura:currentlabel=\:Undef
    \fi  }
>>>

\<alphanum sty\><<<
\renewcommand*{\ref}{%
\@ifstar{\@tempswatrue\J@ref}{\@tempswafalse\J@ref}}
\renewcommand*{\J@refX}[1]{%
   \bgroup
     \def\rEfLiNK##1##2{##2}%
     \edef\:temp{#1}%
     \def\rEfLiNK##1##2{##1}%
     \edef\:temp{\noexpand\rEfLiNK#1{\:temp}}%
     \def\rEfLiNK##1##2##3{\noexpand\rEfLiNK
         {##1}{\noexpand\J@refXX##3}}%
     \edef\:temp{\:temp}%
     \expandafter
   \egroup \:temp  }
>>>

\<alphanum sty\><<<
\renewcommand*{\J@ShortToc}[1]{\stepcounter{lvl\alph{tiefe}}\J@Number\ %
   \addcontentsline{toc}{liketoclvl\alph{tiefe}}%
   {\protect\numberline{\J@Number}#1}%
   \csname lvl\alph{tiefe}mark\endcsname{#1}\@gobblecr}
>>>

\<alphanum sty\><<<
\let\no@toclvla\toc
\let\no@toclvlb\toc
\let\no@toclvlc\toc
\let\no@toclvld\toc
\let\no@toclvle\toc
\let\no@toclvlf\toc
\let\no@toclvlg\toc
\let\no@toclvlh\toc
\let\no@toclvli\toc
\let\no@toclvlj\toc
\let\no@toclvlk\toc
\let\no@toclvll\toc
\Def:Section\toclvla{\arabic{lvla}}{#1}
\Def:Section\toclvlb{\arabic{lvlb}}{#1}
\Def:Section\toclvlc{\arabic{lvlc}}{#1}
\Def:Section\toclvld{\arabic{lvld}}{#1}
\Def:Section\toclvle{\arabic{lvle}}{#1}
\Def:Section\toclvlf{\arabic{lvlf}}{#1}
\Def:Section\toclvlg{\arabic{lvlg}}{#1}
\Def:Section\toclvlh{\arabic{lvlh}}{#1}
\Def:Section\toclvli{\arabic{lvli}}{#1}
\Def:Section\toclvlj{\arabic{lvlj}}{#1}
\Def:Section\toclvlk{\arabic{lvlk}}{#1}
\Def:Section\toclvll{\arabic{lvll}}{#1}
\let\no:toclvla\toclvla
\let\no:toclvlb\toclvlb
\let\no:toclvlc\toclvlc
\let\no:toclvld\toclvld
\let\no:toclvle\toclvle
\let\no:toclvlf\toclvlf
\let\no:toclvlg\toclvlg
\let\no:toclvlh\toclvlh
\let\no:toclvli\toclvli
\let\no:toclvlj\toclvlj
\let\no:toclvlk\toclvlk
\let\no:toclvll\toclvll
\def\toclvla{\rdef:sec{toclvla}}
\def\toclvlb{\rdef:sec{toclvlb}}
\def\toclvlc{\rdef:sec{toclvlc}}
\def\toclvld{\rdef:sec{toclvld}}
\def\toclvle{\rdef:sec{toclvle}}
\def\toclvlf{\rdef:sec{toclvlf}}
\def\toclvlg{\rdef:sec{toclvlg}}
\def\toclvlh{\rdef:sec{toclvlh}}
\def\toclvli{\rdef:sec{toclvli}}
\def\toclvlj{\rdef:sec{toclvlj}}
\def\toclvlk{\rdef:sec{toclvlk}}
\def\toclvll{\rdef:sec{toclvll}}
\def\toc{\csname toclvl\alph{tiefe}\endcsname}
>>>

\<\><<<
\let\no@toc\toc
\Def:Section\toc{\the\c@tiefe}{#1}
\let\no:toc\toc
\def\toc{\rdef:sec{toc}}
>>>

% \let\no@liketoc\J@ShortToc
% \Def:Section\liketoc{\the\c@tiefe}{#1}
% \let\no:liketoc\liketoc
% \let\liketoc\:UnDef
% \def\J@ShortToc{\rdef:sec{liketoc}}

%%%%%%%%%%%%%%%%
\Section{lineno}
%%%%%%%%%%%%%%%%

\Link[https://ctan.org/pkg/lineno]{}{}lineno\EndLink

\<lineno.4ht\><<<
% lineno.4ht (|version), generated from |jobname.tex 
% Copyright 2009-2023 TeX Users Group
% Copyright 2000-2009  Eitan M. Gurari
|<TeX4ht license text|>

\let\:tempc\linelabel
\pend:defI\:tempc{\let\sv:efloat|=\end@float \HRestore\end@float  }
\append:defI\:tempc{\let\end@float|=\sv:efloat  }
\HLet\linelabel\:tempc

\def\:tempc{\@tempdima\dp\@cclv \unvbox\@cclv
   \sbox\@tempboxa{\hbox to\z@{\a:lineno\makeLineNumber\b:lineno}}%
   \stepcounter{linenumber}%
   \dp\@tempboxa=\@tempdima\ht\@tempboxa=\z@
   \nointerlineskip\kern-\@tempdima\box\@tempboxa
   \ifnum\outputpenalty=-\linenopenaltypar\else
       \@tempcnta\outputpenalty
       \advance\@tempcnta -\linenopenalty
       \penalty\@tempcnta
   \fi
   }
\HLet\MakeLineNo\:tempc
\NewConfigure{lineno}{2}

% \linenumbers don't have any sense in the HTML output
% moreover, they cause equations and possibly other elements to fail
\HLet\linenumbers\relax

% if \linenumbers were used in the document preamble, we must disable them now:
\LineNumbersfalse

\Hinput{lineno}
\endinput
>>>        \AddFile{9}{lineno}

\Section{errata}

\<errata.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% errata.4ht                            |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\renewenvironment{erratalist}
  {\begin{longtable}{rp{2cm}lp{10cm}l}}
  {\endgobble\end{longtable}}

\Hinput{errata}
\endinput
>>>        \AddFile{9}{errata}

\Section{epigraph}

\Link[http://sunsite.bcc.bilkent.edu.tr/pub/tex/ctan/macros/latex/contrib/supported/epigraph/]{}{}sunsite\EndLink

\<epigraph.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% epigraph.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<epigraph conf|>
\Hinput{epigraph}
\endinput
>>>        \AddFile{9}{epigraph}

\<epigraph conf\><<<
\renewcommand{\epigraphhead}[2][95]{{%
  \a:epigraphhead#2\b:epigraphhead}}

\NewConfigure{epigraphhead}{2}
\NewConfigure{epirule}{1}  

\renewcommand{\epigraph}[2]{{\vspace{\beforeepigraphskip}
  \a:epigraph {#1}\ifdim\epigraphrule>\z@ \a:epirule \else \par\fi
      \b:epigraph {#2}\c:epigraph 
  \vspace{\afterepigraphskip}}}
\renewcommand{\qitem}[2]{\item 
  {\a:qitem {#1}\ifdim\epigraphrule>\z@ \a:epirule \else \par\fi
 \b:qitem  {#2}\c:qitem}}

\NewConfigure{epigraph}{3}
\NewConfigure{qitem}{3}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{float.sty}
%%%%%%%%%%%%%%%%%%%%%

\<float.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% float.4ht                             |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<float sty|>
\ifx \floatevery\:Undef    
  |<pre 2001/11/08 v1.3d float|>
\else
  |<since 2001/11/08 v1.3d float|>
\fi
\Hinput{float}
\endinput
>>>        \AddFile{9}{float}

\<pre 2001/11/08 v1.3d float\><<<
\let\float:xfloat=\@xfloat
\def\@xfloat #1[#2]{\float:xfloat{#1}[#2]%
   \expandafter\ifx\csname end#1\endcsname\float@end
      \expandafter\def\csname end#1\endcsname{\end@float\egroup}%
   \fi
   \expandafter\ifx\csname end#1*\endcsname\float@dblend
      \expandafter\def\csname end#1*\endcsname{\end@dblfloat\egroup}%
   \fi
}
>>>

\<since 2001/11/08 v1.3d float\><<<
\let\float:xfloat=\@xfloat
\def\@xfloat #1[#2]{\float:xfloat{#1}[#2]%
   \expandafter\ifx\csname end#1\endcsname\float@end
      \expandafter\def\csname end#1\endcsname{\end@float}%
   \fi
   \expandafter\ifx\csname end#1*\endcsname\float@dblend
      \expandafter\def\csname end#1*\endcsname{\end@dblfloat}%
   \fi
}
>>>

\<float sty\><<<
\def\caption{\:CheckOption{refcaption}\if:Option 
                   \SkipRefstepAnchor \fi
\refstepcounter\@captype \@dblarg{\@caption\@captype}}
\let\:tempc\listof
\pend:defII\:tempc{\begingroup
   \expandafter\ifx \csname toc\@nameuse{ext@##1}\endcsname\relax
      \ConfigureToc{\@nameuse{ext@##1}}{\par}{ }{}{}%
   \fi
   \edef\@starttoc{\noexpand
      \:tableofcontents[\@nameuse{ext@##1}]\noexpand\:gobble}}
\append:defII\:tempc{\endgroup}
\HLet\listof\:tempc
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{floatflt.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%%

\<floatflt.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% floatflt.4ht                          |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<floatflt sty|>
\Hinput{floatflt}
\endinput
>>>        \AddFile{9}{floatflt}

\<floatflt sty\><<<
\AtBeginDocument{%
   \edef\oldeverypar{\noexpand\HtmlPar\the\everypar}}
>>>

\<floatflt sty\><<<
\def\:temp{%
   \let\:setbox=\setbox
   \def\setbox{\let\:temp=\:temp \let\setbox=\:setbox
      \def\:temp####1={\a:floatingfigure}\:temp}%
   \o:floatingfigure:}
\HLet\floatingfigure=\:temp
\def\endfloatingfigure{\egroup\b:floatingfigure\par}
\NewConfigure{floatingfigure}{2}
>>>

The following might be problematic with a caption

% \Configure{floatingfigure}
%    {\HCode{<span class="floatflt-\ifoddpages o\else e\fi
%                               \theOptionTest">}\IgnorePar}
%    {\HCode{</span>}}
% \Css{.floatflt-e0 img{float:left}}
% \Css{.floatflt-e1 img{float:left}}
% \Css{.floatflt-e2 img{float:right}}
% \Css{.floatflt-o0 img{float:left}}
% \Css{.floatflt-o1 img{float:left}}
% \Css{.floatflt-o2 img{float:right}}

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{fancybox.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<fancybox.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% fancybox.4ht                          |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<fancybox hooks|>
\Hinput{fancybox}
\endinput
>>>        \AddFile{7}{fancybox}

\<fancybox hooks\><<<
\def\:tempc#1#2{\begingroup #1\relax \hbox{{#2}}\endgroup}
\HLet\@ovalbox\:tempc
\HLet\doublebox|=\ovalbox
\HLet\shadowbox|=\ovalbox
\pend:defI\VerbBox{\a:VerbBox}
\append:def\end@VerbBox{\b:VerbBox}
\NewConfigure{VerbBox}{2}
\pend:def\shadowbox{\Configure{VerbBox}{\a:shadowbox}{\b:shadowbox}}
\NewConfigure{shadowbox}{2}
\pend:def\ovalbox{\Configure{VerbBox}{\a:ovalbox}{\b:ovalbox}}
\NewConfigure{ovalbox}{2}
\pend:def\Ovalbox{\Configure{VerbBox}{\a:Ovalbox}{\b:Ovalbox}}
\NewConfigure{Ovalbox}{2}
\pend:def\doublebox{\Configure{VerbBox}{\a:doublebox}{\b:doublebox}}
\NewConfigure{doublebox}{2}
>>>

\<fancybox hooks\><<<
\def\Btrivlist#1{\@ifnextchar[{\@Btrivlist{#1}}{\@Btrivlist{#1}[]}} 
\def\@Btrivlist#1[#2]{% 
  \@Blistrestore 
  \let\\=\@Btrivlistcr
\a:Btrivlist 
\expandafter\edef\csname Btrivlist-dir\endcsname{\expandafter\noexpand\csname
    \if#1la\else\if#1rc\else b\fi\fi 
    :Btrivlist-dir\endcsname
}%
  \fb@beginvbox{#2}% 
  \TeXhalign\bgroup 
    \hfil
    \c:Btrivlist
    \ignorespaces##\unskip 
    \d:Btrivlist
    \if#1r\@empty\else\hfil\fi\cr} 
\def\endBtrivlist{\crcr\egroup 
                  \egroup\b:Btrivlist\if@pboxsw$\fi}
\NewConfigure{Btrivlist}{4}
\NewConfigure{Btrivlist-dir}[1]{%
     \if :#1:\else \expandafter\Btrivlist:dir\fi {#1}}
\def\Btrivlist:dir#1#2{\expandafter\def
     \csname\if#1la\else\if#1rc\else b\fi\fi :Btrivlist-dir\endcsname{#2}%
     \csname c:Btrivlist-dir:\endcsname}
>>>

\<fancybox hooks\><<<
\def\@Blist#1#2[#3]{% 
  \ifnum\@listdepth>5 
    \@toodeep 
  \else 
    \global\advance\@listdepth\@ne 
  \fi 
  \itemindent\z@ 
  \csname @list\romannumeral\the\@listdepth\endcsname 
  \def\@itemlabel{#1}% 
  \let\makelabel\@mklab 
  \@nmbrlistfalse 
  \@Blistrestore 
  \let\\=\@Blistcr 
  \let\item\Bitem 
  \@Bitemswfalse 
  #2\relax
  \gdef\dd:Blist{\global\let\dd:Blist=\d:Blist}\a:Blist
  \fb@beginvbox{#3}% 
  \TeXhalign\bgroup
    \dd:Blist\c:Blist\e:Blist \ignorespaces##\f:Blist
    &\e:Blist\ignorespaces##\unskip\hfil\f:Blist\cr} 
\def\endBlist{\crcr\egroup 
                  \egroup\dd:Blist\b:Blist\if@pboxsw$\fi
                  \global\advance\@listdepth\m@ne} 
\NewConfigure{Blist}{6}
>>>

\<fancybox hooks\><<<
\let\Beqnarray=\eqnarray
\let\endBeqnarray=\endeqnarray
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{adjustbox.sty}
%%%%%%%%%%%%%%%%%%%%%%%

\<adjustbox.4ht\><<<
% adjustbox.4ht (|version), generated from |jobname.tex
% Copyright 2019-2022 TeX Users Group
|<TeX4ht license text|>
\NewConfigure{AdjustboxValignTop}{1}
\NewConfigure{AdjustboxValignMiddle}{1}
\NewConfigure{AdjustboxValignCenter}{1}
\NewConfigure{AdjustboxValignBottom}{1}
\pend:def\adjbox@valign@t{\a:AdjustboxValignTop}
\pend:def\adjbox@valign@t{\a:AdjustboxValignTop}
\pend:def\adjbox@valign@T{\a:AdjustboxValignTop}
\pend:def\adjbox@valign@M{\a:AdjustboxValignMiddle}
\pend:def\adjbox@valign@m{\a:AdjustboxValignMiddle}
\pend:defI\adjbox@valign@c{\a:AdjustboxValignCenter}
\pend:def\adjbox@valign@b{\a:AdjustboxValignBottom}
\pend:def\adjbox@valign@B{\a:AdjustboxValignBottom}

% make an unique ID for each adjustbox environment
\newcounter{adjustbox@4ht}
\def\update:adjustbox:id{\stepcounter{adjustbox@4ht}\def\AdjustboxId{adjustbox-\arabic{adjustbox@4ht}}}

\NewConfigure{Adjustbox}{2}

\def\:tempa#1#2#3#4{\update:adjustbox:id\a:Adjustbox\o:adjbox@@frame:{#1}{#2}{#3}{#4}\b:Adjustbox
}
\HLet\adjbox@@frame\:tempa

% suppress trying to draw the frame
\def\adjbox@boxframe#1#2#3{}

% patch macro that collects adjustbox contents and draw box. we disable this functionality, as all 
% of this should be handled by CSS
% keys are set, so it should be possible to extract  colors or frame size in theory
\long\def\:temp#1#2{%
  % copy of definitions from \@adjustbox, to prevent compilation errors
  \edef\adjbox@line{\the\inputlineno}%
  \let\collectbox@mode\relax
  \let\collectbox@noindent\relax
  \let\adjbox@collectbox\@collectbox
  \let\adjbox@begininnercode\@empty
  \let\adjbox@endinnercode\@empty
  \chardef\adjbox@innerlevel\z@
  \update:adjustbox:id\adjbox@setkeys{#1}\a:Adjustbox #2\b:Adjustbox\endgroup}
\HLet\@adjustbox\:temp


% definitions for macros
% we don't save any colors and just use one configuration for all box types.  
\def\:tempa#1{\update:adjustbox:id\a:Adjustbox\BOXCONTENT\b:Adjustbox}
\HLet\@bgcolorbox\:tempa
\def\:tempa#1#2#3{\update:adjustbox:id\leavevmode\a:Adjustbox\BOXCONTENT\b:Adjustbox}
\HLet\@foregroundbox\:tempa
\def\:tempa#1#2#3{\update:adjustbox:id\leavevmode\a:Adjustbox\BOXCONTENT\b:Adjustbox}
\HLet\@backgroundbox\:tempa

\Hinput{adjustbox}
\endinput
>>> \AddFile{7}{adjustbox}

%%%%%%%%%%%%%%%%%%%%%%%
\Section{awesomebox.sty}
%%%%%%%%%%%%%%%%%%%%%%%
\<awesomebox.4ht\><<<
% awesomebox.4ht	
% Copyright 2020 TeX Users Group
|<TeX4ht license text|>
|<awesomebox config|>
\Hinput{awesomebox}
\endinput
>>> \AddFile{7}{awesomebox}


\<awesomebox config\><<<
\NewConfigure{awesomebox}{3}
\newcounter{awesomebox:cnt}
\RenewDocumentCommand \awesomebox { O{abvrulecolor} O{} o m m m +m }{%
  \stepcounter{awesomebox:cnt}%
  \def\awesomebox@id{awesomebox-\arabic{awesomebox:cnt}}%
  \extractcolorspec{#1}{\awesomebox@rule@color}%
  \expandafter\convertcolorspec\awesomebox@rule@color{HTML}\awesomebox@rule@color%
\a:awesomebox%
  \IfValueTF {#3}%
      {  #3 \\ #2 \textcolor{#6}{\Huge#5}\b:awesomebox #7  #2}%
      {         #2 \textcolor{#6}{\Huge#5}\b:awesomebox #7  #2}%
\c:awesomebox%
}

>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{transparent.sty}
%%%%%%%%%%%%%%%%%%%%%%%

\<transparent.4ht\><<<
% transparent.4ht (|version), generated from |jobname.tex
% Copyright 2023 TeX Users Group
|<TeX4ht license text|>
|<transparent shared config|>
\Hinput{transparent}
\endinput

>>> \AddFile{7}{transparent}

The transparent package doesn't define its commands in the DVI mode, so we need to provide
our versions. 

\<transparent shared config\><<<
% dummy command, just to prevent compilation errors
\providecommand\transparent[1]{}
% this can actually do something useful, as it operates on encloded content.
\NewConfigure{texttransparent}{2}
\providecommand\texttransparent[2]{\def\transparent:opacity{#1}\a:texttransparent#2\b:texttransparent}
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{changepage.sty}
%%%%%%%%%%%%%%%%%%%%%%%
\<changepage.4ht\><<<
% changepage.4ht (|version), generated from |jobname.tex
% Copyright 2023-2024 TeX Users Group
|<TeX4ht license text|>
|<changepage shared config|>
\Hinput{changepage}
\endinput

>>> \AddFile{7}{changepage}

Changepage uses a list environment to make a text with changed left and right margin. 
We will instead save the margin didmension for the further processing in the output
format configuration. 


\<changepage shared config\><<<
\NewConfigure{adjustwidth}{2}

\def\:tempa#1#2{%
  % arguments can be empty, in that case we must declare 
  % the margins as null dimension, to prevent calculation errors
  \edef\adjustwidth:left{\if\relax#1\relax0pt\else#1\fi}%
  \edef\adjustwidth:right{\if\relax#2\relax0pt\else#2\fi}%
  \a:adjustwidth%
}
\HLet\adjustwidth\:tempa
\expandafter\HLet\csname adjustwidth*\endcsname\:tempa

\def\:tempa{\b:adjustwidth}
\HLet\endadjustwidth\:tempa
\expandafter\HLet\csname endadjustwidth*\endcsname\:tempa

>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{cprotect.sty}
%%%%%%%%%%%%%%%%%%%%%%%
\<cprotect.4ht\><<<
% cprotect.4ht (|version), generated from |jobname.tex
% Copyright 2023 TeX Users Group
|<TeX4ht license text|>
|<cprotect shared config|>
\Hinput{cprotect}
\endinput

>>> \AddFile{7}{cprotect}

Cprotect package can protect commands and environments. It adds some
special characters at the end of the protected content. Because
of chatcode issues caused by redefinition of the hat character by TeX4ht,
these characters were displayed verbatim in the document. This definition
should fix the catcode issue and prevent this problem

\<cprotect shared config\><<<
{
\catcode`\^=7
\gdef\CPT@hat@hat@E@hat@hat@L{^^E^^L}
}
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{alltt.sty}
%%%%%%%%%%%%%%%%%%%%%%%

\<alltt.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% alltt.4ht                             |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

   |<fix alltt|>
   |<alltt.sty shared config|>
\Hinput{alltt}
\endinput
>>>        \AddFile{7}{alltt}

\<fix alltt\><<<
\append:def\alltt{%
   \def\:tempa{\ifx\:temp\par
                   \everypar\expandafter{\expandafter\everypar
                           \expandafter{\the\ht:everypar}}\fi}%
   \futurelet\:temp\:tempa}
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{lb.sty}
%%%%%%%%%%%%%%%%%%%%%%%

\Verbatim

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  lb.sty, version 1.8 vom 18.07.95
%  style file fuer die reihe 'Lehrbuch'
%  copyright by International Thomson Publishing GmbH
%  autorin: luzia dietsche
%  email: x68@dante.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\EndVerbatim

\<lb.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% lb.4ht                                |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>
% For lb.sty, International Thomson Publishing GmbH
% \input{lb.4ht} into cfg file

\catcode`\@=11
\catcode`\:=11

\pend:defII\@makechapterhead{\bgroup \let\fbox=\hbox}
\append:defII\@makechapterhead{\egroup}

\pend:defI\@makechapterheadOhneArg{\bgroup \let\fbox=\hbox}
\append:defI\@makechapterheadOhneArg{\egroup}

\pend:defII\@makeschapterhead{\bgroup \let\fbox=\hbox}
\append:defII\@makeschapterhead{\egroup}

\pend:defI\@makeschapterheadOhneArg{\bgroup \let\fbox=\hbox}
\append:defI\@makeschapterheadOhneArg{\egroup}

\def\@makechapterheadOhneArg#1{}

\catcode`\@=12
\catcode`\:=12
\Hinput{lb}
\endinput
>>>        \AddFile{9}{lb}

%%%%%%%%%%%%%%%%%%%%%
\Section{latin1.def}
%%%%%%%%%%%%%%%%%%%%%

\<latin1.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% latin1.4ht                            |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<config textdegree|>
\let\mathonesuperior=\:UnDef
\providecommand{\mathonesuperior}{{\sp1}}
\let\maththreesuperior=\:UnDef
\providecommand{\maththreesuperior}{{\sp3}}
\let\mathtwosuperior=\:Undef
\providecommand{\mathtwosuperior}{{\sp2}}

\Hinput{latin1}
\endinput
>>>        \AddFile{7}{latin1}

\<config textdegree\><<<
\def\:tempc{\a:textdegree}
\expandafter\HLet\csname ?\string\textdegree\endcsname=\:tempc
\NewConfigure{textdegree}{1}
\Configure{textdegree}{{\ensuremath{{\sp\circ}}}}
>>>

% \expandafter\def\csname ?\string\textdegree\endcsname{{\sp\circ}}
% \def\mathonesuperior{{\sp1}}
% \def\maththreesuperior{{\sp3}}
% \def\mathtwosuperior{{\sp2}}

%%%%%%%%%%%%%%%%%%%%%
\Section{utf8.def}
%%%%%%%%%%%%%%%%%%%%%

\<utf8.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% utf8.4ht                              |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\def\UTFviii:two@octets#1#2{\string#1\string#2} 
\Configure{@newlabel}{\HLet\UTFviii@two@octets\UTFviii:two@octets} 

\Hinput{utf8}
\endinput
>>>        \AddFile{7}{utf8}

The above is to preserve characters in `sensitive' locations:

\Verbatim
\documentclass{article} 
\usepackage[utf8]{inputenc} 
\usepackage{ngerman} 
\usepackage{hyperref} 
 
\begin{document} 
   X \autoref{fig:add_todo} 
 
   \begin{figure}[hbt!] 
      \caption{Für X} 
      \label{fig:add_todo} 
   \end{figure} 
\end{document} 
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%
\Section{utf8x.def}
%%%%%%%%%%%%%%%%%%%%%

Note: the following file is requested by ucs.4ht and loaded outside the normal
tex4ht environmet so, in particular, catcode are not set for it.

\<utf8x.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% utf8x.4ht                             |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config utf8x|>%
%  \Hinput{utf8x}
\endinput
>>>        \AddFile{7}{utf8x}

\<config utf8x\><<<
\bgroup
\def\temp#1{%
   \ifnum \count255<224
      \expandafter\gdef\csname :u8-\number\count255\endcsname ##1{%
           \string#1\string##1}%
   \else\ifnum \count255<240
      \expandafter\gdef\csname :u8-\number\count255\endcsname ##1##2{%
           \string#1\string##1\string##2}%
   \else \ifnum \count255<245
      \expandafter\gdef\csname :u8-\number\count255\endcsname ##1##2##3{%
           \string#1\string##1\string##2\string##3}%
   \fi\fi\fi
   \edef\tempa{%
      \noexpand\Configure{@newlabel}{\noexpand\let\noexpand #1\expandafter
                      \noexpand\csname :u8-\number\count255\endcsname}}%
   \tempa
}

 \count255=194\relax 
 \loop\ifnum\count255<245\relax 
    \catcode\count255\active 
    \begingroup 
      \uccode`\~\count255% 
      \uccode`\u`\u% 
      \uppercase{% 
    \endgroup 
         \temp{~}}% 
    \advance\count255by1\relax 
 \repeat
  \expandafter\global\expandafter\let\csname a:@newlabel\expandafter
                           \endcsname\csname a:@newlabel\endcsname
\egroup
>>>

What is the difference between \`'\uccode`\~\count255 %SPACE'
and

\Verbatim
      \uccode`\~\count255% 
      \uccode`\u`\u% 
\EndVerbatim

utf8x.def has both.

The above is to preserve characters in `sensitive' locations:

\Verbatim
\documentclass{article} 
\usepackage{ucs}
\usepackage[utf8]{inputenc} 
\usepackage{ngerman} 
\usepackage{hyperref} 
 
\begin{document} 
   X \autoref{fig:add_todo} 
 
   \begin{figure}[hbt!] 
      \caption{Für X} 
      \label{fig:add_todo} 
   \end{figure} 
\end{document} 
\EndVerbatim

%%%%%%%%%%%%%%%%%%%%%
\Section{ucs.def}
%%%%%%%%%%%%%%%%%%%%%

\<ucs.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ucs.4ht                               |version %
% Copyright (C) |CopyYear.2007.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\AtBeginDocument{%
   \ifx\restore@utf@viii@actives\undefined  \else
     \input utf8x.4ht
   \fi}

%  \Hinput{ucs}
\endinput
>>>        \AddFile{7}{ucs}

%%%%%%%%%%%%%%%%%%%%%
\Section{acm-proc-article-sp.sty}
%%%%%%%%%%%%%%%%%%%%%

\Link[http://www.acm.org/sigs/pubs/proceed/template.html]{}{}files\EndLink

\<acm_proc_article-sp.4ht\><<<
% acm_proc_article-sp.4ht (|version), generated from |jobname.tex
% Copyright (C) |CopyYear.2001. Eitan M. Gurari
|<TeX4ht copywrite|>
   |<config acm-proc-article-sp|>
\Hinput{acm-proc-article-sp}
\endinput
>>>        \AddFile[acm_proc_article-sp]{9}{acm-proc-article-sp}

\<sig-alternate.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% sig-alternate.4ht                     |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
   \input acm_proc_article-sp.4ht  
   |<config sig-alternate|>
\Hinput{sig-alternate}
\endinput
>>>        \AddFile{9}{sig-alternate}

The above style files, and provided example, are a little weirds at points.
\List{*}
\item
+ Strange accents
\`'\affaddr{The Th{\large{\sf{\o}}}rv{$\ddot{\mbox{a}}$}ld Group}\\'
\item Empty picture in copyrightspace of acm-proc-article-sp
\item The definition \''\@ptsize{}' is improper---it should provide a number
\item
No defintion for \''\@xtitlenote'. Used in
\''\def\titlenote{\@ifnextchar[\@xtitlenote'
\item  \''\newfont' provides a tex font; not a latex font. Hence,
for instance, the braces in \''\confname{\the\conf}'  are useless (and
misleading for the human eyes). 
\item Missing \''\def\endthebibliography{\endlist}'
\item Use

\Verbatim
\def\thesubsubsection{\thesubsection.\arabic{subsubsection}}
\def\theparagraph{\thesubsubsection.\arabic{paragraph}}
\EndVerbatim

instead of

\Verbatim
\def\thesubsubsection{{\subsecfnt\thesubsection.\arabic{subsubsection}}}
\def\theparagraph{{\subsecfnt\thesubsubsection.\arabic{paragraph}}}
\EndVerbatim

We don't know where they go (in tex4ht they may arrive to attributes
of  \''<a>' elements.
\EndList

\<config sig-alternate\><<<
\def\thesubsubsection{\thesubsection.\arabic{subsubsection}}
\def\theparagraph{\thesubsubsection.\arabic{paragraph}}
\def\endthebibliography{\endlist}
>>>

\<config acm-proc-article-sp\><<<
\catcode`\:=12 
\def\@citex#1[#2]#3{%
    \let\@citea\@empty
    \csname a:cite\endcsname
    \@cite{%
        \@for\@citeb:=#3\do{%
            \@citea
            \def\@citea{#1 }%
            \edef\@citeb{\expandafter\@iden\@citeb}%
            \if@filesw
                \immediate\write\@auxout{\string\citation{\@citeb}}%
            \fi
            \@ifundefined{b@\@citeb}{%
                {\bf ?}%
                \@warning{%
                    Citation `\@citeb' on page \thepage\space undefined%
                }%
            }%
            {\cIteLink {X\@citeb}{}\csname b@\@citeb\endcsname\EndcIteLink}%
        }%
    }{#2}%
    \csname b:cite\endcsname
}
\catcode`\:=11
>>>

\<config acm-proc-article-sp\><<<
\def\qed:sym{\leavevmode\a:qed }
\def\:temp{\qed:sym \global\@qededtrue }
\HLet\qed|=\:temp
\NewConfigure{qed}{1}
\def\endfigure{\end@float}
\def\endtable{\end@float}
\def\:temp#1{\a:email{#1}}
\HLet\email=\:temp
\def\c:email:{\def\a:email##1}
\Configure{email}{\o:email:{#1}}
|<config makecaption|>
>>>

\<config acm-proc-article-sp\><<<
\def\:temp{\let\sv:item\item
   \def\item[##1]{|<no page break before item|>\let\item\sv:item
                  \item[##1]\b:newtheorem}%
   \a:newtheorem  %\AutoRefstepAnchor
   \o:@ydefthm:}
\HLet\@ydefthm\:temp
\def\:temp{\let\sv:item\item
   \def\item[##1]{|<no page break before item|>%
                  \let\item\sv:item\item[##1]\b:newtheorem}%
   \a:newtheorem  %\AutoRefstepAnchor
   \o:@begindef:}
\HLet\@begindef\:temp
\def\:temp{\let\sv:item\item
   \def\item[##1]{|<no page break before item|>%
                  \let\item\sv:item\item[##1]\b:proof}%
   \a:proof  \o:@proof:}
\HLet\@proof\:temp
\def\:temp{\let\sv:item\item
   \def\item[##1]{|<no page break before item|>%
                  \let\item\sv:item\item[##1]\b:proof}%
   \a:proof \o:@xproof:}
\HLet\@xproof\:temp
\append:def\endproof{\c:proof}
\NewConfigure{proof}{3}
>>>

\<config acm-proc-article-sp\><<<
\pend:def\@maketitle{%
  \let\thefootnote=\no:thefootnote
  \let\@makefnmark=\no:@makefnmark
  \pend:def\@title{\a:title}\append:def\@title{\b:title}%
  \edef\:temp{\the\subtitletext}%
  \ifx \:temp\empty \else
     \edef\:temp{\subtitletext={\noexpand\a:subtitle
                   \the\subtitletext\noexpand\b:subtitle}}\:temp
  \fi
  \ConfigureEnv{center}{\empty}{}{\empty}{\empty}
  \Configure{tabular}{}{}{}{}{\a:author}{\b:author}
  \ConfigureEnv{tabular}{\empty}{}{}{}%
  \ifx \@thanks\empty\else
    \pend:def\@thanks{\a:thanks}\append:def\@thanks{\b:thanks}%
  \fi
}
\NewConfigure{title}{2}
\NewConfigure{subtitle}{2}
\NewConfigure{thanks}{2}
\NewConfigure{author}{2}
\pend:def\maketitle{%
   \let\no:thefootnote=\thefootnote
   \let\no:@makefnmark=\@makefnmark
   \a:maketitle \bgroup
   |<adjust minipageNum for setcounter footnote 0|>%
}
\append:def\maketitle{\egroup \b:maketitle }
\NewConfigure{maketitle}{2}
\def\titlenote{\@ifnextchar[\@xtitlenote{%
   \global\advance\titlenotecount by 1
   \let\acm:@footnotetext=\@footnotetext
   \let\acm:thefootnote=\thefootnote
   \long\def\@footnotetext####1{%
         \let\@footnotetext=\acm:@footnotetext
         {\reset@font\footnotesize
          \@footnotetext{####1}}\let\thefootnote=\acm:thefootnote}%
   \def\thefootnote{\@fnsymbol\titlenotecount}%
   \footnote}}
\pend:def\abstract{\titlenotecount=0 }
>>>

\<config acm-proc-article-sp\><<<
\NewConfigure{toappear}{2}
\def\@copyrightspace{\ifx \@toappear\empty \else
    \a:toappear{%
      |<toappear parts|>%
      \crnotice{\@toappear}}\b:toappear
  \fi}
\NewConfigure{boilerplate}{2}
\NewConfigure{conf}{2}
\NewConfigure{confinfo}{2}
\NewConfigure{copyrightetc}{2}
>>>

\<toappear parts\><<<
\edef\:temp{\the\conf}\ifx \:temp\empty\else
  \edef\:temp{\conf={\noexpand\a:conf\the\conf\noexpand\b:conf}}\:temp
\fi
\edef\:temp{\the\confinfo}\ifx \:temp\empty\else
  \edef\:temp{\confinfo={\noexpand
      \a:confinfo\the\confinfo\noexpand\b:confinfo}}\:temp
\fi
\edef\:temp{\the\copyrightetc}\ifx \:temp\empty\else
  \edef\:temp{\copyrightetc={\noexpand
     \a:copyrightetc\the\copyrightetc\noexpand\b:copyrightetc}}\:temp
\fi
>>>

\<config acm-proc-article-sp\><<<
|<html late parts|>
|<html late sections|>
|<subsections for book / report / article|>
|<subsubsections for book / report / article|>
|<paragraphs for book / report / article|>
\let\acm:sect|=\no@sect
\def\no@sect#1#2#3{\acm:sect{#1}{#2}{#3\relax\let\@svsec|=\empty}}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{endnotes.sty}
%%%%%%%%%%%%%%%%%%%%%

\<endnotes.4ht\><<<
% endnotes.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2001. Eitan M. Gurari
|<TeX4ht copywrite|>
   |<fix endnotes|>
\Hinput{endnotes}
\endinput
>>>        \AddFile{9}{endnotes}

\<fix endnotes\><<<
\HAssign\endnote:N=0
\def\endnoteN{\endnote:N}
\def\:tempc{\addtoendnotes
   {\def\string\endnoteN{\endnote:N}}\o:@endnotetext:}
\HLet\@endnotetext=\:tempc
\def\@makeenmark{%
   \gHAdvance\endnote:N by 1
   \hbox{\textsuperscript{\a:makeenmark\@theenmark\b:makeenmark}}}
\NewConfigure{makeenmark}{2}
\def\enoteformat{\rightskip\z@ \leftskip\z@ \parindent=1.8em
     \leavevmode\llap{\hbox{\textsuperscript{\@theenmark}}}}

\NewConfigure{theendnotes}{2}
\NewConfigure{enoteformat}{2}
>>>

BibLaTeX patches theendnotes at begin document, and it produces
compilation error, because it cannot find the \''\enoteformat'
command here. We can postpone our redefinition to the moment,
when BibLaTeX patched the command already.

\<fix endnotes\><<<
\AtBeginDocument{%
\def\:tempc{\bgroup
   \pend:def\enoteformat{\a:enoteformat}%
   \append:def\enoteformat{\b:enoteformat}%
   \a:theendnotes \o:theendnotes: \b:theendnotes \egroup}
\HLet\theendnotes=\:tempc
}
>>>

%%%%%%%%%%%%%%%%%
\Section{2up}
%%%%%%%%%%%%%%%%%

\<2up.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% 2up.4ht                               |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<conf 2up|>
\Hinput{2up}
\endinput
>>>       

       \AddFile{9}{2up}

\<conf 2up\><<<
\ifx \enddocument\:UnDef \else
\pend:def\enddocument{%
   \let\twoupclearpage=\empty
   \append:def\@enddocumenthook{\clearpage \twoup@eject}%
}
\fi
>>>

%%%%%%%%%%%%%
\Section{web}
%%%%%%%%%%%%%

\<web.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% web.4ht                               |version %
% Copyright (C) |CopyYear.1999.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\let\web:startsection=\@startsection
\def\@startsection{\def\@seccntformat##1{}\web:startsection}

\def\maketitle{{%
   |<adjust minipageNum for setcounter footnote 0|>%
   \a:mktl
   \pend:def\webversion{\a:webversion}%    
   \append:def\webversion{\b:webversion}%    
   \pend:def\webtitle{\a:webtitle}%
   \append:def\webtitle{\b:webtitle}%
   \pend:def\webauthor{\a:webauthor}%
   \append:def\webauthor{\b:webauthor}%
   \pend:def\webuniversity{\a:webuniversity}%
   \append:def\webuniversity{\b:webuniversity}%
   \o:maketitle: \b:mktl}}

\NewConfigure{maketitle}[2]{\def\a:mktl{#1}\def\b:mktl{#2}}
\NewConfigure{webauthor}{2}
\NewConfigure{webtitle}{2}
\NewConfigure{webuniversity}{2}
\NewConfigure{webversion}{2}
|<def HColor|>
\Hinput{web}
\endinput
>>>       \AddFile{9}{web}

\<exerquiz.4ht\><<<
% exerquiz.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1999. Eitan M. Gurari
|<TeX4ht copywrite|>

\def\Rect#1{#1}
\ifx \pdf@rect\:UnDef
   \newsavebox{\pdf@box}
   \def\pdf@rect#1{\leavevmode #1}
\fi
\NewConfigure{javascript}{1}

\let\sv:tocsection|=\tocsection
\def\tocsection{\let\toclikesection|=\:gobbleIII \sv:tocsection}
\def\hypertarget#1#2{\Link{}{#1}\EndLink#2}
\def\hyperlink#1#2{\Link{#1}{}#2\EndLink}

\append:def\exercise{\Link{}{page.ex\the@exno}\EndLink }
\pend:def\endsolution@sq{\def\thepage{ex\the@exno}}

\let\:shortquiz|=\shortquiz
\def\shortquiz{\gHAdvance\:onClick by 1
   \Link{}{page.qz\:onClick}\EndLink   \:shortquiz
   \pend:def\endsolution@sq{\def\thepage{qz\:onClick}}}

\pend:def\include@quizsolutions{%
    \let\sv:newpage|=\newpage
    \append:def\newpage{\ht:everypar{\HtmlPar}}}
\append:def\include@solutions{%
    \let\noindent|=\sv:noindent}

|<configure answers|>
\Hinput{exerquiz}
\endinput
>>>                                   \AddFile{9}{exerquiz}



\<configure answers\><<<
\HAssign\:onClick = 0
\HAssign\Prob:N = 0
\HAssign\Quiz:N = 0

\append:def\shortquiz{\pend:def\answers{\gHAdvance\Prob:N by 1
   \let\:NAME|=\empty}}
\let\:@quiz|=\@quiz
\def\@quiz*#1#2{%
   \if #1f \let\c:quiz|=\C:quiz\fi
   \:@quiz*{#1}{#2}%
   \pend:defI\answers{\gHAdvance\Prob:N by 1
   \let\:NAME|=\empty}}

\pend:def\quiz{%
   \let\:bqlabel|=\bqlabel
   \def\bqlabel{\IgnorePar\EndP
      \Tg<form action="." class="quiz"
            id="thisform\Quiz:N">%
            \Tg<input value="\:bqlabel"  type="reset"
             onClick='\c:quiz' />}%
    \let\:eqlabel|=\eq@eqlabel
    \def\eq@eqlabel{\IgnorePar\EndP
             \Tg<input type="button" value="\:eqlabel"
             onClick='\a:javascript \d:quiz' />%
        \ifeq@nocorrections\else
           \Tg<input type="button" value="\eq@CA"
              name="correct\Quiz:N"
              onClick='\a:javascript \e:quiz' />%
        \fi
    }%
    \gHAdvance\Quiz:N by 1 \gHAssign\Prob:N=0    \ShowPar
   }
\append:def\endquiz{\let\eq@eqlabel|==\:eqlabel
   \Tg</form>\Tag{ans-\Quiz:N}{\Prob:N}}
|<configure shortquiz|>
|<configure quiz|>
|<configure quiz*|>
\LinkCommand\js:link{input,,,, /}
\LinkCommand\js:Link{input,onClick='\a:javascript \noexpand\:tempa
   href(\noexpand\:gobble,,, /}
\def\js:click#1#2#3{\ifnum #3=0
      \js:link[ type="button" value="#2"\Hnewline
                class="onClickClass"  onClick='\a:javascript #1'
                name="ans\Quiz:N y\Prob:N"
                \:NAME]{}{}%
   \else
      \def\:tempa{#1}%
      \js:Link[ );' type="button" value="#2"\Hnewline
                name="ans\Quiz:N y\Prob:N"
                class="onClickClass"  \:NAME]{\@qzsolndest}{}%
   \fi
}
>>>

\<configure shortquiz\><<<
\pend:def\shortquiz{\leavevmode
   \Tg<form action="." class="shortquiz">\IgnorePar}
\append:def\endshortquiz{\Tg</form>}{}{}
\def\Ans@i#1{\stepcounter{quizno}{
   \ifx#11
         \js:click{\b:shortquiz}{\a:shortquiz}{\ifx
                \@qzsolndest\empty 0\else 1\fi}%
   \else \js:click{\c:shortquiz}{\a:shortquiz}{0}%
   \fi
}}%
\NewConfigure{shortquiz}{3}
\pend:defII\ReturnTo{\noindent\a:ReturnTo}
\append:defII\ReturnTo{\b:ReturnTo}
\NewConfigure{ReturnTo}{2}
>>>

\<configure quiz\><<<
\def\Ans@l#1{\stepcounter{quizno}%
   \ifnum #1=1 \def\:NAME{ id="ans\Quiz:N x\Prob:N" }\fi
   \def\ANS{#1}%
   \js:click{\b:quiz}{\a:quiz}{0}}
\NewConfigure{quiz}{5}
>>>

\<configure quiz*-NOPE\><<<
\def\Ans@f#1{\stepcounter{quizno}%
   \def\ANS{#1}%
   \Tg<input type="radio"
      \ifnum #1=1 id="ans\Quiz:N x\Prob:N" \fi
      name="ans\Quiz:N y\Prob:N"
      class="onClickClass" onClick='\a:javascript \a:ANS' />}
\NewConfigure{quiz*}[1]{\def\a:ANS{#1}}
\Configure{quiz*}{}
>>>

\<configure quiz*\><<<
\def\Ans@f#1{\stepcounter{quizno}%
   \ifnum #1=1 \def\:NAME{ id="ans\Quiz:N x\Prob:N" }\fi
   \def\ANS{#1}%
   \js:click{\B:quiz}{\A:quiz}{0}}
\NewConfigure{quiz*}[3]{\def\A:quiz{#1}\def\B:quiz{#2}\def\C:quiz{#3}}
\Configure{quiz*}{}{}{}
>>>

We must fix some exerquiz issues before we load the package itself.

\<add to usepackage\><<<
\Configure{PackageHooks}{exerquiz.sty}{exerquiz-hooks.4ht}
>>>

\<exerquiz-hooks.4ht\><<<
% exerquiz-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
\ifdefined\headerps@out\else%
\def\headerps@out#1{}%
\fi
% \AtBeginDocument{\let\origa:Form\a:Form\let\a:Form\relax}
% \AtEndDocument{\let\b:Form\relax}
% \AtEndOfPackage{\AtBeginDocument{\let\a:form\origa:Form}}
>>>\AddFile{9}{exerquiz-hooks}

\Section{hyperxmp.sty}


We want to prevent execution of PDF related commands from 
Hyperxmp.

\<hyperxmp.4ht\><<<
% hyperxmp.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht copywrite|>
\renewcommand*{\hyxmp@use@first@valid}[3]{}
\let\hyxmp@embed@packet\relax
\Hinput{hyperxmp}
\endinput
>>>\AddFile{9}{hyperxmp}



\<add to usepackage\><<<
\Configure{PackageHooks}{hyperxmp.sty}{hyperxmp-hooks.4ht}
>>>

It seems that pdfffedback primitive is defined in the DVI mode
in LuaTeX. This results in package loading error with the
Hyperxmp package. We make it temporarily undefined, in order
to prevent execution of the failing code.

\<hyperxmp-hooks.4ht\><<<
% hyperxmp-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht copywrite|>
% package redefinitions
\let\orig:pdffeedback\pdffeedback
\let\pdffeedback\@undefined
\:AtEndOfPackage{
\let\pdffeedback\orig:pdffeedback
}

>>>\AddFile{9}{hyperxmp-hooks}

\Section{datetime2.sty}
 
\<add to usepackage\><<<
\Configure{PackageHooks}{datetime2.sty}{datetime2-hooks.4ht}
>>>

It seems that pdfffedback primitive is defined in the DVI mode
in LuaTeX. This results in package loading error with the
Datetime2 package. We make it temporarily undefined, in order
to prevent execution of the failing code.

\<datetime2-hooks.4ht\><<<
% datetime2-hooks.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht copywrite|>
% package redefinitions
\let\orig:pdffeedback\pdffeedback
\let\pdffeedback\@undefined
\:AtEndOfPackage{
\let\pdffeedback\orig:pdffeedback
}
>>>\AddFile{9}{datetime2-hooks}

%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{breqn.sty}
%%%%%%%%%%%%%%%%%%%%%%%%%

\<breqn.4ht\><<<
% breqn.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht copywrite|>
|<breqn environments|>
|<breqn commands|>
\Hinput{breqn}
\endinput

>>> \AddFile{9}{breqn}

Breqn defines some environments, but their use ends with 
fatal errors with TeX4ht. We redefine them to use standard
LaTeX math environments instead. We will lose some functionality,
but fatal error is a worse possibility.

\<breqn environments\><<<
\renewenvironment{dmath*}[1][]{\[}{\]}
\renewenvironment{dmath}[1][]{\begin{equation}}{\end{equation}}
\renewenvironment{dsuspend}{}{\par}

% enumerate equation for \begin{dseries}
\def\@dseries[#1]{%
  \if\eq@hasNumber%
    \refstepcounter{equation}%
  \fi
  \begingroup%
   \a:equation%
   \ignorespaces%
}


% mimic the equatio environment
\def\end@dseries{%
  \b:equation 
  \if\eq@hasNumber%
  (\arabic{equation})%
  \fi%
\c:equation%
}

% this macro prints spurious equation number to the document, so we just reset it
\def\grp@finish{%
  \setbox\GRP@wholebox\vbox{%
    \let\breqn@elt\eqgrp@elt
    \the\GRP@queue
  }%
  \unvbox\GRP@wholebox
}

% the \EQ@displayinfo is used by other commands, it isn't useful in the HTML conversion
\def\eq@nulldisplay{%
  \xdef\EQ@displayinfo{%
    \relax}%
}
>>>

\<breqn commands\><<<
%% commands 
% fix wrong handling of fonts in \condition
\newcommand\:condition@a[2][\conditionpunct]{%
  \unpenalty\unskip\unpenalty\unskip % BRM Added
  \mbox{#1}%
  \hskip\conditionsep
  \ \if@tempswa\mbox{#2}\else\mbox{$\textmath@setup #2$}\fi
  \endgroup
}

\HLet\condition@a\:condition@a

>>>

%%%%%%%%%%%%%%%%%%%%%%%
\Section{nicefrac.sty}
%%%%%%%%%%%%%%%%%%%%%%%

\<nicefrac.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% nicefrac.4ht                          |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<config nicefrac|>
\Hinput{nicefrac}
\endinput
>>>        \AddFile{9}{nicefrac}

\<config nicefrac\><<<
\def\:tempc[#1]#2#3{\a:nicefrac#1{#2}\b:nicefrac#1{#3}\c:nicefrac}
\expandafter\HLet\csname\string\@UnitsNiceFrac\space\endcsname\:tempc
\expandafter\HLet\csname\string\@UnitsUglyFrac\space\endcsname\:tempc
\NewConfigure{nicefrac}{3}
\Configure{nicefrac}{}{/}{}
>>>


%%%%%%%%%%%%%%%%%%%%%%%%
\Section{stmaryrd}
%%%%%%%%%%%%%%%%%%%%%%%%

\<stmaryrd.4ht\><<< 
% stmaryrd.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|> 


\Hinput{stmaryrd} 
\endinput
>>> \AddFile{9}{stmaryrd}

\Section{fontmath.ltx}

\<config fontmath.ltx utilities\><<<
\def\relbar{\mathrel-}
>>>

\Section{multicol.sty}

\<multicol.4ht\><<<
% multicol.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>

\append:def\set@floatcmds{\let\end@dblfloat|=\end@float}   
\def\slocitlum#1{\let\endslocitlum|=\empty 
   \end{slocitlum}}
|<multicols config|>
\Hinput{multicol}
\endinput
>>>        \AddFile{9}{multicol}

\<multicols config\><<<
\def\mcolnum{1}
\def\multicols#1{%
      \bgroup \par \col@number=#1
      \def\mcolnum{#1}
      \@ifnextchar[{\mult@cols}{\mult@cols[]}%]
   }

\def\mult@@cols#1[#2]{#1\ignorespaces\mult:cols}
\def\endmulticols{\egroup\par }

\def\columnbreak{\a:columnbreak}
\NewConfigure{columnbreak}{1}
\Configure{columnbreak}{auto}

%  break-before, break-after, break-inside
%-----------------------------------------
% auto  always  avoid  left  right  page  column  avoid-page 
% avoid-column

\def\columngap{\a:columngap}
\NewConfigure{columngap}{1}
\Configure{columngap}{\the\columnsep}

% dimen  normal (1em)

\def\columnrulewidth{\a:columnrulewidth}
\NewConfigure{columnrulewidth}{1}
\Configure{columnrulewidth}{\the\columnseprule}

% thin  medium  thick  dimen

\def\columnrulecolor{\a:columnrulecolor}
\NewConfigure{columnrulecolor}{1}
\Configure{columnrulecolor}{\#555}

% legal color

\def\columnrulestyle{\a:columnrulestyle}
\NewConfigure{columnrulestyle}{1}
\Configure{columnrulestyle}{outset}

% none
%     No border. 
% *hidden
%     Same as 'none', but in the collapsing border model, also inhibits
%     any other border (see the section on border conflicts).  
% dotted
%     The border is a series of dots. 
% dashed
%     The border is a series of short line segments. 
% solid
%     The border is a single line segment. 
% double
%     The border is two solid lines. The sum of the two lines and the
%     space between them equals the value of 'border-width'.  
% groove
%     The border looks as though it were carved into the canvas. 
% ridge
%     The opposite of 'groove': the border looks as though it were
%     coming out of the canvas.  
% *inset
%     In the separated borders model, the border makes the entire box
%     look as though it were embedded in the canvas. In the collapsing
%     border model, drawn the same as 'ridge'.  
% *outset
%     In the separated borders model, the border makes the entire box
%     look as though it were coming out of the canvas. In the collapsing
%     border model, drawn the same as 'groove'.  

\def\columnspan{\a:columnspan}
\NewConfigure{columnspan}{1}
\Configure{columnspan}{none}

% none  all

\def\columnfill{\a:columnfill}
\NewConfigure{columnfill}{1}
\Configure{columnfill}{balance}

% auto  balance

\NewConfigure{multicols}{1}
\Configure{multicols}{columns}

% CSS needs to be written for every column count
\NewConfigure{multicolscss}{1}
\def\:wr:mcol:css{\a:multicolscss }

% this configuration should configure HTML code inserted for multicols environment
\NewConfigure{multicolscolumn}{2}

\def\mult:cols{\a:multicolscolumn%
        \expandafter\ifx\csname .\a:multicols-\mcolnum\endcsname\relax%
        \:wr:mcol:css
        \expandafter\gdef\csname .\a:multicols-\mcolnum\endcsname{1}%
        \fi\ShowPar\par}
\append:def\endmulticols{\b:multicolscolumn} 
>>>

\Section{lettrine.sty}

% Lettrine
\<lettrine.4ht\><<<
% lettrine.4ht (|version), generated from |jobname.tex
% Copyright 2012-2024 TeX Users Group
|<TeX4ht license text|>
|<config lettrine|>
\Hinput{lettrine}
\endinput
>>>                        \AddFile{2}{lettrine}

\<config lettrine\><<<
\NewConfigure{lettrine}{7}
\NewConfigure{lettrinechar}{2}
\define@key{L}{ante}{\def\LH:ante{#1}}%
\define@key{L}{findent}{\def\LH:findent{#1}}%
\define@key{L}{lhang}{\def\LH:lhang{#1}}%
\define@key{L}{lines}{\def\LH:lines{#1}}%
\define@key{L}{slope}{}
\define@key{L}{depth}{}
\define@key{L}{loversize}{}
\define@key{L}{lraise}{}
\define@key{L}{nindent}{}
\define@key{L}{novskip}{}
\define@key{L}{image}{}
\define@key{L}{grid}{}
\define@key{L}{realheight}{}
\define@key{L}{refstring}{}
\define@key{L}{refstring}{}
\define@key{L}{optionsfile}{}

\def\reset:LH:keys{\let\LH:ante\@empty
    \def\LH:lines{2}%
    \def\LH:lhang{0}%
    \def\LH:findent{0pt}}
\reset:LH:keys
%
\def\@lettrine[#1]#2#3{\setkeys{L}{#1}%
     \def\HlettrineChar{#2}%
     \def\HlettrineString{#3}%
     \a:lettrine
     \ifx\LH:ante\@empty\else\f:lettrine\LH:ante\g:lettrine\fi
     \c:lettrine
     \a:lettrinechar#2\b:lettrinechar
     \b:lettrine\d:lettrine#3\e:lettrine
     \reset:LH:keys}
>>>                 

\Section{osudeG.sty}

\<recall osudeGNO\><<<<
\def\:temp{\ht:everypar={\setbox0=\lastbox\ht:everypar={}}}
\ifx \NoindentAfter\:temp    
%   \def\restore:osudeG{\let\restore:osudeG|=\:UnDef}
%   \def\:temp#1{{\accent"7D #1}}\ifx \:temp\H
%   \else      \:tmp{H}\estore:osudeG \fi
\fi
>>>

DON'T remove the equal signs from the definition
of \''\:temp' below.

\<osudeG.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% osudeG.4ht                            |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<osudeG.sty|>
\Hinput{osudeG}
\endinput
>>>        \AddFile{9}{osudeG}

\<osudeG.sty\><<<
   \HRestore\H
   \def\NoindentAfter{\ht:everypar|={\HtmlPar
      \setbox0|=\lastbox\ht:everypar|={\HtmlPar}}}
   \let\SOverline|=\overline \let\Overline|=\overline
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{parallel.sty}
%%%%%%%%%%%%%%%%%%%%%%%%
\<parallel.4ht\><<<
% parallel.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
|<parallel.sty|>
\Hinput{parallel}
\endinput
>>> \AddFile{9}{parallel}


\<parallel.sty\><<<
\NewConfigure{ParallelLText}{2}
\NewConfigure{ParallelRText}{2}
\renewcommand\ParallelRText[1]{\a:ParallelRText#1\b:ParallelRText}
\renewcommand\ParallelLText[1]{\a:ParallelLText#1\b:ParallelLText}
>>>



%%%%%%%%%%%%%%%%%%%%%%%%
\Section{skak.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<skak.4ht\><<<
% skak.4ht (|version), generated from |jobname.tex
% Copyright 2017 TeX Users Group
|<TeX4ht license text|>

|<skak.sty|>
\Hinput{skak}
\endinput
>>>

\<skak.sty\><<<
\NewConfigure{SkakBoard}{2}

\pend:def\showboard{\a:SkakBoard}
\append:def\showboard{\b:SkakBoard}

>>> \AddFile{9}{skak}

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{chessboard.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<chessboard.4ht\><<<
% chessboard.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>

|<chessboard.sty|>
\Hinput{chessboard}
\endinput
>>>

\<chessboard.sty\><<<
\NewConfigure{chessboard}{2}
% this should put configurable hooks around \newchessgame
% contents printed by this command should be printed to image
\newcommand\Save:TikzPict{\let\old:a:tikzpicture\a:tikzpicture\let\old:b:tikzpicture\b:tikzpicture\let\a:tikzpicture\relax\let\b:tikzpicture\relax}
\newcommand\Restore:TikzPict{\let\a:tikzpicture\old:a:tikzpicture\let\b:tikzpicture\old:b:tikzpicture}
\newcommand\:tempaboard[1][]{\a:chessboard\o:chessboard:[#1]\b:chessboard}
% 
\HLet\chessboard\:tempaboard
\Configure{chessboard}{\Picture*{}\Save:TikzPict}{\Restore:TikzPict\EndPicture}
>>> \AddFile{9}{chessboard}


%%%%%%%%%%%%%%%%%%%%%%%%
\Section{xskak.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<xskak.4ht\><<<
% xskak.4ht (|version), generated from |jobname.tex
% Copyright 2022-2023 TeX Users Group
|<TeX4ht license text|>
|<xskak depth|>
|<xskak inline elements|>
|<xskak.sty|>
\Hinput{xskak}
\endinput
>>>\AddFile{9}{xskak}

This command calculates vertical align for Xskak commands that can be used inline,
so the image is aligned correctly to the baseline of the surrounding text.

\<xskak depth\><<<
\ExplSyntaxOn
\def\:xskakdepth{vertical-align:-\fp_eval:n{ 
  \dim_to_fp:n{\dp0}/(\dim_to_fp:n{\ht0}+\dim_to_fp:n{\dp0}) * 100
}\@percentchar;}
\ExplSyntaxOff
>>>

The following commands are used in text, so we save the result in a box, which can
be used for calculation of vertical alignment.

\<xskak inline elements\><<<
\NewConfigure{mainline}{2}
\def\:tempa#1{%
  \setbox0=\hbox{\o:mainline:{#1}}%
  \edef\:xskakalt{\detokenize{#1}}%
  %\a:mainline\Picture*[\detokenize{#1}]{ style="\:xskakdepth"}\box0\EndPicture\b:mainline%
  \a:mainline\box0\b:mainline%
}
% I've found that mainline redefinition can lead to compilation errors
% As it prints text and chess symbols are retrieved from SkakNew.htf, maybe we don't need
% to compile it to image at all, unless we get further bug reports.
% \HLet\mainline\:tempa

\NewConfigure{xskakget}{2}
\def\:tempa#1{%
  \edef\:xskakalt{\detokenize{#1}}%
  \setbox0=\hbox{\o:xskakget:{#1}}%
  \a:xskakget\box0\b:xskakget%
}
\HLet\xskakget\:tempa
>>>

The chessboard configuration is defined by chessboard.4ht too. We declare it here
because 

\<xskak.sty\><<<
\NewConfigure{chessboard}{2}
>>>

\<xskak.sty\><<<
\newcommand\:newchessgame[1][]{%
  % reset to the original version of \chessboard
  \let\:currchesboard\chessboard
  \let\chessboard\o:chessboard:%
  \o:newchessgame:[#1]%
  % set the TeX4ht version of \chessboard back
  \let\chessboard\:currchesboard
}
\HLet\newchessgame\:newchessgame
>>>


%%%%%%%%%%%%%%%%%%%%%%%%
\Section{texmate.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<texmate.4ht\><<<
% texmate.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>

|<texmate.sty|>
\Hinput{texmate}
\endinput
>>> \AddFile{9}{texmate}


\<texmate.sty\><<<
% fix incorrect handling of pictures
\NewConfigure{makediagramsfix}{2}
\renewcommand*\:tempa[1]{\a:makediagramsfix\o:@toD:{#1}\b:makediagramsfix}
\HLet\@toD\:tempa
% add some markup for diagrams
\NewConfigure{makediagrams}{2}
\renewcommand*\:tempa[1][\@diagramsbuilt]{\a:makediagrams\o:makediagrams:[#1]\b:makediagrams}
\HLet\makediagrams\:tempa
>>>

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{menukeys.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

\<menukeys.4ht\><<<
% menukeys.4ht (|version), generated from |jobname.tex
% Copyright 2021 TeX Users Group
|<TeX4ht license text|>
% use the following Configuration to patch all defined styles (not commands!)
\NewConfigure{defmenukey}[1]{%
  % define \Configure{menukey<stylename>} - it will be used to insert \Picture+ ... \EndPicture
  \NewConfigure{menukey#1}{2}
  % insert hooks into style's pre and post macros
  \expandafter\pend:def\csname tw@style@#1@pre\endcsname{\csname a:menukey#1\endcsname}%
  \expandafter\append:def\csname tw@style@#1@post\endcsname{\csname b:menukey#1\endcsname}%
  % use pictures by default for the style configuration
  \Configure{menukey#1}{\Picture*{}}{\EndPicture}
}

\Configure{defmenukey}{menus}
\Configure{defmenukey}{paths}
\Configure{defmenukey}{roundedkeys}
\Configure{defmenukey}{roundedmenus}
\Configure{defmenukey}{angularmenus}
\Configure{defmenukey}{typewriterkeys}
\Configure{defmenukey}{hyphenatepaths}
\Configure{defmenukey}{pathswithfolder}
\Configure{defmenukey}{shadowedangularkeys}
\Configure{defmenukey}{pathswithblackfolder}
\Configure{defmenukey}{hyphenatepathswithfolder}
\Configure{defmenukey}{hyphenatepathswithblackfolder}

\Hinput{menukeys}
\endinput
>>> \AddFile{9}{menukeys}

\<musicography.4ht\><<<
% musicography.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
|<musicography symbols|>
\Hinput{musicography}
\endinput
>>>\AddFile{9}{musicography}

We convert most of the musicography symbols to pictures.
It isn't optiomal, but I found that corresponding Unicode characters
are either missing, or produce weird overlapping with the following
character.

The biggest issue with pictures is that it can produce a huge number 
of images for repeated use of the each command. It could be 
better to use specific image for each symbol only once. And
also to better handle the vertical alignment to the baseline, 
similarly how the \''\PicMath' command does. But my tests
in this area failed so far, so I will leave it as it is now.

\<musicography symbols\><<<
\NewConfigure{musSymbol}{2}
\NewDocumentCommand{\:musSymbol}{ O{\musFont} m m m m }{%
  \a:musSymbol\o:musSymbol:[#1]{#2}{#3}{#4}{#5}\b:musSymbol%
}

\NewConfigure{musFlaggedNote}{2}
\NewDocumentCommand{\:musFlaggedNote}{ m m }{%
  \a:musFlaggedNote\o:musFlaggedNote:{#1}{#2}\b:musFlaggedNote
}
\HLet\musFlaggedNote\:musFlaggedNote


\NewConfigure{musStemmedNote}{2}
\NewDocumentCommand{\:musStemmedNote}{ m }{%
  \a:musStemmedNote\o:musStemmedNote:{#1}\b:musStemmedNote%
}

\HLet\musStemmedNote\:musStemmedNote


\NewConfigure{musDottedNote}{2}
\NewDocumentCommand{\:musDottedNote}{ m }{%
  \a:musDottedNote\o:musDottedNote:{#1}\b:musDottedNote%
}

\HLet\musDottedNote\:musDottedNote


\NewConfigure{musStack}{2}
\NewDocumentCommand{\:musStack}{ O{\musNumFont} m }{%
  \a:musStack\o:musStack:[#1]{#2}\b:musStack%
}

\HLet\musStack\:musStack

\NewConfigure{meterCplus}{2}
\NewDocumentCommand{\:meterCplus}{ m }{\a:meterCplus\o:meterCplus:{#1}\b:meterCplus}
\HLet\meterCplus\:meterCplus


\Configure{musStack}{\Picture+{}}{\EndPicture}
\Css{.mustack{display:block-inline}}
\Configure{musDottedNote}{\Picture+{}}{\EndPicture}
\Configure{musStemmedNote}{\Picture+{}}{\EndPicture}
\Configure{musFlaggedNote}{\Picture+{}}{\EndPicture}
\Configure{musSymbol}{\Picture+{}}{\EndPicture}
\Configure{meterCplus}{\Picture+{}}{\EndPicture}


% \def\:tempa#1#2{%
% \def\:tempb{\x:unicode{#2}}%
% \HLet#1\:tempb%
% }
% these characters are strange, they seems to overlap with the following character, and they are too small
% it is probably better to use images
% \:tempa\musEighth{1D160}
% \:tempa\musSixteenth{1D161}
% \:tempa\musThirtySecond{1D162}
% \:tempa\musSixtyFourth{1D163}

>>> 

%%%%%%%%%%%%%%%%%%%%%%%%
\Section{vanilla.sty}
%%%%%%%%%%%%%%%%%%%%%%%%

Old amstex.sty: 1985, 1986 BY MICHAEL SPIVAK

\<vanilla.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% vanilla.4ht                           |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>

|<vanilla.sty|>
|<config amsppt + vanilla shared|>
|<config vanilla.sty utilities|>
|<config vanilla.sty shared|>
\Hinput{vanilla}
\endinput
>>>        \AddFile{7}{vanilla}

\<vanilla.sty\><<<
\expandafter\def\csname title\endcsname{\title@true
    \bgroup  \let\halign|=\TeXhalign \HRestore\noalign  \let\\|=\cr\a:title 
    \halign\bgroup\tenbf\hfill\ignorespaces##\unskip\hfill\cr}
\def\endtitle{\cr\egroup\b:title\egroup}
\expandafter\def\csname author\endcsname{\bgroup
     \let\halign|=\TeXhalign \HRestore\noalign  \let\\|=\cr\a:author
   \halign to \hsize\bgroup\smc\hfill\ignorespaces##\unskip\hfill\cr}
\def\endauthor{\cr\egroup\b:author\egroup}

\expandafter\let\csname heading\endcsname|=\empty
\expandafter\let\csname endheading\endcsname|=\empty
\NewSection\heading{}
\let\x:heading=\heading
\def\heading#1\endheading{{\let\cr|=\space \let\\|=\space
   \x:heading{#1}}}

\expandafter\let\csname subheading\endcsname|=\empty
\NewSection\subheading{}

\expandafter\def\csname proclaim\endcsname#1{\medbreak\a:proclaim
    \noindent\smc\ignorespaces  #1\unskip.\b:proclaim
    \enspace\sl\ignorespaces}
\expandafter\def\csname endproclaim\endcsname{\c:proclaim\medskip\rm}

\expandafter\def\csname demo\endcsname#1{\par \a:demo
    \noindent{\smc\ignorespaces#1\unskip\enspace}\b:demo
    \rm  \ignorespaces}
\expandafter\def\csname enddemo\endcsname{\c:demo\par}
\NewConfigure{demo}{3}

\def\footnote{\let\@sf=\empty\ifhmode\edef\@sf{\spacefactor
    =\the\spacefactor}\/\fi \futurelet\next\footnote@}
\def\footnote@{\ifx"\next\let\next\footnote@@\else
     \let\next\footnote@@@\fi\next}
\def\footnote@@"#1"#2{%
   \gHAdvance\FNnum  1 \def\:temp{#1}\ifx \:temp\empty
      \def\:temp##1[##2]##3{##1[##2]{*}}\expandafter\:temp \fi
   \HPageButton[fn\FNnum]{#1}\BeginHPage[fn\FNnum]{ }{#2}\EndHPage{}}
\HAssign\FNnum |=  0
\def\footnote@@@#1{%
    \HPageButton[nf\the\footmarkcount@]{$^{\number\footmarkcount@}$}%
    \BeginHPage[nf\the\footmarkcount@]{ }
    {{\HCode{<sup>}{\number\footmarkcount@}\HCode{</sup>}}{#1}\global
     \advance\footmarkcount@ by 1}\EndHPage{}}
>>>

\<vanilla.sty\><<<
\def\brute:halign{\let\:HAlign|=\halign   \let\:NOalign|=\noalign
  \let\halign|=\TeXhalign \HRestore\noalign     
  \let\sv:Row=\HRow  \let\sv:Col=\HCol  \def\HRow{0}}
\def\endbrute:halign#1{%
     \csname d:#1\endcsname\csname b:#1\endcsname
     \global\let\HRow|=\sv:Row  \global\let\HCol|=\sv:Col}
\def\abt:hlgn#1{\csname\ifnum \HRow=0  a\else d\fi :#1\endcsname
     \g:Advance\HRow by 1 \gdef\HCol{1}%
     \csname c:#1\endcsname\csname e:#1\endcsname\let\halign|=\:HAlign 
     \let\noalign|=\:NOalign}
\def\bbt:hlgn#1{\g:Advance \HCol by 1 \csname 
     e:#1\endcsname\let\halign|=\:HAlign
     \let\noalign|=\:NOalign}

\def\:temp{\vcenter\bgroup \brute:halign
  \vspace@\Let@\openup\jot\m@th\ialign
  \bgroup \strut\hfil\abt:hlgn{aligned}%
     $\displaystyle{##}$\f:aligned
     &\bbt:hlgn{aligned}$\displaystyle{{}##}$\f:aligned\hfil\crcr}
\HLet\aligned|=\:temp
\def\:temp{\crcr\egroup
   \endbrute:halign{aligned}\egroup}
\HLet\endaligned|=\:temp
\NewConfigure{aligned}{6}
>>>

\<vanilla.sty\><<<
\def\:temp{\vcenter\bgroup\Let@\vspace@ \brute:halign
    \normalbaselines
  \m@th\ialign\bgroup\hfil\abt:hlgn{matrix}$##$\f:matrix\hfil&&\quad\hfil
     \bbt:hlgn{matrix}$##$\f:matrix\crcr
    \mathstrut\crcr\noalign{\kern-\baselineskip}}
\HLet\matrix|=\:temp
\def\:temp{\crcr\mathstrut\crcr\egroup
    \endbrute:halign{matrix}\egroup}
\HLet\endmatrix|=\:temp
\NewConfigure{matrix}{6}
>>>

\<vanilla.sty\><<<
\def\:temp{\left\{\,\vcenter\bgroup\vspace@   \brute:halign
     \normalbaselines\openup\jot\m@th
       \Let@\ialign\bgroup\abt:hlgn{cases}$##$\f:cases
            \hfil&\quad\bbt:hlgn{cases}$##$\f:cases\hfil\crcr}
\HLet\cases|=\:temp
\def\:temp{\crcr\mathstrut\crcr\egroup
    \endbrute:halign{cases}\egroup\right.}
\HLet\endcases|=\:temp
>>>

\<vanilla.sty\><<<
\def\ralign@#1\endalign{\displ@y\Let@\tabskip\centering
    \append:def\f:align{\ifx \dn:hlgn\:UnDef \else
        \global\let\dn:hlgn=\:UnDef \endbrute:halign{align}\fi}%
    \brute:halign \halign{\abt:hlgn{align}$\displaystyle
       {##}$\f:align&\bbt:hlgn{align}$\displaystyle{{}##}$\f:align
       &\bbt:hlgn{align}\hbox{(\rm##\unskip)}\f:align\crcr
             #1\global\let\dn:hlgn|=\empty\crcr}}
\def\lalign@
 #1\endalign{\displ@y\Let@\tabskip\centering
    \append:def\f:align{\ifx \dn:hlgn\:UnDef \else
        \global\let\dn:hlgn=\:UnDef \endbrute:halign{align}\fi}%
   \brute:halign \halign{\abt:hlgn{align}$\displaystyle
       {##}$\f:align&\bbt:hlgn{align}$\displaystyle{{}##}$\f:align
   &\bbt:hlgn{align}\hbox{(\rm##\unskip)}\f:align\crcr 
   #1\global\let\dn:hlgn=|\empty\crcr}}
\NewConfigure{align}{6}
>>>

%%%%%%%%%%%%%%%%%
\Chapter{ProTex}
%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%
\Section{ProTex}
%%%%%%%%%%%%%%%%%%

\<ProTex.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ProTex.4ht                            |version %
% Copyright (C) |CopyYear.2003.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<load protex|>
|<config protex|>
\if:latex |<latex protex|>\fi
|<program ref protex|>
\Hinput{ProTex}
\endinput
>>>        \AddFile{9}{ProTex}

\<program ref protex\><<<
\:CheckOption{prog-ref}\if:Option
   \let\oc:frag:href\frag:href 
   \def\frag:href#1#2{% 
       \expandafter \ifx \csname cw:ofile-#1\endcsname \relax 
          \oc:frag:href{#1}{#2}% 
       \else 
          \HCode {<\tag:A \:newlnch \HREF:  
             "\csname cw:ofile-#1\endcsname "#2>}% 
       \fi } 
   \let\oc:OutputCodE=\OutputCodE 
   \def\OutputCodE\<#1\>{{% 
      \Tag{ofile-)0Z:#1}{#1}% 
      \let\OutputCode=\oc:OutputCode
      \oc:OutputCodE\<#1\>}} 
   \let\oc:OutputCode=\OutputCode 
   \def\OutputCode#1\<#2\>{% 
      \def\foo##1[##2]##3//{##1.##2}% 
      \Tag{ofile-)0Z:#2}{\foo#2#1[java]//}% 
      \oc:OutputCode#1\<#2\>} 
\else
   \Log:Note{for pointers to code files from root fragments
       use the command line option 'prog-ref'}
\fi
>>>

\<load protex\><<<
\let\c:ProTex:=\:UnDef
\let\protex:sv\:RestoreCatcodes
\let\protex:sav\:CheckOption
\catcode`\:=12
   \input ProTex.sty
   \expandafter\expandafter\expandafter\AlProTex
   \expandafter\expandafter\expandafter{\csname a:ProTex\endcsname}
\catcode`\:=11
\let\:RestoreCatcodes\protex:sv
\let\:CheckOption\protex:sav
\def\:CheckProtexOption#1{
  \let\protex:sv=\Preamble
  \let\Preamble=\a:ProTex
  \:CheckOption{#1}
  \let\Preamble=\protex:sv
}
>>>   

\<config protex\><<<
\:CheckProtexOption{[[]]}\if:Option
    \NewConfigure{FrameCode}[2]{%
       \def\a:FrameCode{#1}\def\b:FrameCode{#2}%
       \def\:FrameCode##1{\ifvmode\vfill\break\fi 
          \vtop{\a:FrameCode ##1\b:FrameCode}}}
\fi
>>>

\<config protex\><<<
\let\tivt:ModifyAppendCode=\ModifyAppendCode
\def\ModifyAppendCode#1{%
   \tivt:ModifyAppendCode{#1}\a:ModifyAppendCode}
\NewConfigure{ModifyAppendCode}[1]{%
   \concat:config\a:ModifyAppendCode{#1}}
\Configure{ModifyAppendCode}{}
>>>

\<config protex\><<<
\let\tivt:ModifyOutputCode=\ModifyOutputCode
\def\ModifyOutputCode#1{\tivt:ModifyOutputCode{#1}%
   \pend:def\ProTexMssg{\Configure{Needs}{File: \:FileName}\Needs{}}%
   \a:ModifyOutputCode
}
\NewConfigure{ModifyOutputCode}[1]{%
   \concat:config\a:ModifyOutputCode{#1}}
\Configure{ModifyOutputCode}{}
>>>

\<config protex\><<<
\let\tivt:ModifyShowCode=\ModifyShowCode
\def\ModifyShowCode#1{\tivt:ModifyShowCode{#1}\a:ModifyShowCode}
\NewConfigure{ModifyShowCode}[1]{%
   \concat:config\a:ModifyShowCode{#1}}
\Configure{ModifyShowCode}{}
>>>

\<latex protex\><<<
\AtBeginDocument{\let\la:ref=\ref}
\Configure{ModifyAppendCode}
     {\let\ref\relax}
\Configure{ModifyShowCode}
     {\let\ref\prtx:ref}
\catcode`\(=1
\catcode`\)=2
\catcode`\{=12
\catcode`\}=12
\def\prtx:ref#1{#2}(\la:ref(#2))
\catcode`\(=12
\catcode`\)=12
\catcode`\{=1
\catcode`\}=2
>>>

\<config protex\><<<
\def\frnt:ttl#1{{\parindent=0pt \htmlprotex:par
      {\expandafter\ifx \csname ListCounter\endcsname\relax
         \else  \:removeindentfalse \fi   \leavevmode}%
      \PortTitle{#1}\:AppendSign}\a:protex
    }
>>>

%%%%%%%%%%%%%%%%%
\Chapter{HT4 STY}
%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%
\Section{Outline}
%%%%%%%%%%%%%%%%%

\<th4.4ht\><<<
% th4.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>

\ifHtml
   \:CheckOption{javascript}
      \if:Option  \else\:CheckOption{th4}\fi
   \if:Option 
      |<javascript|>
   \else
      \Log:Note{for javascript support, 
          use the command line option `javascript'}
   \fi
   \:CheckOption{java}
       \if:Option  \else\:CheckOption{th4}\fi
   \if:Option 
      |<java|>
   \else
      \Log:Note{for java support, 
          use the command line option `java'}
   \fi
   \:CheckOption{image-maps}
      \if:Option  \else\:CheckOption{th4}\fi
   \if:Option 
      |<image maps|>
   \else
      \Log:Note{for image maps support, 
          use the command line option `image-maps'}
   \fi
   \:CheckOption{frames-}
      \if:Option  \else\:CheckOption{frames}\fi
      \if:Option  \else\:CheckOption{th4}\fi
   \if:Option 
      |<frames|>
      \Log:Note{for frames support, 
          use the command line option `frames-' or `frames'}
   \fi
   \:CheckOption{ShowFont}
      \if:Option  \else\:CheckOption{th4}\fi
   \if:Option 
      |<show font|>
   \fi
\fi
\:CheckOption{th4}\if:Option 
   \edef\:temp{\meaning\everypar}
   \edef\:tempa{\string\everypar}
   \ifx \:temp\:tempa
      \let\ht:everypar|=\everypar
   \fi
   |<inline verbatim|>
   |<general tex-sty configure utilities|>
   |<TeX4ht divs|>
   |<TeX4ht lists|>
   \def\Verbatim{\par\V:rbatim}
   \def\c:Verbatim:{\Configure{HVerbatim}}
   \expandafter\def\csname c:Verbatim+:\endcsname
      {\Configure{HVerbatim+}}
   \if:latex \else
      |<TeX4ht tocs|>
      \ifHtml |<html TeX4ht tocs|>
   \fi\fi
   \ifHtml
      |<tex-sty configure utilities|>
      |<tex-sty shared Configure|>
      |<html TeX4ht divs|>
      |<html TeX4ht lists|>
      |<html sty of TeX4ht|>
      |<HTable|> 
      |<postscript draw|>
      |<draw sty|>
      |<th4 indexes|>
%      \expand:after{\Hinput{th4}}
   \else
      |<non-html TeX4ht lists|>
      |<non-html sty of TeX4ht|>
      |<elements for lists|>
      |<non-html lists|>  
      |<non-html sty Verbatim|>  
      |<non-html blocks for divs|> 
      |<non-html tex divs|>    
      |<non-html tex settabs|>
      |<non-html tex env|>
      |<non-html tex-only env|>
      |<non-html inline verbatim|>
   \fi
\fi
\ifHtml        \expand:after{\Hinput{th4}}\fi
\endinput
>>>        \AddFile{9}{th4}

%           \AddFile{9}{th4-frames}

%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{ShowFont}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<show font\><<<
\:CheckOption{ShowFont}     \if:Option 
   |<HObey for ShowFont|>
   \def\ShowFont#1{{\ifx \sevenrm\Undef \let\sevenrm|=\rm\fi
      \Picture*{ \a:@Picture{ShowFont}}\begingroup   \HObey
         % Variants of Knuth's macros
         \postdisplaypenalty=-10000 \global\tmp:cnt=0 #1
         \tabskip0.06\hsize  |<definitions for ShowFont|>%
         \halign to\hsize\bgroup  |<halign for ShowFont|>%
         \egroup
      \EndHObey  \endgroup  \EndPicture}}
   |<showfont + unicode|>
\fi
>>>

\<showfont + unicode\><<<
\csname newread\endcsname\in:strm
\def\Uii:{\expandafter\Uii:o\in:buf xxxxxxxxx;}
\def\Uii:o#1x#2#3#4xxxx;{#2#3}
\catcode`\@=6
\catcode`\#=12
\def\Uiv:{\expandafter\Uiv:o\in:buf '&#xxxxxxxxx;}
\def\Uiv:o@1'&#x@2@3@4@5@6xxxx;{@2@3@4@5}
\catcode`\@=11
\catcode`\#=6

\def\:gobbleM#1->{}
\def\Uni:symbols{\ifnum \char:n<256
  \HCode{\Hnewline<tr><td>}\char:n{}\HCode{</td>}
  \bgroup \catcode`\#=12 \catcode`\\=12 
      \catcode`\%=12 \catcode`\{=12 \catcode`\}=12
      \catcode`\_=12 \catcode`\^=12 \catcode`\~=12
%     \ifeof\in:strm \else
        \read\in:strm to\in:buf
        \ifeof\in:strm  \gHAssign\char:n=256 \else
           \def\:temp{\par}
           \ifx\in:buf\:temp\else
              \edef\:tempa{\Uiv:}\def\:temp{xxxx}
              \ifx \:temp\:tempa \let\:tempa=\:gobble
              \else              \let\:tempa=\empty\fi
             \HCode{<td>}
              \:tempa{\Picture{http://charts.unicode.org/Unicode.charts%
                                    /Small.Glyphs/\Uii:/U\Uiv:.gif}}           
                    \HCode{</td><td>}
              \:tempa{\Picture{http://www.w3.org/TR/PR-math/chap6/glyphs/%
                                    \Uii:/U\Uiv:.gif}}           
              \HCode{</td><td>}{\font:nm\char\char:n}
              \HCode{</td><td>}{\font:nm \Picture+{}\char
                                 \char:n\EndPicture}
              \HCode{</td><td class="htf">}\:tempa\Uiv:
                 \:tempa\:gobble{\tt\expandafter\:gobbleM\meaning\in:buf}
              \HCode{</td>}
     \fi\fi%\fi
   \egroup
   \HCode{</tr>}
   \HAdvance\char:n by 1 \expandafter\Uni:symbols\fi} 
\def\ShowFontU#1#2{%
   \font\font:nm=#2
   \openin\in:strm=#1\relax 
   \ifeof\in:strm  \writesixteen{.........can't  open #1}\else
     \read\in:strm to\in:buf\relax
     \HAssign\char:n=0 \HCode{<table class="unicodes" border="1"><tr>
        <td>char<br\xml:empty>number</td>
        <td>unicode<br\xml:empty>org</td>
        <td>ams<br\xml:empty>org</td>
        <td>htf +<br\xml:empty>browser</td>
        <td>actual<br\xml:empty>(la)tex<br\xml:empty>symbol</td>
        <td>htf<br\xml:empty>entry</td>
        </tr>}
        \Uni:symbols
     \HCode{</table>}
     \Css{.unicodes{border:solid 1px;}}
     \Css{.unicodes td{text-align:center;}}
     \Css{.unicodes td.htf{text-align:left;}}
   \fi
   \closein\in:strm}      
>>>

\<definitions for ShowFont\><<<
\def\:{\setbox0=\hbox{\char\tmp:cnt}%
  \ifdim\ht0>7.5pt\reposition
  \else\ifdim\dp0>2.5pt\reposition\fi\fi
  \box0\global\advance\tmp:cnt by1 }%
>>>

\<definitions for ShowFont\><<<
\def\cr:line{\cr  \noalign{\nointerlineskip}
  \multispan{17}\hrulefill&
  \cr \noalign{\nointerlineskip}}%
\def\reposition{\setbox0=\hbox{$\vcenter{\kern2pt\box0\kern2pt}$}}%
\def\chartLine##1{\hbox to 13.8pt{\hfil\sevenrm ##1 }}%
>>>

\<definitions for ShowFont\><<<
\HAssign\:tempc|=0
\def\:tempd{\chartLine\:tempc
   \vrule   &\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\cr:line
   \noalign{\nointerlineskip}%
   \gHAdvance\:tempc by 8 \ifnum \:tempc<256  \expandafter\:tempd \fi}%
>>>

\<halign for ShowFont\><<<
|<chartstrut|>##\tabskip\z@ plus10pt& &\hfil##\hfil&\vrule##\cr
\lower6.5pt\null
\chartLine{}\vrule   &\sevenrm 0&&\sevenrm 1&&\sevenrm
   2&&\sevenrm 3&&\sevenrm 4&&\sevenrm 5&&\sevenrm 6&&\sevenrm 7&\cr:line
\:tempd \cr
>>>

\<chartstrut\><<<
\lower4.5pt\vbox to14pt{}%
>>>

\<HObey for ShowFont\><<<
\def\HObey{\SaveEverypar \par \ht:everypar{}%
   {\parindent|=\z@ \leftskip|=\z@ \leavevmode   
    \HCode{ <table \Hnewline \:zbsp{HObey}
          width="100\%"><tr class="HObey"><td\Hnewline 
      class="HObey"><pre class="HObey">}\par}}
\def\EndHObey{\HCode{</pre>}\IgnoreIndent 
    \end:TTT \RecallEverypar}
>>>

%%%%%%%%%%%%%%%%%%%%
\SubSection{showfonts}
%%%%%%%%%%%%%%%%%%%%

\<showfonts.4ht\><<<
% showfonts.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2003. Eitan M. Gurari
|<TeX4ht copywrite|>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% Compile this style file and check the log file for
% instructions on how to use it.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
   \newcount\i
   \def\cont{\ifnum \i<256 \expandafter\next \fi }
   \def\showfonts{\vfill\break
      \def\row{\tt \the\i}\let\ttl=\empty \i=0
      \addcol}
   \def\addcol#1{\if !#1!%
        \def\next{\row \cr \global\advance\i by 1 \cont }
       \i=0  \ifx \HCode\UnDef \expandafter\halign
             \else \expandafter\TeXhalign \fi 
             {&##\quad\cr\ttl\cr\cont  \cr}
       \par \hrule\par
     \else
       \edef\ttl{\ttl&#1}%
       \expandafter\font \csname x\the\i\endcsname=#1
       \expandafter\let\csname row\the\i\endcsname=\row
       \edef\row{%
         \expandafter\noexpand\csname row\the\i\endcsname
         &   \csname x\the\i\endcsname \char\i}
       \advance\i by 1 \expandafter\addcol
     \fi
   }
\ifx \section\undefined
   \writesixteen{-----------------------------------------------}
   \writesixteen{|| This style file provides the command}
   \writesixteen{||      \noexpand\showfonts {font1} ... {fontN} {}}
   \writesixteen{|| for exhibiting fonts.}
   \writesixteen{|| }
   \writesixteen{|| Example:}
   \writesixteen{|| \noexpand\documentclass{article}}
   \writesixteen{||    \noexpand\input showfonts.4ht}
   \writesixteen{|| \noexpand\begin{document}}
   \writesixteen{||    \noexpand\showfonts {cmr10}{cmtt10} {}}
   \writesixteen{|| \noexpand\end{document}}
   \writesixteen{-----------------------------------------------}
   \def\next{%
     \csname bye\endcsname
     \documentclass {article}
     \begin {document}
     \end {document}
   }
   \expandafter\next
\fi   
>>>

%%%%%%%%%%%%%%%%%%
\Section{Frames}
%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%
\SubSection{Frames}
%%%%%%%%%%%%%%%%%%%%

\<frames\><<<
\def\HorFrames{\def\:tempa{cols}\:Frames}
\def\VerFrames{\def\:tempa{rows}\:Frames}
\Odef\:Frames[#1]#2{%
   \PushStack\Frm:Stc{</frameset>}%
   \HCode{<frameset\Hnewline \:tempa="#2" #1>}}
\def\NoFrames{%
   \PopStack\Frm:Stc\:temp
   \PushStack\Frm:Stc{</body></noframes></frameset>}
   \HCode{<noframes><body>}}
\def\EndFrames{\PopStack\Frm:Stc\:tempc \HCode{\:tempc}}
\Odef\Frame[#1]#2{{\def\HREF:{ src=}\def\tag:A{frame}%
                   \def\empty:lnk{ /}\Link[#1]{#2}{}}}
>>>

Frames may be external or embedded. The embeded don't need alternative
for browsers that don't recognize them.

\<framesNO\><<<
\def\p:Frames{\csname |<live|>\file:id\endcsname 
   \xdef:cs{|<live|>\file:id}{|<noframes noexpand|>|</HCode NOFRAMES|>}%
   \let\:Frames|=\sb:Frames  \sb:Frames  }
\let\:Frames|=\p:Frames
\Odef\sb:Frames[#1]#2{\HCode{<frameset\Hnewline \:tempa="#2" #1>}}
>>>

FrameSet can get the onLoad attribute.

\<initiate frames\><<<
\let\:Frames|=\p:Frames
>>>

The \''\noexpand' below is for getting the same definition
as \`'\def\:temp{|</HCode NOFRAMES|>}' above.

\<noframes noexpand\><<<
\noexpand >>>

\</HCode NOFRAMES\><<<
\HCode{<noframes>}%
>>>

\<framesNO\><<<
\def\end:frames{\b:BODY\noexpand\HCode{\expandafter
   \ifx \csname |<live|>\file:id\endcsname\:temp
         </noframes></frameset>
   \fi}\b:HTML}
>>>

\SubSection{Image Maps}

A broweser that recognizes image maps ignores \`'<A>' tags on images
that point to maps.

\SubSection{In General}

\<image maps\><<<
\Odef\Ar:a[#1]#2{{\def\tag:A{area}\Link[#1 ]{#2}{}\EndLink}}
>>>>

\<NewHaddr fix\><<<
\def\:temp##1-{##1-imap}%
\edef\:tempA{\expandafter\:temp\:tempA}%
>>>

\<image maps\><<<
\Odef\Map[#1]#2#3{%
   \def\:tempd{\Map:[#1]{#2}{#3}}%
   \rm:attr{#1}\ifx \:tempB\empty  |<IMG from /Map|>\fi  \:tempd}

\def\in:mp#1=#2=#3==#4|<par del|>#5{\IMG:LINK{#1}{#4#5}{#2}{#3}}
\def\rm:attr#1{\edef\:tempB{\noexpand\rm:atr#1 |<par del|>}\:tempB}
\def\rm:atr#1 #2|<par del|>{\def\:tempB{#1}}

\Odef\Map:[#1]#2#3{%
   \NewHaddr\:tempA    |<NewHaddr fix|>%
   \NewHaddr\alt:map  
   |<IMG from /Map.../EndMap|>%
   \HCode{<map\Hnewline name="\GetHname\:tempA" id="imap-\:tempA">}%
   \def\EndMap{%
      \HPage[\alt:map]{}{\let\set:mp|=\st:mp \:Map}\EndHPage{}%
      \HCode{</map>}%
      \let\u:map|=\empty}}

\let\set:mp|=\relax
\def\st:mp#1#2#3{\def\:temp{#1#2}\ifx \:temp\empty  \else
      [\Link[#1]{#2}{}#3\EndLink]
   \fi }
>>>

\<IMG from /Map.../EndMap\><<<
\def\:temp{#3}\ifx \:temp\:empty\else 
   \rm:attr{#1}%
   \Tag{|<auto tag|>|<map tag|>#3}{\alt:map=\:tempA=#2==\:tempB}\fi
\edef\:tempB{\noexpand\IMG:LINK{\noexpand\alt:map}{#1}}\:tempB
   \:tempA{#2}\let\:Map|=\empty
>>>

\<IMG from /Map\><<<
\expand:after{\let\:tempc|=}\csname
                   cw:|<auto tag|>|<map tag|>#2\endcsname
\ifx\:tempc\relax\else
   \edef\:tempd{\noexpand\in:mp\:tempc|<par del|>{#1}}%
   \def\:temp{#3}\ifx \:temp\empty\else 
      \Tag{|<auto tag|>|<map tag|>#3}{\:tempc}%
\fi \fi 
>>>

\<image maps\><<<
\def\IMG:LINK#1#2#3#4{\Link[\RefFile{#1}]{}{}%
   {\def\tag:A{img}\def\HREF:{src=}\def\empty:lnk{/}%
    \Link[#2 alt="textual map"  usemap="\GetHref#3"]{#4}{}}\EndLink}
>>>

\<auto tag\><<<
)>>>

%\SubSection{Shapes}

\<image maps\><<<
\def\RectArea(#1){\bgroup\def\:tempa{\M:nMx#1,}\def\:tempb{rect}\Are:}
\def\CircleArea(#1){\bgroup\def\:tempa{#1}\def\:tempb{circle}\Are:}
\def\PolyArea(#1){\bgroup\def\:tempa{#1}\def\:tempb{poly}\Are:}
\def\M:nMx#1,#2,#3,#4,{\M:n{#1}{#3},%
                       \M:n{#2}{#4},\M:x{#1}{#3},\M:x{#2}{#4}}
>>>

\<image maps\><<<
\Odef\Are:[#1]#2#3{%
   \xdef\:Map{\:Map\set:mp{#1}{#2}{#3}}%
   \Ar:a[#1\Hnewline shape="\:tempb"\Hnewline
         coords="\:tempa"\Hnewline alt="#3"]{#2}\egroup}
>>>

\SubSection{For /Draw}

%\SubSection{Making the request}

\<image maps\><<<
\def\M:n#1#2{\ifnum #1<#2 #1\else #2\fi}
\def\M:x#1#2{\ifnum #1<#2 #2\else #1\fi}
>>>

\SubSection{JavaScript}

The following provide for
\`'\javascript{...}' and \`'\JavaScript ...\EndJavascript'
Commands.

\<javascript\><<<
\ScriptCommand{\JavaScript}{\vbox\bgroup \linepenalty|=1000 \NoFonts
  \Configure{HVerbatim+}{\z@}{\nobreak\space}%
  \A:JavaScript }{\B:JavaScript \EndNoFonts
  \ht:special{t4ht@(}\egroup  \ht:special{t4ht@)}}
\NewConfigure{JavaScript}[2]{\def\A:JavaScript{\ht:everypar{}#1}%
   \def\B:JavaScript{#2}}
>>>

\<javascript\><<<
\def\javascript#1{\b:jv#1\e:jv}
\def\b:jv{\begingroup \vrb:tt   
   \leftskip|=\z@  \parindent|=\z@
   \Configure{HVerbatim}{}{}{}{}\Configure{HVerbatim+}{\z@}{ }%
   \NoFonts \A:JavaScript \ht:special{t4ht@@}}
\def\e:jv{\ht:special{t4ht@@}%
   \B:JavaScript\EndNoFonts\endgroup}
>>>

The typewriter font is needed to prevent \TeX{} from performing ?gator (e.g., fi into one character).

\<java\><<<
\Odef\Applet[#1]#2{\Appl:[#1]#2,,,|<par del|>}
\def\Appl:[#1]#2,#3,#4,#5|<par del|>{%
  \def\:temp{#3}\def\LastApplet{#4}%
  \HCode{<applet code="#2.class" 
    \ifx \:temp\empty \else width="#3" \fi
    \ifx \LastApplet\empty \else HEIGHT="#4" \fi #1\Hnewline >}%
  \xdef\LastApplet{#2}\Applet:Needs{#2}}
\def\EndApplet{\HCode{</applet>}}

\def\AppletInfo{\def\Applet:Needs##1}
\AppletInfo{\Needs-{needs #1.class}}
>>>

\SubSection{?}

\<non-html sty Verbatim\><<<
\def\Verb:sp{\phantom{x}}
\let\Verb:boln|=\empty
\let\Verb:eoln|=\empty
\Configure{VerbatimEnv}
   {\medskip \parskip|=0pt}
   {\smallskip }
\let\vrb:tt|=\tt
>>>

%\SubSection{In Line Verbatim}

\<inline verbatim\><<<
|<common inline verbatim|>
\ifHtml  |<html inline verbatim|>
\fi
>>>

\<common inline verbatim\><<<
\def\Verb{\bgroup  \no:catcodes0{255}{12}\catcode`\ = 10
   \catcode`\^^M = 10 \catcode`\^^I = 10  \leavevmode \:ctgs}
>>>

\<html inline verbatim\><<<
\def\:ctgs#1{\def\:eat##1#1{{\vrb:tt 
   ##1}\egroup}\:eat }
>>>

\Section{Indexes}

\<th4 indexes\><<<
\:CheckOption{index} \if:Option
   |<indexes|>                                             
\fi
>>>

An entry takes the form \`'\--#1/#2/#3/'.  The first parameter \`'#1'
is the major entry, the second parameter \`'#2' is the secodary entry,
and the third parameter \`'#3' is a range entry (empty, the character
\`'<', or the character \`'>').

The current approach is a variant of the definition in section 17.8 of
Writing with TeX. It uses a direct approach in which the full entries
and subentries are recorded at each location, and so eliminating the
need for the \''<tag>'. It also eliminates the format entry, but one
can  always merge this entry into the range entry by employing an
appropriate encoding scheme.

\<indexes\><<<
\let\mi:nus=\-
\def\-{\futurelet\:temp\:idxentry}
\def\:idxentry{\ifx \:temp- \expandafter\:addidx
   \else\expandafter\mi:nus\fi}
\def\:addidx-#1/#2/#3/{{\def\:ii{#2}%
   |<html index target|>%
   \ifx\:ii\empty 
      \edef\:temp{\write\:idx{\string\--{#1}{ }{#3}%
        {|<html index source|>}\relax}}%
   \else 
      \edef\:temp{\write\:idx{\string\--{#1}{#2}{#3}%
        {|<html index source|>}\relax}}%
   \fi  \:temp}}
>>>

The relax at the end of each line is a `comment' for eliminating the
spaces at the end of the lines.

\<indexes\><<<
\csname newwrite\endcsname\:idx
\openout\:idx=\jobname.idx
>>>

\SubSection{Listing}

Entries are collected into \`'\jobname.idx', processed externally, and
loaded from \`'\jobnmae.xdi'.  We load an index with a command of the
form \`'\Index'

\<indexes\><<<
\def\Index{%
  \def\--{\IndexEntry}%
  \openin15=\jobname.xdi
  \ifeof15      \write\:idx{ \pageno=\the\pageno}
  \else 
     {\a:index \input \jobname.xdi \b:index }
  \fi}
>>>

\<indexes\><<<
\def\IndexEntry#1#2#3#4{%
   \gdef\:temp{#1}\let\:tempa|=\empty
   \ifx \:temp\prev:A  \gdef\:temp{#2}\ifx \:temp\prev:B
      \let\:tempa|=\relax
   \fi\fi
   \ifx \:tempa\relax ,\else
      \gdef\:temp{#1}\ifx \:temp\prev:A \else  \c:index #1\d:index\fi
      \def\:temp{#2}\ifx \:temp\space 
      \else   \hfill\break    \e:index#2\f:index\fi
   \fi
   \g:index #4\h:index
   \gdef\prev:A{#1}\gdef\prev:B{#2}%
}
\NewConfigure{index}{8}
>>>

\SubSection{Fonts}

 The fonts \`'\indextt', \`'\indexrm' are used in indexes, and they
are introduced with the command \''\IndexFonts'.

\<indexes\><<<
\ifx  \IndexFonts\:UnDef
   \def\IndexFonts{%
     \setbox\strutbox=\hbox{\vrule height8.0pt depth3.0pt width0pt}
     \font\ninerm=cmr9  \font\ninebf=cmbx9   \font\ninesl=cmsl9
     \font\nineit=cmti9 \font\ninett=cmtt9   \font\ninei =cmmi9
     \font\ninesy=cmsy9 \font\nineex=cmex10
     \textfont0=\ninerm \textfont1=\ninei    \textfont2=\ninesy
     \textfont3=\nineex \scriptfont3=\nineex \scriptscriptfont3=\nineex
     \textfont\bffam=\ninebf  \textfont\slfam=\ninesl
     \textfont\itfam=\ninei   \textfont\ttfam=\ninett
     \def\rm{\fam=0     \ninerm}%
     \def\bf{\fam=\bffam\ninebf}%
     \def\sl{\fam=\slfam\ninesl}%
     \def\it{\fam=\itfam\nineit}%
     \def\tt{\fam=\ttfam\ninett}%         
     \def\cal{\fam=2}%
     \def\mit{\fam=1}%
     \skewchar\ninei   =127    \skewchar\ninesy   =46    \rm
     \baselineskip=11pt       }
\fi
>>>

\SubSection{Hypertext Tags}

\<html index target\><<<
\csname a:--\endcsname
>>>

\<html index source\><<<
\csname b:--\endcsname
>>>

\<indexes\><<<
\NewConfigure{--}{2}
\Configure{--}
  {\html:addr \Link-{}{|<idx htag|>\last:haddr}\EndLink}
  {\string\csname\space :gobble\string\endcsname{\html:lbl}%
    \string\Link[\FileName]{|<idx htag|>\last:haddr}{}\folio
    \string\EndLink 
  }
>>>

The \`'\string\csname :gobble\string\endcsname{\html:lbl}%' is for 
preserving source-ordering when identical key are present. We can't 
put \''\:gobble' explicitly because `:' is loaded with cat code 12.

\<idx htag\><<<
index>>>

\Section{Not html to be connected}

\<non-html blocks for divs\><<<
\def\:StartSec#1#2#3{%
   |<BeforeEvery hook|>%
   \expandafter\ifx \csname a:#1\endcsname\relax  \else
      \csname a:#1\endcsname{#3}%
   \fi
   \:Ttle{#1}{#2}{\csname #1:ttl\endcsname{#3}}%
   \expandafter\ifx \csname b:#1\endcsname\relax  \else
      \csname b:#1\endcsname{#3}%
   \fi
   |<Every hook|>%
}
\let\html:addr|=\empty
\let\protect:wrtoc|=\empty
\let\html:tocsec |=\empty
\let\html:sectoc|=\empty
>>>

\<not-html blocks for divs\><<<
\def\html:sectoc#1{|<typeset the not-html sec title|>}
\def\html:tocsec#1{#1}
>>>

\<typeset the not-html sec title\><<<
\csname InsertTitle\endcsname{#1}%
>>>

\<not-html blocks for divs\><<<
\expandafter\let\csname c:TocAt*:\endcsname|=\:gobbleII
\let\c:TocAt:|=\:gobbleII
\let\a:dTocAt|=\empty
\let\b:dTocAt|=\empty
\let\a:TocAt|=\empty
\let\b:TocAt|=\empty
>>>

   |<not-html local env|> 
     |<not-html TeX4ht local env|>    

\<not-html TeX4ht local env\><<<
\let\begin:Verb|=\empty
\let\Verb:boln|=\empty
\let\end:Verb|=\empty
>>>

\<non-html inline verbatim\><<<
\def\:ctgs#1{\def\:eat##1#1{{\vrb:tt ##1}\egroup}\:eat}
>>>

\<not-html local env\><<<
\let\HObey|=\empty
\let\EndHObey|=\empty
>>>

   |<not-html gif|> 

\<not-html gif\><<<
\def\:img{%
   \ifx       *\:temp     \def\:temp##1{\:img}%
   \else \ifx +\:temp     \def\:temp##1{\:img}%
   \else \ifx [\:temp     \def\:temp[##1]{\:img}%
   \else                  \let\:temp\:gobble
   \fi \fi \fi  \:temp}
>>>

\<not-html gif\><<<
\let\:Gif|=\:gobble
\def\:GifText[#1]{\:gobble}
\let\P:ctureCount|=\relax
\let\Gif|=\:gobble
\let\EndPicture|=\empty
\def\im:g[#1]#2{}
>>>

 |<not-html debug|>    
    |<not-html tocs|>  
    |<def not-html /TableOfContents|>  

\<def not-html /TableOfContents\><<<
\def\:TableOfContents[#1]{{%
   \def\TocCount{0}%
   |<interpretation for entries|>%
   \def\:Ttle##1##2##3{}%
   \parindent|=\z@   \catcode`\@|=11 \catcode`\:|=11  
   \csname :BeforeTOC\endcsname
   \input \jobname.4ct    \csname :BotTOC\endcsname
   \bigskip    \csname :AfterTOC\endcsname  }} 
>>>

|<not html Configure's|>   

\Section{Sectioning}

% \def\TeX{TeX}

\<TeX4ht divs\><<<
|<TeX4ht (like)ch and app|>
|<TeX4ht (like)sec|>
|<TeX4ht subsec|>
|<TeX4ht parts|>
>>>

\<html TeX4ht divs\><<<
|<html TeX4ht subsec|>
|<html TeX4ht parts|>
>>>

\SubSection{Chapter, LikeChapter, Appendix}

In its default setting, \TeX{} contributes an indentation of size
\''\parindent' to each paragraph. The following code is introduced for
the removal of the indentation that is first encountered after  the 
switch
\''\:removeindent' is set to be true. (also in boo: condition=>switch
+ not if...)

\<TeX4ht divs\><<<
\ht:everypar{\if:nopar  \hskip -\parindent 
               \ShowPar   \fi}>>>

\<TeX4ht (like)ch and app\><<<
\Def:Section\Chapter{\theChapterCounter}{#1} 
\Def:Section\LikeChapter{\theChapterCounter}{#1}
\Def:Section\Appendix{\theChapterCounter}{#1}
>>>

%\SubSection{Prefix to Title}

\<TeX4ht (like)ch and app\><<<
\NewConfigure{Chapter}[4]{%
  \Configure:Sec {Chapter}{#3}%
     {#4|<addr for Tag and Ref of Ch and App|>}%
     {|<modify ch counter|>#1}{#2}}
\NewConfigure{Appendix}[4]{%
  \Configure:Sec {Appendix}{#3}%
     {#4|<addr for Tag and Ref of Ch and App|>}%
     {|<modify app counter|>#1}{#2}}
\NewConfigure{LikeChapter}[4]{%
  \Configure:Sec {LikeChapter}{#3}%
     {#4|<addr for Tag and Ref of Ch and App|>}%
     {|<modify like ch counter|>#1}{#2}}
>>>

\<non-html TeX4ht (like)ch and app\><<<
\Configure{Chapter}{\:chprefix{#1}}{}{}{}
\Configure{Appendix}{\:chprefix{#1}}{}{}{}
\Configure{LikeChapter}{\:chprefix{#1}}{}{}{}
\def\:chprefix#1{%
   \global\:chapterstrue  
   \bgroup
      \def\InsertTitle{\uppercase}%
      \ShowIndent    \ChapterFonts    \leavevmode   
      {|<headline and footline from ch|>}%
      \vskip20mm    \rightskip|=\z@ plus 0.7\hsize
      \ChapterFonts\bf
      |<typeset ch/like/app num|>%
}
>>>

%\SubSection{Postfix to Title}

\<non-html TeX4ht (like)ch and app\><<<
\def\b:Chapter#1{\bigskip\vskip10mm
   \egroup \IgnorePar
}
\let\b:LikeChapter|=\b:Chapter
\let\b:Appendix|=\b:Chapter
>>>

The command \''\leavevmode' introduces a blank line before the
introduction of the vertical space. The command is needed because
\TeX{} removes the vertical spaces that appear at the top of the
HPages.

  The value of \''\rightskip' is
adjusted to allow for ragged margin on the right, and so to decrease
the probability of getting hyphenated words in the title.
Moreover,
the
paragraph that  the title makes  must be completed before leaving
the braced  group, because the values that
\''\baselineskip' and \''\righskip' hold at the end of the paragraph are
the ones that count. A task that is achieved here with
 \''\bigskip'.

%\SubSection{Fonts}

\<TeX4ht (like)ch and app\><<<
\ifx\ChapterFonts\:UnDef
   \font\:ChFont=cmbx10 scaled \magstep5

   \def\ChapterFonts{\let\bf|=\:ChFont
       \baselineskip|=29.85pt}
\fi
>>>

The command  \''\magstep'$\,i\/$ increases the size of the characters by a
factor of $(1.2)^i$. On the other hand,
 the normal distance between base lines is 12pt.
 Hence, the motivation for increasing this distance to 29.85pt
\hbox{(${}=\hbox{12}\cdot\hbox{(1.2)}^5$pt)}.

%\SubSection{Counters}

\''\ChapterCounter' is 0 for \''\LikeChapter', positive for \''\Chapter',
and negative for \''\Appendix'.  
To allow for the appearance of the title commands within groups, the changes
to variables \''\ChapterCounter' and \''\SectionCounter' are made
global.

\<TeX4ht (like)ch and app\><<<
\gHAssign\ChapterCounter|=0 

\def\theChapterCounter{%
   \ifnum       \ChapterCounter>0 \ChapterCounter
   \else \ifnum \ChapterCounter<0 \:Alph{-\ChapterCounter}\fi\fi}
>>>

 

\<modify ch counter\><<<
\ifnum \ChapterCounter<1           \gdef\ChapterCounter{1}%
                        \else \gHAdvance\ChapterCounter |by 1 \fi
\ifnum \pageno<0 \global\pageno|=1 \fi
|<Ch subcounters|>%
>>>

\<modify app counter\><<<
\ifnum \pageno<0 \global\pageno|=1 \fi
\ifnum \ChapterCounter<0       \gHAdvance\ChapterCounter |by -1
                         \else \gdef\ChapterCounter{-1}\fi
|<Ch subcounters|>%
>>>

\<modify like ch counter\><<<
\gHAssign\ChapterCounter|=0 
|<Ch subcounters|>%
>>>

\<Ch subcounters\><<<
   \gHAssign\SectionCounter|=0 
>>>

Do we want the following public? If so then also \`'\alph'.

\<TeX4ht (like)ch and app\><<<
\def\:Alph#1{\ifcase  #1\or
   A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or
   K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or
   U\or V\or W\or X\or Y\or Z\else    \fi}
>>>

\<typeset ch/like/app num\><<<
   \ifnum \ChapterCounter=0  \def\uppercase##1{##1}%
   \else  \noindent
      \ifnum \ChapterCounter>0 \theChapter
      \else                    \theAppendix \fi
      \vskip10mm
   \fi
   \noindent
>>>

%\SubSection{Hooks}

\<non-html TeX4ht (like)ch and app\><<<
\BeforeEveryChapter{\:clearpage}
\BeforeEveryLikeChapter{\:clearpage}
\BeforeEveryAppendix{\:clearpage}
>>>

\SubSection{Sections and Like Sections}

\<TeX4ht (like)sec\><<<
\Def:Section\Section{\theSectionCounter}{#1} 
\Def:Section\LikeSection{}{#1}
>>>

% \SubSection{Prefix to Title}

The titles of the sections are typesetted as regular  paragraphs with the left
margins adjusted to make a space for the level numbers.

\<non-html TeX4ht (like)sec\><<<
\Configure{Section}{}{}{}{\par \egroup\IgnorePar\medskip\IgnorePar}
\def\a:Section#1{\:SctnPrfx{#1}1}
\def\a:LikeSection#1{\:SctnPrfx{#1}0}
\let\b:LikeSection|=\b:Section

\def\:SctnPrfx#1#2{%
   \bgroup
      \:bigskip      
      \ShowPar
      \SectionFonts
      \bf  \rightskip \z@ plus 0.5\hsize  
      \ifnum #2=1 |<Section number|>%
      \else \parindent|=\z@ \leavevmode   \fi
      {|<headline from section|>}%
}
>>>

\<Section number\><<<
\gHAdvance\SectionCounter |by 1
\def\:temp{\theSection \hskip 0.7em }%
\setbox0|=\hbox{\:temp}%
\advance \leftskip |by \wd0 
\parindent -\wd0   \:temp
>>>

\<TeX4ht (like)sec\><<<
\def\theSection{\theSectionCounter}
>>>

% \SubSection{Postfix to Title}

The \''\par' is inserted  before the \''\nobreak' to provide for a
vertical mode before the latter command is inserted. The motivation
for the latter command is to prohibit a HPage break immediately after the
title. 

% \SubSection{Fonts}

\<TeX4ht (like)sec\><<<
\ifx \SectionFonts\:UnDef
   \font\:SecBF=cmbx10 scaled \magstep3
   \font\:SecTT=cmtt10 scaled \magstep3

   \def\SectionFonts{\let\tt|=\:SecTT
      \let\bf|=\:SecBF  \baselineskip|=20.74pt}
\fi
>>>

% \SubSection{Counters}

\<TeX4ht (like)sec\><<<
\gHAssign\SectionCounter|=0 

\def\theSectionCounter{%
   \ifnum \ChapterCounter=0 \else \theChapterCounter.\fi
   \SectionCounter  }
>>>

% \Section{SubSections}

\<TeX4ht subsec\><<<
\Def:Section\SubSection{}{#1} 
>>>

% \SubSection{Prefix and Postfix to Title}

\<non-html TeX4ht subsec????\><<<
\def\a:subsection#1{
   \bgroup
      \:bigskip \ShowPar
      \rightskip=\z@ plus 0.5\hsize  
      \leavevmode   \SubSectionFonts\bf 
}
>>>

\<non-html TeX4ht subsec\><<<
\Configure{SubSection}{}{}{}{\par \egroup \nobreak \medskip
   \IgnorePar   \ignorespaces}
\def\a:SubSection#1{\bgroup
   \:bigskip \:noparfalse \noindent
   \rightskip=\z@ plus 0.5\hsize
   \SubSectionFonts\bf }
>>>

% \SubSection{Fonts}

\<TeX4ht subsec\><<<
\ifx\SubSectionFonts\:UnDef
   \font\:SubSecFont=cmbx10 scaled \magstep2
   \def\SubSectionFonts{\let\bf|=\:SubSecFont \baselineskip|=17.28pt}
\fi
>>>

\SubSection{Parts}

\<TeX4ht parts\><<<
\Def:Section\Part{}{#1} 
>>>

% \SubSection{Prefix to Title}

\<non-html TeX4ht parts\><<<
\Configure{Part}{}{}{%
   \bgroup
      \:clearpage \:HPageBeforePart       \ChapterFonts \bf
      \headline={\hfil}%
      \footline={\hfil}%
      \baselineskip|=1.3\baselineskip
      \leftskip|=\z@ plus 0.5\hsize    \rightskip|=\leftskip
      \leavevmode\vfill  \leavevmode\break  
      \def\InsertTitle{\uppercase}%
}{%
      \vfill \vfill \vfill \vfill    
      \leavevmode\break   \:HPageAfterPart  \newpage      \IgnorePar
   \egroup      \ignorespaces
}
>>>

\<TeX4ht parts\><<<
\def\OddPartHPage{%
   \def\:HPageBeforePart{\ifodd \pageno \else \leavevmode\ \newpage\fi}%
   \def\:HPageAfterPart{\newpage\leavevmode\ }}
\def\:NoOddChapterHPage{\def\:HPageBeforePart{}\def\:HPageAfterPart{}}
\:NoOddChapterHPage
>>>

 \SubSection{Headers and Footers}

\<non-html TeX4ht divs\><<<
\headline={\:HeaderNumFont   \botmark
   \ifodd\pageno  \:rightheader \else \:leftheader \fi    }
\footline={\:HeaderNumFont \hfil  \:footer \hfil}
\gdef\:leftheader{\hfil}
\gdef\:rightheader{\hfil}
\gdef\:footer{\folio}
\let\::uppercase|=\uppercase
\def\:uppercase#1{{\:HeaderTitleFont \::uppercase{#1}}}
>>>

% \SubSection{From Chapters}

We don't know under what condition \''\mark' and \''\topinsert' will
expand.

\<headline and footline from ch\><<<
\:HeaderFonts   
\gdef\:ChHeader{\noexpand\folio\hfil \:uppercase{#1}}%
\xdef\:StrtChNo{\the\pageno}%
\xdef\:leftheader{\noexpand\ifnum \:StrtChNo=\pageno\hfil
            \noexpand\else\:ChHeader\noexpand\fi}% 
\xdef\:footer{\noexpand\ifnum \:StrtChNo=\pageno\folio
            \noexpand\fi}%
\xdef\:rightheader{\noexpand\ifnum \:StrtChNo=\pageno \hfil
            \noexpand\else \:uppercase{#1}\hfil\noexpand\folio
            \noexpand\fi}% 
\mark{}%
>>>

First mark for current HPage. The second is for the following HPages,
until we get a section header.

The empty \''\mark' ensures that the ones from a sections will not
change the definition of \''\:rightheader' in first HPage of the
chapter (when \''\firtmark' is the choice) and that nothing will
propogate from previous HPages.

The \''\write', and \''\mark'(?), commands introduce whatsis so we want
them in horizontal mode to avoid extra spaces. Also, for correct HPage
numbers,  and for correct timing of headers, we want the \''\:toc' and
\''\mark' to be inserted after we get to horizontal mode.

% \SubSection{From Sections}

\<headline from section\><<<
\:HeaderFonts
\if:chapters \mark{%
   \gdef\noexpand\:rightheader{%
      \noexpand\ifnum \:StrtChNo=\pageno \hfil \noexpand\else
         \ifnum \SectionCounter>0 
            \:uppercase{\theSectionCounter}\space\space \fi
         \:uppercase{#1}\hfil\noexpand\folio
      \noexpand\fi}%
  }%
\fi
>>>

  We also have to take into consideration that
sections present with no chapters.  Hence, the following definition,
and in the above \''\:rightheader' is defined before \''\:leftheader'.

\<headers and footers\><<<
\gdef\:ChHeader{\:rightheader}>>>  

% \SubSection{Fonts}

\`'\:HeaderFonts{cmr8}{cmr10}'---first font to sections and chapters
fonts, and seconf font for HPage numbers. 

We  want \`'\:HeaderNumFont' and \`'\:HeaderTitleFont' to be hard 
wired to a specific font because otherwise fonts taht are in effect
when the HPages  are submitted will take effect (\''\rm', for instance,
is not a font).

\<non-html TeX4ht divs\><<<
\ifx  \:HeaderNumFont\:UnDef
   \font\eightrm=cmr8
   \font\eighttt=cmtt8
   \def\HeaderFonts#1#2#3{%
      \let\:HeaderNumFont|=#1
      \let\:HeaderTitleFont|=#2
      \def\:HeaderFonts{#3}}
   \HeaderFonts\tenrm\eightrm{\def\tt{\eighttt}}
\fi
>>>

\SubSection{Logical Cross-References for  TeX4ht}

\TagSec{dvtg}

\<non-html TeX4ht divs\><<<
\def\TagCh#1{\Tag{#1|<Ch tag|>}{\theChapterCounter}}
\def\RefCh#1{Chapter\ \XRef{#1|<Ch tag|>}}
\def\TagApp#1{\Tag{#1|<Ap tag|>}{\theChapterCounter}}
\def\RefApp#1{Appendix\ \XRef{#1|<Ap tag|>}}
\def\TagSec#1{\Tag{#1|<Sec tag|>}{\theSectionCounter}}
\def\RefSec#1{Section\ \XRef{#1|<Sec tag|>}}
>>>

\<html TeX4ht divs\><<<
\def\TagCh#1{\Tag{#1|<Ch tag|>}{\theChapterCounter}\Tag
                                               {#1|<hCh tag|>}{\:curch}}
\def\RefCh#1{\Link{\LikeRef{#1|<hCh tag|>}}{}Chapter\ \XRef
                                               {#1|<Ch tag|>}\EndLink}
\def\TagApp#1{\Tag{#1|<Ap tag|>}{\theChapterCounter}\Tag
                                               {#1|<hAp tag|>}{\:curch}}
\def\RefApp#1{\Link{\LikeRef{#1|<hAp tag|>}}{}Appendix\ \XRef
                                               {#1|<Ap tag|>}\EndLink}
\def\TagSec#1{\Tag{#1|<Sec tag|>}{\theSectionCounter}\Tag
                                               {#1|<hSec tag|>}{\:cursec}}
\def\RefSec#1{\Link{\LikeRef{#1|<hSec tag|>}}{}Section\ \XRef
                                               {#1|<Sec tag|>}\EndLink}
>>>

\<addr for Tag and Ref of Ch and App\><<<
\xdef\:curch{|<section html addr|>}%
>>>
  

\<html TeX4ht divs\><<<
\def\TagPage#1{%
   \Link{}{page#1}\EndLink\Tag{#1}{}}
\def\RefPage#1{\Link{page#1}{}\XRef{#1}\EndLink}
>>>

\<non-html TeX4ht divs\><<<
\def\TagPage#1{\Tag{#1}{}}
\def\RefPage{\XRef}
>>>

%\SubSection{Standard}

\<Ch tag\><<<
(C >>>

\<Ap tag\><<<
(A >>>

\<Sec tag\><<<
(S >>>

\<hAp tag\><<<
(a >>>

\<hCh tag\><<<
(c >>>

\<hSec tag\><<<
(s >>>

\Section{Tables of Contents}

\SubSection{Invoked Tables of Contents}

A table is communicated from one compilation to another through an
auxiliary file.

\<TeX4ht tocs\><<<
\def\TableOfContents{\futurelet\:temp\:TOC}
\def\:TOC{\ifx [\:temp \expandafter\:TableOfContents
          \else \:TableOfContents[Part,Chapter,LikeChapter,Appendix,%
                                  Section,LikeSection]\fi}
>>>

\<config plain utilities\><<<
\NewConfigure{TableOfContents}{5}
>>>

% \SubSection{Interpretation for the Entries}

\<html TeX4ht tocs\><<<
\def\tocPart#1#2#3{\IgnorePar\HCode{<div 
    align="center">}#2\HCode{</div>}\IgnoreIndent}%
\def\tocChapter#1#2#3{%
   |<indentations from Chapter|>%
   \par\ignorespaces #1 #2\par }
\def\tocLikeChapter{\tocChapter}
\def\tocAppendix{\tocChapter}
\def\tocSection#1#2#3{%
   |<indentations from Section|>%
   \par\tocSection:idnt \ignorespaces #1 #2\par}%
\def\tocLikeSection{\tocSection}
\def\tocSubSection#1#2#3{\par\csname tocSubSection:idnt\endcsname
   \ignorespaces #1 #2\par}  
>>>

A self-modifying definition like
\`'\def\tocChapter{...
   \def\tocChapter##1##2##3{\par\ignorespaces ##1 ##2\par}%
   \tocChapter   }'
can be harmful when \''\TocAt' commands are used.

\<indentations from Chapter\><<<
\ifx \tocSubSection:idnt\:UnDef
   \def\tocSection:idnt{\ }%
   \def\tocSubSection:idnt{\ \ }%
\fi
>>>

\<indentations from Section\><<<
\ifx \tocSubSection:idnt\:UnDef
   \let\tocSection:idnt|=\empty
   \def\tocSubSection:idnt{\ }%
\else 
   \ifx \SubSection:idnt\:UnDef   |% warning?|%
       \let\tocSection:idnt|=\empty
       \def\tocSubSection:idnt{\ }%
   \fi
\fi
>>>

\<non-html TeX4ht tocs\><<<
\def\tocPart#1#2#3{\sl \medskip \hfil #2\par\nobreak}%
\def\tocChapter#1#2#3{\medskip  \:ChapNum{#1}#2\hfill
                                \:pagenum{#3}\penalty1000}
\let\tocLikeChapter|=\tocChapter
\let\tocAppendix|=\tocChapter
\def\tocSection#1#2#3{%
   \:ChapNum{\relax}%
   \:SectNum{#1}#2\TocDotfill\:pagenum{#3}}
\let\tocLikeSection|=\tocSection
\def\tocSubSection#1#2#3{%
   \phantom{xxxx}%
   \:ChapNum{\relax}\:SectNum{\relax}$\bullet$ 
   #2\TocDotfill\:pagenum{#3}}
\def\:BeforeTOC{{\let\TocLikeChapter|=\empty \LikeChapter{Contents}}}
>>>

A \`'\nobreak=\penalty10000' can be a problem for chapters, because it
may cause too much stretching of spaces when there are no sections in
between. A \`'\penalty1000' seems to be good enough to avoid HPage
breaks when sections are close enough.

\<non-html TeX4ht tocs\><<<
\def\TocDotfill{\leaders\hbox to 1em{\hfil.\hfil}\hfill}
>>>

The prefix \''\leaders\hbox to
1em{\hfil.\hfil}' of \''\hfill' asks the command \''\hfill' to
 fill the void with multiple copies of the content of the
horizontal box (instead of just with  white space).  

\<non-html TeX4ht tocs\><<<
\def\:ChapNum#1{\bf\leavevmode
   \def\:test{#1}%
   \ifx \:test\empty \def\uppercase{}\else
      \hbox to 1.7em{#1\hfil}%
   \fi}%
\def\:SectNum#1{\rm
   \def\:test{#1}%
   \ifx \:test\empty \else
      \hbox to 2.5em{#1\hfil}%
   \fi}%
\def\:pagenum#1{\hbox to 1.7em{\hfil #1}\par}
>>>

\<html tocsNO\><<<
\def\:ChapNum#1{\leavevmode
   \def\:test{#1}%
   \ifx \:test\empty \def\uppercase{}\else
      {#1\space}%
   \fi}%
\def\:SectNum#1{\rm
   \def\:test{#1}%
   \ifx \:test\empty \else
      {#1\space}%
   \fi}%
\def\:pagenum#1{}%
>>>

\Section{Lists}

\SubSection{Non Html TeX4ht}

% \SubSection{Starting}

\<non-html TeX4ht lists\><<<
\def\List#1{%
   \def\:tempa##1##2{%
      \ifx\:tempA\:tempB \def\:tempb{\L:st{##1}}\fi \def\:tempB{##2}}%
   \def\:tempb{\L:st{#1}}\def\:tempA{#1}\def\:tempB{ord}%
   \:tempa\:ord1%
   \:tempa{\:ord}{a}%
   \:tempa{\:alph}{A}%
   \:tempa{\:Alph}{i}%
   \:tempa{\:roman}{I}%
   \:tempa{\:Roman}{disc}%
   \:tempa{$\bullet$}{circle}%
   \:tempa{$\circle$}{square}%
   \:tempa{\vrule  depth \z@ height 1ex width 1ex}{}%
   \:tempa{\:lbl}{}%
   \:tempb }

\def\L:st#1{\par \nobreak
   {\advance \medskipamount |by -\parskip \:medskip}%
   \:noparfalse
   \Begin:Block{List}%
      |<non-html List items|>%
      |<lbls for items|>%
      \advance \leftskip |by 1.5em
      \parindent|=0em
      |<items of List|>%
}
>>>

The interparagraph space that \''\parskip' contributes is introduced
when a new paragraph (i.e., horizontal mode) is entered. Within a list
we don't want  the first item to introduce such vertical space
in addition to the one introduced by the
head of the list.
Hence, we before the first item, \''\parskip'  give 0 cotribution.
Also, we want the space around the list (together with parskip) to equal medskip.

\`'\par\:bigskip' instead of just \''\:bigskip' allows a \''\nobreak' before the end of the lis.
e.g., \''\def\LineIndent{\EveryItem={\hskip-0.75em}}'

% \SubSection{Ending}

\<non-html TeX4ht lists\><<<
\def\EndList{\par
   \End:Block{List}%
   {\advance\medskipamount |by -\parskip \:medskip}}
>>>

% \SubSection{Items}

\<items of List\><<<
\HAssign\ListCounter|=0
\def\item{%
   \par \leavevmode      \parskip|=\:ListParSkip
   \Advance:\ListCounter |by 1
   \the\EveryItem}%
>>>

\<TeX4ht lists\><<<
\expandafter\csname newtoks\endcsname\EveryItem
>>>

\<TeX4ht lists\><<<
\def\ListParSkip{\def\:ListParSkip}
\ifHtml
  \ListParSkip{\HtmlPar}
\fi
>>>

\<non-html TeX4ht lists\><<<
\expandafter\csname newskip\endcsname\ListParSkip
\def\:ListParSkip{\ListParSkip}
\ListParSkip|=4.5pt plus 1.5pt minus 1.5pt
>>>

% \SubSection{Labels}

\<items of List\><<<
\def\:temp{#1}\def\:tempa{\:lbl}\ifx   \:temp\:tempa
       \EveryItem={\hskip-1.5em\:ListItem}%
\else  \EveryItem={|<Alph|>%
                   \llap{#1\hskip 0.5em}}\fi
>>>

\<lbls for items\><<<
\lbl:tm
>>>

\<TeX4ht lists\><<<
\def\lbl:tm{%
   \def\:ord{\a:Item\ListCounter\b:Item}%
   \def\:roman{\a:Item\romannumeral\ListCounter\b:Item}%
   \def\:alph{{\Advance: \ListCounter |by 96
               \a:Item \char\ListCounter\b:Item}}%
   \def\:Roman{\a:Item\uppercase{\romannumeral\ListCounter}\b:Item}%
   \def\:Alph{{\Advance: \ListCounter |by 64
               \a:Item \char\ListCounter\b:Item}}%
}
\def\:lbl#1{\a:Item#1\b:Item}
>>>

\<general tex-sty configure utilities\><<<
\long\def\c:Item:#1#2{\c:def\a:Item{#1}\c:def\b:Item{#2}}
>>>

\<non-html TeX4ht lists\><<<
\def\:ListItem#1{\:lbl{#1}\hskip 0.5em\ignorespaces}
>>>

A global  \''\Configure{Item}' is not that good of an idea when nested
lists are present.

\<non-html List items\><<<
\Configure{Item}{}{.}%
>>>

In its default setting, \`'\:lbl' has the meaning of identity+period.

% \SubSection{Named Groups}

\<general tex-sty configure utilities\><<<
\def\Begin:Block#1{\begingroup \def\:EndBlock{#1}}

\def\End:Block#1{%
   \expandafter\ifx \csname :EndBlock\endcsname\relax
      \:warning{Block #1 is already closed}%
   \else
      \def\:test{#1}%
      \ifx \:test\:EndBlock \endgroup
      \else
      \:warning{End environment #1 within
               environment \:EndBlock?}%
   \fi\fi}>>>

\SubSection{Html TeX4ht}

\<html TeX4ht lists\><<<
\def\List#1{\begingroup  {\hfil\break\IgnorePar}%
   \HAssign\ListCounter|=0 
   |<set html list type|>%
   |<lbls for items|>%
}
>>>

\<set html list type\><<<
\let\:temp|=\empty \def\:tempA{#1}%
                                              \def\:tempB{ord}%
\ifx\:tempA\:tempB \else \let\:temp|=\:tempA  \def\:tempB{1}\fi
\ifx\:tempA\:tempB \else                      \def\:tempB{a}\fi
\ifx\:tempA\:tempB \else                      \def\:tempB{A}\fi
\ifx\:tempA\:tempB \else                      \def\:tempB{i}\fi
\ifx\:tempA\:tempB \else                      \def\:tempB{I}\fi
\let\item|=\:LIitem
\ifx       \:tempA\:tempB |<enumerated list|>%
                          \let\a:List|=\c:OList
\else                                        \def\:tempB{}%
   \ifx    \:tempA\:tempB |<def list|>%
   \else                                     \def\:tempB{button}%
      \ifx \:tempA\:tempB |<button list|>%
      \else               |<marked list|>%
                          \let\a:List|=\c:UList
\fi\fi\fi
>>>

% \SubSection{Enumerated and Marked Lists}

\<enumerated list\><<<
{\a:OList}%
\def\EndList{\b:OList\endgroup }%
>>>

The \`'hbox' is for preserving vr mode. The grouping is
for preserving \`'ignorepar'.

\<marked list\><<<
\a:UList \def\EndList{\b:UList\endgroup }%
>>>

\<html TeX4ht lists\><<<
\NewConfigure{OList}{3}
\NewConfigure{UList}{3}
\NewConfigure{DList}{4}
>>>

\<html TeX4ht lists\><<<
\let\:UL:|=\empty
\def\:LIitem{%
   {\parindent=0pt\leavevmode}\:noparfalse    \ht:everypar{\Li:Par}%
    \Advance:\ListCounter |by 1  \a:List
}
>>>

% \SubSection{Labeled (=Definition) Lists}

\<def list\><<<
\a:DList \let\item|=\:DLitem \let\End:dd|=\empty
\def\EndList{\b:DList\endgroup }%
>>>

Lynx doesn't like  \`'\leavemode' alone because vertical mode produces
\`'<DD><DT>' and the empty body of \`'<DD>' is not handled nicely
there. Hence, the \`'{\ht:everypar{\HCode{<P>}}\leavevmode}'.

\<html TeX4ht lists\><<<
\def\:DLitem#1{%
   \Advance:\ListCounter |by  1
   \c:DList #1\d:DList    \ht:everypar{\Li:Par}%
}
>>>

\<set html list type\><<<
\let\Li:Par|=\:ListParSkip
\ht:everypar{\if:nopar \else \HtmlPar\fi}%
>>>

\SubSection{Button Lists}

\Verbatim
|
+----+
     |
+----+
| HPage - 1
+----+
     |
+----+
| HPage - 2
+----+
     |
+----+
| HPage - 3
+----+
     |
+----+
|
\EndVerbatim

\<button list\><<<
\a:buttonList
\let\Item|=\It:em
\edef\but:file{\RefFileNumber\FileNumber}%
\ifx \but:file\empty  \edef\but:file{\j:bname tmp.\:html}\fi
\def\ALL:file##1.##2|<par del|>{\def\ALL:file{##1-}}%
\NewFileName\all:file \expandafter\ALL:file\all:file.|<par del|>% 
\HPage<\all:file>{}\IgnorePar
\let\item|=\B:item
\def\EndList{%
   \ifnum \ListCounter>1 \l:Bd{#1}\fi
   \EndHPage{}%
   \b:buttonList \endgroup  }%
>>>

Set browser-title for the above HPage?
% was
% \SaveEverypar \FileStream[ ]
% \EndFileStream\all:file  \RecallEverypar

% \SubSection{item}

For simple HPage: \`'\item{...}...'.

\<html TeX4ht lists\><<<
\def\B:item#1{%
   \ifnum \ListCounter>0 \l:Bd{#1}\fi
   \Advance:\ListCounter |by 1
   \FileStream\but:file 
      \Recall:Link\bt:fl  \Recall:HPage\hpg:fl \Recall:HPageTag\hptg:fl
   \L:Ba{#1}\Link[\all:file]{\ALL:file
                             \ListCounter}{\ALL:file\ListCounter}%
   \L:Bb{#1}\EndLink
   \L:Bc{#1}\FileStream\all:file 
      \Save:Link\bt:fl    \Save:HPage\hpg:fl   \Save:HPageTag\hptg:fl
   \l:Ba{#1}\Link[\but:file]{\ALL:file
                             \ListCounter}{\ALL:file\ListCounter}%
   \l:Bb{#1}\EndLink         
   \l:Bc{#1}\HtmlEnv}
>>>

% \SubSection{Item}

For sensitive code: \`'\Item...\ContItem...'.

\<html TeX4ht lists\><<<
\def\It:em{\bgroup  \csname no:catcodes\endcsname0{255}{12}%
                    \catcode`\^^I=13\relax\:Itm}
\bgroup
   \global\let\:grp|=\egroup  
   \def\:temp{%
      \csname no:catcodes\endcsname0{255}{12}
      \catcode`\/|=0 \catcode`\{|=1 \catcode`\}|=2  \catcode`\#|=6
      \catcode`\:|=11 \catcode`\g|=11 \catcode`\r|=11 \catcode`\p|=11 
      \gdef\:Itm }
\:temp#1\ContItem{/:grp/g:rp{#1}}/:grp

                                          \catcode`\^^I=13
\def\g:rp#1{%
   \immediate\openout15=\jobname.tmp
    {\newlinechar`\^^M \def^^I{\space\space}%
     \immediate\write15{\string\ignorespaces\space#1}}%
   \immediate\closeout15
   \B:item{\input \jobname.tmp}}
                                          \catcode`\^^I=10
>>>

% \SubSection{Configure}

Style for HPages.

\<html TeX4ht lists\><<<
\NewConfigure{buttonList}[5]{\def\a:buttonList{#1}%
   \def\b:buttonList{#2}%
   \def\L:Ba##1{#3}\def\L:Bb##1{#5}\def\L:Bc##1{#4}}
>>> 

\`'\Configure{buttonList}
{before-external-list}
{after-external-list}
{before-external-anchor}
{after-external-anchor}
{external-anchor}'.

\<html TeX4ht lists\><<<
\NewConfigure{buttonList+}[4]{%
    \def\l:Ba##1{#1}\def\l:Bb##1{#4}\def\l:Bc##1{#2}\def\l:Bd##1{#3}}
>>>

\`'\Configure{buttonList+}{before-internal-anchor}
{after-internal-anchor}
{internal-anchor}'.

The {before-item},
{after-item}, and
{anchor}, get the item content \''#1' for a parameter.

\Section{Html Tables}

We need  the \''\HTable{...}' version for handling
TeX tables and for not modifying \`'&' with other
catcode or replacement command. Otherwise, \''\HTable...\EndHtable' 
are better because that don't ask for expandable stuff.

\<HTable\><<<
\def\HTable{%
   \let\:TR|=\empty
   \let\TABLE:|=\empty
   \futurelet\:temp\T:ABLE}
>>>

Defining the \''\HTable' in terms of \''\halign' is problematic
for a few reasons.

\List{1}
\item
Paragraph breaks are treated as space characters within \''\halign'.
Defining\''\par' to equal \''\the\ht:everypar' causes multiple calls to
\''\ht:everypar'.

\item Don't know how to get the \''</TABLE>' in place.

\item  Well, so far I 
\ifHtml[\HPage{got}\Verbatim
\Odef\HTable[#1]{\futurelet\:temp\:HTable}
\def\:HTable{\ifx \:temp\bgroup 
   \def\:temp##1{\H:Table##1\EndHTable}\else
   \let\:temp=\H:Table  \fi   \:temp}

\def\H:Table{\begingroup  
   \a:HTable\special{t4ht=<TABLE \T:HTable:>}%
   \let\sv:Col=\HCol \HAssign\HCol = 0
   \let\sv:Row=\HRow \HAssign\HRow = 0
   \TeXhalign\bgroup  
   \ifnum \HCol>0\special{t4ht=</TR>}\fi\:HtblR
   \:Hentry##\End:Hentry&&\:Hentry ##\End:Hentry\cr}

\def\EndHTable{\cr\egroup 
   \End:HtblR \ht:special{t4ht=</TABLE>}\b:HTable
   \global\let\HCol=\sv:Col
   \global\let\HRow=\sv:Row
   \endgroup}

\def\:HtblR{\gHAdvance\HRow by 1
   \ht:special{t4ht=<tr \R:HTable:>}}
\def\End:HtblR{\special{t4ht=</tr>}}
\Odef\:Hentry[#1]{\gHAdvance\HCol by 1
   \ht:special{t4ht=<td \D:HTable:>}\bgroup  }
\def\End:Hentry{\egroup\special{t4ht=</td>}}

\def\c:HTable:#1#2#3#4#5{\c:def\a:HTable{#1}\c:def\b:HTable{#2}%
   \c:def\T:HTable:{#3}\c:def\R:HTable:{#4}\c:def\D:HTable:{#5}}
\Configure{HTable}{}{}{}{}{}

\EndVerbatim\EndHPage{}]\fi

\item What about paragraph breaks in independent HTable?  Are we loosing them 
as is the case in the following example.

\ifHtml[\HPage{??}\Verbatim

\documentclass{book}

\input DraTex.sty      \input AlDraTex.sty

\input tex4ht.sty

\Preamble{html,next,HTable,sections-,fonts}

\input ProTex.sty
\AlProTex{llo,<<<>>>,`,NoShow}

\def\Example{\begingroup 
\Contribute{HTable}{border="0" cellpadding="0"
   cellspacing="0" width="100\%"}
   \HTable^/\Code\xxxx{}<<<}
\def\EndExample{{\ShowOn \advance\leftskip by -3em
   \let\extra=\empty  \let\extraB=\empty \ShowCode-\xxxx}
   \def\@##1@{##1}   \OutputCode[tmp]\xxxx 
   \&~\&[/BGCOLOR="\#FFFFCC"] 
\ht:everypar{\HtmlPar}\input xxxx.tmp  \CR \EndHTable
   \endgroup
   \let\extra=\empty   \let\extraB=\empty \let\comments=\empty}
\Contribute{HTable}{WIDTH="100\%"}

% \HPage{+}\ShowFile{xxxx.tmp}\EndHPage{}\CR

\Define\Color(3){{
   \Text(--\special{ps:~#1~#2~#3~setrgbcolor}--)}}
\def\@#1@{\HCode{<FONT COLOR="\#0000FF"><STRONG>}%
   #1\HCode{</STRONG></FONT>}}

\ShowOff

\HShowCode{}{}{}{\HCode{</A>...<A>}}{}

\NewSection\Slide{$\bullet$~#2 }
\Configure{Slide}{\IgnorePar\HCode{<h2>}}
   {\HCode{</h2>}\IgnoreIndent}{}
\CutAt{Slide,part}

\NewSection\likeslide{}
\cOnfigure{likeslide}{\IgnorePar\HCode{<!--}}
   {\IgnorePar\HCode{-->}}{}
\CutAt{likeslide,Slide}

\Configure{crosslinks}{[}{] }{next}{prev}{}{}{}{}

\Configure{crosslinks+}{}{[\Link[\RefFile
      {toc}]{}{}toc\EndLink]\par\ShowPar}
  {\par\ShowPar}{[\Link[\RefFile{toc}]{}{}toc\EndLink]}

\begin{document}

\EndPreamble

%---------------------- start here -------------------------

% \DrawOff

\HCode{<DIV ALIGN="CENTER">}
\part{A Demonstration of TeX4ht}

Eitan M. Gurari\HCode{<BR>}Ohio State Univ

The 18th Annual Meeting of the\HCode{<BR>}
             TeX Users Group\HCode{<P>}
              July 28 - August 1, 1997\HCode{<BR>}
             San Francisco, California 
\HCode{</DIV>}

\HCode{<BR>}\HCode{<BR>}\HCode{<BR>}

Note: The following slides refer to LaTeX.  However, the demonstration
applies also to other TeX-based styles.

{\tt http://www.cse.ohio-state.edu/\HCode{<BR>} \string~gurari/tug97/}

\NextNewFileName{\jobname-toc.html}

\likeslide{}

                  \TagFile{toc}
\tableofcontents[Slide]

\Slide{TeX4ht as a Converter}

\Code\semilatex{}<<<
\def\documentclass#1{}
\let\oldbegin=\begin
\def\begin#1{\def\tempa{#1}\def\tempb{document}\ifx \tempa\tempb
  \else \def\temp{\oldbegin{#1}}\expandafter\temp \fi}
\let\oldend=\end
\def\end#1{\def\tempa{#1}\def\tempb{document}\ifx \tempa\tempb
  \else \def\temp{\oldend{#1}}\expandafter\temp \fi}
\def\input#1\EndPreamble{\ShowPar}
>>>

\Code\extra{}<<<
`semilatex
>>>

\Example
`extra\documentclass
        {article}
   
\title{Psalms}
\author{131:1}
   
`@\input tex4ht.sty@
`@\Preamble{html}@
\begin{document}  
`@\EndPreamble@
       \maketitle   

My heart is not 
haughty, nor mine 
eyes lofty: 

neither do I 
exercise myself in 
great matters, or 
in things too high
for me.
    \end{document}
>>> \EndExample

\end{document}

\EndVerbatim\EndHPage{}]\fi

Also, do we have consistent behavior between TeX and LaTeX here?
\EndList

\SubSection{Character Options after /HTable}

\<HTable\><<<
\def\T:ABLE{%
   \ifx \bgroup\:temp  \let\:temp|=\HT:ble
   \else  \ifx [\:temp \let\:temp|=\HT:ble
          \else |<character options for TABLE|>%
   \fi \fi                 \:temp}

\def\TA:BLE#1{%
   \let\:tempb|=\:TR   \al:gn\:TR#1%
   \ifx \:tempb\:TR \expand:after{\HT:ble#1}%
   \else  \expand:after{\futurelet\:temp\T:ABLE}\fi
}
>>>

We stay above for all the characters before the caption.

% \SubSection{Options for TABLE}

\<character options for TABLE\><<<
\let\:tempb|=\TA:BLE
\ifx B\:temp  \edef\TABLE:{\HTable:B \TABLE:}%
              \def\:tempb##1{\futurelet\:temp\T:ABLE}%              
\fi
\HTable:brdr P{cellpadding}%
\HTable:brdr S{cellspacing}%
\let\:temp|=\:tempb
>>>

\<HTable\><<<
\def\HTable:brdr#1#2{\ifx #1\:temp
      \def\:tempb##1{\afterassignment\:tempa\tmp:cnt|=}%
      \def\:tempa{%
         \edef\TABLE:{#2="\the\tmp:cnt" \TABLE:}%
         \futurelet\:temp\T:ABLE }%
   \fi}
>>>

\<HTable\><<<
\def\arg:HTable#1#2{%
   \def\:temp{#1}\ifx \:temp\empty \else
      \expandafter\def\csname HTable:\string#1\endcsname{#2}%
      \expandafter\arg:HTable
   \fi
}
\NewConfigure{HTable+}[2]{\arg:HTable{#1}{#2}}
>>>

% \SubSection{Option on Entries}

The options are inserted into the entries.

\<HTable\><<<
\def\al:gn#1#2{%
   \add:TD#1<#2{\csname HTable:<\endcsname }%
   \add:TD#1>#2{\csname HTable:>\endcsname }%
   \add:TD#1-#2{\csname HTable:-\endcsname }%
   \add:TD#1^#2{\csname HTable:\string^\endcsname }%
   \add:TD#1||#2{\csname HTable:||\endcsname }%
   \add:TD#1_#2{\csname HTable:\string_\endcsname }%
   \add:TD#1=#2{\csname HTable:=\endcsname  }%
}
\def\add:TD#1#2#3#4{\chardef\:temp|=`#2
                    \chardef\:tempa|=`#3
                    \ifnum \:temp=\:tempa\edef#1{#1\space #4}\fi}
\let\:TR|=\empty
>>>

The above is superior to \`'\def\add:TD#1#2#3#4{\ifx
#2#3\edef#1{#1\space #4}\fi}' because it is indepndent of category
codes and \`'_' and \`'^', for instance, may change their meaning.

\SubSection{Open Table}

\<HTable\><<<
\def\HT:ble{\bgroup  \let\sv:row|=\HRow  \let\sv:col|=\HCol
   \gHAssign\HRow|=1 \gHAssign\HCol|=0 
   \htbl: }
>>>

\<HTable\><<<
\def\htbl:{%
   \let\GetInt|=\Get:Int
   \let\GetArg|=\Get:Arg    \a:HTable
   |<script at start of tables|>%
   \c:HTable\hfil\break   
   \ht:everypar{}\futurelet\:temp\tbl:bd }
\NewConfigure{HTable}{6}
>>>

\<HTable\><<<
\def\EndHTable{%
   \end:cell  \d:HTable   \b:HTable
   \global\let\HRow|=\sv:row  \global\let\HCol|=\sv:col  \egroup
   |<nullify script|>}
>>>

% \SubSection{Type of Table?}

\<HTable\><<<
\def\tbl:bd{\ifx \:temp\bgroup  \let\tbl:typ|=\tbl:bdy
   \else    \ifx /\:temp        \def\tbl:typ##1{\env:tbl}%
   \else  \let\tbl:typ|=\env:tbl
   \fi \fi \tbl:typ }
\long\def\tbl:bdy#1{%
   \def\hfil{\ifx \EndPicture\:UnDef \space \else\:hfil\fi}%
   \def\hfill{\ifx \EndPicture\:UnDef \space \else\:hfill\fi}%
   \expandafter\let\csname cr\endcsname|=\:cr
   \:HTable#1&\EndH:Table }
\let\:hfil|=\hfil
\let\:hfill|=\hfill
>>>

Without the restructuring of the hfil's TeX4ht gets cofused
and looses spaces between words. 

\SubSection{Enviromental Tables}

\<HTable\><<<
\def\env:tbl{\def\&{\end:cell \TD:cell }\TD:cell }
\def\CR{\end:cell
   \gHAdvance\HRow |by 1  \gHAssign\HCol|=0
   \d:HTable\c:HTable\hfil\break  \TD:cell }                
>>>

\SubSection{Braced Tables}

Extract the cells recursively.

\<HTable\><<<
\long\def\:HTable#1&#2\EndH:Table{%
   \def\:htbend{#2}%
   \insert:TD#1\tok:nmath
   \def\:temp{#2}\ifx\:temp\empty \EndHTable
   \else  \expand:after{\end:cell
                        \:HTable#2\EndH:Table}\fi }
\def\tok:nmath{\empty}
\def\end:cell{\:EndHTableScript   \f:HTable}
>>>

% \SubSection{Get Cell after /cr}

\<HTable\><<<
\def\:cr{\ifx \EndPicture\:UnDef \expandafter\:cR
          \else                  \expandafter\:c:r\fi}
\expandafter\let\csname :c:r\endcsname|=\cr
\long\def\:cR#1{\relax
   \ifx\:htbend\empty
      \def\:temp{#1}%
      \ifx\:temp\NoArg \else \expandafter\mpty:cr\fi
   \else                      \mpty:cr
   \fi        #1}%

\def\mpty:cr{%
   \expand:after{\end:cell  \gHAdvance\HRow |by 1  \gHAssign\HCol|=0
   \d:HTable\c:HTable \insert:TD}}
>>>

We need global increases in Col and Row for cases like
\`'\HTableScript{$}{$}'.

\SubSection{Retrieve the Local Options for a Cell}

% \SubSection{Find Options in Environmental Tables}

\<HTable\><<<
\def\TD:cell{\gHAdvance\HCol |by 1   \futurelet\:temp\TD:cll }
\def\TD:cll{%
   \ifx [\:temp  \let\:temp|=\T:D 
   \else  \expandafter\ifx\space\:temp 
      \expand:after{\def\:temp}\space{\futurelet\:temp\TD:cll}\else  
      \tbl:ch
   \fi \fi \:temp}
>>>

\<HTable\><<<
\catcode`\^=13  \catcode`\_=13
\def\tbl:ch{{\def^{\string^}\def_{\string_}%
       \xdef\:temp{\noexpand\T:D[\:HTbleAtt]}}}
\catcode`\^=7  \catcode`\_=8
>>>

% \SubSection{Find Options in Braced Tables}

\<HTable\><<<
\def\insert:TD{\futurelet\:tempc\TD:}

\def\TD:{%
   \ifx \par\:tempc \def\:temp\par{\insert:TD}\go:out\:temp\fi
   \expandafter\ifx \space\:tempc
          \expand:after{\def\:temp}\space{\insert:TD}%
                                \go:out\:temp      \fi
   \ifx \EndH:Table\:tempc     \go:out\empty\fi
   \gHAdvance\HCol |by 1    \chk:tblop   \tbl:ch \go:out\:temp\empty
   \:out}

\def\chk:tblop{\ifx [\:tempc \go:out\T:D  \fi}
>>>

We want the rectangles `[...' at halign tables to be
part of the entries.

\<no check for [...] in HTable\><<<
\let\chk:tblop|=\empty
>>>

% \SubSection{Get the Options}

\<HTable\><<<
\def\T:D[{\def\TD:typ{td}\let\TD:more|=\empty \scan:TD}
\def\scan:TD#1{%
   \ifx ]#1\e:HTable
      \go:out\:HTableScript  \fi
   \ifx /#1\def\:temp##1]{\edef\TD:more{\TD:more\space##1}\scan:TD]}%
          \go:out\:temp  \fi
   \ifx H#1\def\TD:typ{th}\go:out\scan:TD\fi
   \ifx R#1\SP:N{rowspan}\fi
   \ifx C#1\SP:N{colspan}\fi
   \al:gn\TD:more#1%
   \go:out\scan:TD\empty\:out   }

\def\SP:N#1{%
   \def\:temp{\edef\TD:more{ #1="\the\tmp:cnt"\TD:more
                 \Hnewline}\scan:TD}%
   \def\:tempa##1{\afterassignment\:temp \tmp:cnt|=##1}%
   \go:out\:tempa}
>>>

\SubSection{Script}

\<script at start of tables\><<<
\let\:EndHTableScript|=\:EndHTblScript
\let\:HTableScript|=\:HTblScript
\let\:HTbleAtt|=\:HTblAtt
|<nullify script|>%
>>>

\<nullify script\><<<
\let\:EndHTblScript|=\empty
\let\:HTblScript|=\empty
\let\:HTblAtt|=\empty
>>>

\<HTable\><<<
\def\HTableScript{\futurelet\:temp\tblScrpt:}
\def\tblScrpt:{\ifx [\:temp  \expandafter\:tblScrpt
               \else  \expand:after{\:tblScrpt[]}\fi }
\long\def\:tblScrpt[#1]#2#3{%
    \def\:HTblAtt{#1}%
    \def\:HTblScript{#2\go:out\empty|<par del|>\:out}%
    \def\:EndHTblScript{#3}}
|<nullify script|>
>>>

\<HTable\><<<
\def\go:out#1{\expand:after{\g:out#1}}
\long\def\g:out#1#2\:out{#1}
>>>

\SubSection{Scanning of Cells}

\<HTable\><<<
\long\def\Get:Int#1#2|<par del|>\:out{%
   \def\:next{%
      \edef\:next{\the\tmp:cnt\space}%
      \HAssign#1|=\:next #2|<par del|>\:out}%
   \afterassignment\:next
   \tmp:cnt }
>>>

\<HTable\><<<
\def\DefGetArg#1#2#3{\def\:temp{#3}%
   \ifx \:temp\NoArg  \D:fGetArg{#1}{#2}#3#3\else
                       \D:fGetArg{#1}{#2}{#3}{}\fi 
}
\def\D:fGetArg#1#2#3#4{%
   \expand:after{\long\def}\csname 
        Get:Arg:#1:#2\endcsname##1##2!*?: \:out{%
      \def\:next####1#3{\def##1{####1}%
                        |<no token?|>#4##2!*?: \:out}%
      \:next }}

\DefGetArg{}{}{}
>>>

\`'\DefGetArg{}{1}\tok:nmath' tages the full entry, but it is
problematic for a tail entry in a row.

Use

\<HTable\><<<
\def\stgt:arg#1#2{%
  \expand:after{\let\:tempa=|}\csname Get:Arg:#1:#2\endcsname
  \ifx \:tempa\relax \else \let\:temp|=\:tempa \fi }
\def\Get:Arg{%
  \let\:temp|=\Get:Arg::\stgt:arg{}\HCol \stgt:arg\HRow{}%
  \stgt:arg\HRow\Col \:temp}
>>>

\<no token?\><<<
\ifx \tbl:typ\tbl:bdy  \else
   \ifx    ##1\&\let##1|=\NoArg\fi
   \ifx ##1\CR  \let##1|=\NoArg\fi
\fi
>>>

\<HTable\><<<
\def\NoArg{\tok:nmath}
>>>

%%%%%%%%%%%%%%%
\Section{footmisc}
%%%%%%%%%%%%%%%%%

\<footmisc.4ht\><<<
% footmisc.4ht (|version), generated from |jobname.tex
% Copyright 2019-2024 TeX Users Group
|<TeX4ht license text|>
|<footmisc footnote counter|>
|<footmisc footnotetext|>
|<footmisc symbols|>


\Hinput{footmisc}
\endinput
>>>        \AddFile{9}{footmisc}

Footmisc can reset the normal footnote counter on every page. Footnote links are 
then wrong, as they point to an earlier footnote. My solution is to use a global 
counter that gives each footnote unique number and which doesn't rely on the footnote 
symbol.

\<footmisc footnote counter\><<<
\newcounter{:footnotes}

\def\FNnum{\the\:footnotes}

\HRestore\footnote

\def\:tempc{%
   \HAssign\FNnum = \csname c@:footnotes\endcsname%
   \stepcounter{:footnotes}%
   \HAdvance\FNnum by 1%
   \o:footnote:%
}
\HLet\footnote=\:tempc
>>>

\<footmisc footnotetext\><<<
\long\def\@footnotetext#1{\leavevmode
   \vbox{%\IgnorePar
      \leftskip0pt {\ht:everypar{}\parindent0pt\leavevmode}%
      \long\def\:tempc##1{\protected@edef\@currentlabel{\the\csname c@footnote\endcsname}%
\anc:lbl f{footnote}%
\Configure{newlabel}{\cur:th\the\csname c@footnote\endcsname}{\protect\p@footmisc@footnote{\the\csname c@footnote\endcsname}}
\a:footnotetext
   \o:@makefntext:{\b:footnotetext \csname a:footnotebody\endcsname
                {##1}\csname b:footnotebody\endcsname}\c:footnotetext
}%
\HLet\@makefntext\:tempc
%
      \reset@font\footnotesize
      \color@begingroup
        \@makefntext{\ignorespaces#1}%
      \color@endgroup
      \ht:special{t4ht@[}}\ht:special{t4ht@]}}

>>>

\<footmisc symbols\><<<
% detect if the symbol or symbol* option were used
% we can detect that by testing of \thefootnote macro

\edef\footmisc:thefootnote{\expandafter\unexpanded\expandafter{\thefootnote}}
\edef\footmisc:symbol{\unexpanded{\fnsymbol{footnote}}}
\edef\footmisc:symbolstar{\unexpanded{\@fnsymbol\c@footnote}}

\ifx\footmisc:thefootnote\footmisc:symbol
  \newcommand\p@footmisc@footnote[1]{\@fnsymbol{#1}}
\else
  \ifx\footmisc:thefootnote\footmisc:symbolstar
    \newcommand\p@footmisc@footnote[1]{\@fnsymbol{#1}}
  \else
    \newcommand\p@footmisc@footnote[1]{\p@footnote{#1}}
  \fi
\fi
>>>

%%%%%%%%%%%%%%%
\Section{tablefootnote}
%%%%%%%%%%%%%%%%%

\<tablefootnote.4ht\><<<
% tablefootnote.4ht (|version), generated from |jobname.tex
% Copyright 2022 TeX Users Group
|<TeX4ht license text|>
|<config tablefootnote|>
\Hinput{tablefootnote}
\endinput
>>>       \AddFile{9}{tablefootnote}

The \''\tablefootnote| command tries to print list of footnotes 
at the end of a table where they were used. I haven't found
a good way how to do this in TeX4ht, so we just use normal footnote
instead.

\<config tablefootnote\><<<
\let\tablefootnote\footnote
>>>


%%%%%%%%%%%%%%%
\Section{marginnote}
%%%%%%%%%%%%%%%%%

\<marginnote.4ht\><<<
% marginnote.4ht (|version), generated from |jobname.tex
% Copyright 2023 TeX Users Group
|<TeX4ht license text|>
|<config marginnote|>
\Hinput{marginnote}
\endinput
>>>       \AddFile{9}{marginnote}

\<config marginnote\><<<
\NewConfigure{marginnote}{2}
\long\def\:tempa[#1]#2[#3]{\a:marginnote#2\b:marginnote}
\HLet\@mn@@@marginnote\:tempa
>>>

%%%%%%%%%%%%%%%
\Section{Other}
%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Local Drawing Environment}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<draw sty\><<<
\:CheckOption{draw}     \if:Option 
   |<local draw env|>
\fi
>>>

\<local draw env\><<<
\NewConfigure{Fig}{2}
\Odef\Fig[#1]{\bgroup
   \ifx  \EndPicture\:Undef  
      \ifx  \EndFig\:Undef  
         \def\EndFig{\b:Fig\egroup}%
         \def\AltFig{#1}\a:Fig
      \else  \let\EndFig|=\egroup \fi
   \else  \let\EndFig|=\egroup \fi
   \HAssign\y::=0
   \def\Text##1"##2"{\raise \y:: pt \hbox to 0pt{##2\hss}\ignorespaces}%
   \def\Line{\afterassignment\Ln:A\tmp:cnta}%
   \def\Move{\afterassignment\Mv:A\tmp:cnta}\ignorespaces}

\def\Ln:A{\afterassignment\Ln:B\tmp:cntb}
\def\Ln:B{\bgroup \leavevmode  
  |<diagonal line|>%
   \egroup \Mv:B  }

\def\Ln:C{\ifnum \I::<\J::
   \vrule depth \z@ height \z@ width \tmp:dim 
   \raise \tmp:dima \hbox{\vrule height 0.5pt depth 0.5pt  width 1pt}%
   \vrule depth \z@ height \z@ width -\tmp:dim
   \vrule depth \z@ height \z@ width -1.0pt
   \advance\tmp:dim by  \C::
   \advance\tmp:dima by  \D::
   \Advance:\I:: by  1
   \expandafter\Ln:C  \fi  }

\def\Mv:A{\afterassignment\Mv:B\tmp:cntb}
\def\Mv:B{\leavevmode 
   \vrule depth \z@ height \z@ width \tmp:cnta pt
   \Advance:\y:: by \tmp:cntb     \ignorespaces  }

\csname newcount\endcsname\tmp:cnta
\csname newcount\endcsname\tmp:cntb
\csname newdimen\endcsname\tmp:dima
>>>

\<diagonal line\><<<
\HAssign\I::=\ifnum \tmp:cnta<0 -\fi \tmp:cnta
\HAssign\J::=\ifnum \tmp:cntb<0 -\fi \tmp:cntb
\ifnum \I::>\J:: \HAssign\J::=\I:: \fi \relax
\ifnum \J::>0
   \tmp:dim=\tmp:cnta pt  
   \ifnum \tmp:cnta<0  
       \tmp:dim|=-\tmp:dim
       \vrule depth \z@ height \z@ width \tmp:cnta pt
       \HAdvance\y:: by \tmp:cntb    \tmp:cntb|=-\tmp:cntb
   \fi
   \divide\tmp:dim by \J::  \edef\C::{\the\tmp:dim}%
   \tmp:dima=\tmp:cntb pt  \divide\tmp:dima by \J::  
   \edef\D::{\the\tmp:dima}%
   \tmp:dima|= \y:: pt 
   \HAssign\I::|=-1  \tmp:dim|=\z@  \Ln:C 
   \ifnum \tmp:cnta>0  \else
      \vrule depth \z@ height \z@ width -\tmp:cnta pt
\fi\fi
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{PostScript}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<postscript draw\><<<
\ifHtml
   \:CheckOption{postscript}  \if:Option  
      |<postscript|>
      |<special|>
   \fi 
\fi
>>>

\<postscript\><<<
\expandafter\def\csname i:0\endcsname{0}
\expandafter\def\csname i:1\endcsname{1}
\expandafter\def\csname i:2\endcsname{2}
\expandafter\def\csname i:3\endcsname{3}
\expandafter\def\csname i:4\endcsname{4}
\expandafter\def\csname i:5\endcsname{5}
\expandafter\def\csname i:6\endcsname{6}
\expandafter\def\csname i:7\endcsname{7}
\expandafter\def\csname i:8\endcsname{8}
\expandafter\def\csname i:9\endcsname{9}
\def\i:A{10}  \let\i:a|=\i:A
\def\i:B{11}  \let\i:b|=\i:B
\def\i:C{12}  \let\i:c|=\i:C
\def\i:D{13}  \let\i:d|=\i:D
\def\i:E{14}  \let\i:e|=\i:E
\def\i:F{15}  \let\i:f|=\i:F

\def\Hex:Frac#1#2{\tmp:cnt|=\csname i:#1\endcsname
   \multiply\tmp:cnt by 16
   \advance\tmp:cnt\csname i:#2\endcsname
   \multiply\tmp:cnt by 100
   \divide\tmp:cnt by 255 
   \edef\:temp{\ifnum \tmp:cnt>99 1.0\else 0.\the\tmp:cnt\fi}}

\def\df:clr#1#2#3#4#5#6#7{\Hex:Frac#2#3\let#1|=\:temp
   \Hex:Frac#4#5\edef#1{ #1 \:temp}%
   \Hex:Frac#6#7\edef#1{#1 \:temp\space setrgbcolor }}

\def\DefPsColor#1#2{\df:clr#1#2}
|<delay postscript|>%
>>>

\<delay postscript\><<<
\let\PsCode|=\relax
>>>

\<special\><<<
\ifx \PsCodeSpecial\:UnDef \def\PsCodeSpecial{ps:}\fi
>>>

% \SubSection{Karked Locations}

\<postscript\><<<
\def\MarkPsLoc(#1){%
  \PsCode{ currentpoint
   /Psy#1  exch  def 
   /PsX#1  exch  def 
}}
\def\RecallPsLoc(#1){ PsX#1  Psy#1 }
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Math}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\SubSection{LaTeX-Oriented Commands}

\<tex-sty configure utilities\><<<
|<latex,sty math del|>
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Marginal Notes}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<html sty of TeX4ht\><<<
\def\Margin{\HCode{<table \Hnewline
      align="right"><tr><td \Hnewline>}}
\def\EndMargin{\HCode{</td></tr></table>}}
>>>

Remove the above!!!!!!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Multi-Columns}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\''\HColumns[contribute-TABLE,contribute-TD]{i}'; Given count of
column in \''\HCol'

\<html sty of TeX4ht\><<<
\def\add:col{\Advance:\:cols |by -1 \HAdvance\HCol |by 1\relax
   \ifnum \:cols>0   
      \c:Cols \vsplit0 to \tmp:dim  \d:Cols  \expandafter\add:col 
   \fi}
>>>

\<html sty of TeX4ht\><<<
\NewConfigure{Columns}{4}
\def\c:Cols{\edef\sv:dim{\the\tmp:dim}\c:Columns}
\def\d:Cols{\d:Columns \tmp:dim|=\sv:dim }
\def\ColMag#1{\tmp:dim |= #1\tmp:dim}
>>>

\<html sty of TeX4ht\><<<
\def\Columns#1{%
   \a:Columns
   \HAssign\:cols|=#1  \setbox0=\vbox\bgroup
   \divide\hsize |by #1  }
\def\EndColumns{\egroup   \HAssign\HCol|=0
  \tmp:dim|=\ht0  \advance\tmp:dim |by \dp0  \divide\tmp:dim |by \:cols
  \add:col \c:Cols \box0 \d:Cols \b:Columns}
>>>

\<non-html sty of TeX4ht\><<<
\let\Columns|=\:gobble
\let\EndColumns|=\empty
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Other}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<non-html sty of TeX4ht\><<<
\def\:bigskip{%
 \ifvmode
   \ifdim \lastskip<\bigskipamount 
   \vskip -\lastskip \bigskip \fi
 \else \bigskip\fi}

\def\:medskip{%
 \ifvmode
   \ifdim \lastskip<\medskipamount 
   \vskip -\lastskip \medskip \fi
 \else \medskip\fi}

\def\:smallskip{%
 \ifvmode
   \ifdim \lastskip<\smallskipamount 
   \vskip -\lastskip \smallskip \fi
 \else \smallskip \fi}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{OpenOffice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Writer}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Link[http://www.hj-gym.dk/\string
         ~hj/writer2latex/]{}{}writer2latex\EndLink

\<writer.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% writer.4ht                            |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<writer configs|>
\Hinput{writer}
\endinput
>>>        \AddFile{9}{writer}

\<writer configs\><<<
\let\wl:begin=\begin
\def\begin#1{%
  \wl:env#1style//%
  \wl:begin{#1}}
\def\wl:env#1style#2//{\relax\if!#1!\wl:styleenv#2//\fi}%
\def\wl:styleenv#1style#2//{%
  \expandafter\ifx\csname before:begin style#1\endcsname\relax
     \config:wlenv{style#1}%
     \global\expandafter\let
        \csname before:begin style#1\expandafter\endcsname
        \csname before:begin style#1\endcsname
     \expandafter\append:def\csname style#1\endcsname{\wl:css{style#1}}%
  \fi }
\def\wl:css#1{%
  \expandafter\ifx\csname css:#1\endcsname\relax
     \global\expandafter\let\csname css:#1\endcsname\def
     \config:wlcss{#1}%
  \fi
}
\NewConfigure{WriterEnv}[2]{%
   \def\config:wlenv##1{#1}%
   \def\config:wlcss##1{#2}%
}
\Configure{WriterEnv}{}{}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{mdwtools}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{mdwlist}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<mdwlist.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% mdwlist.4ht                           |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<mdwlist hooks|>
\Hinput{mdwlist}
\endinput
>>>        \AddFile{9}{mdwlist}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{sverb}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<sverb.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% sverb.4ht                             |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<sverb hooks|>
\Hinput{sverb}
\endinput
>>>        \AddFile{9}{sverb}

\<sverb hooks\><<<
\def\sv@demosmp{\par\a:demo \raggedright \vbox\bgroup}
\def\sv@demoemp{\par\unpenalty\unskip \egroup\b:demo}
\NewConfigure{demo}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{syntax}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<syntax.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% syntax.4ht                            |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config syntax|>
\Hinput{syntax}
\endinput
>>>        \AddFile{9}{syntax}

\<config syntax\><<<
\let\o:sb:=_
\def\:temp{\ifmmode \expandafter \pr:sb \else \expandafter \sys:sb \fi }
\HLet\sb\:temp
\AtBeginDocument{\catcode`\_\active}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Part{Latex and TeX}
%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Chapter{Symbol Decorations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Non-Math}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<text symbolsNO\><<<
\def\AA{{\Protect\Tivht@AA}}
\def\aa{{\Protect\Tivht@aa}}
\def\Tivht@AA{%
   \ifx \EndPicture\:UnDef  \a:AA\else
     \leavevmode\setbox0\hbox{h}\dimen@\ht0\advance\dimen@-1ex%
     \rlap{\raise.67\dimen@\hbox{\char'27}}A\fi}
\def\Tivht@aa{%
   \ifx \EndPicture\:UnDef  \HChar{229}\else \accent23a\fi }
\NewConfigure{AA}{1}
\Configure{AA}{\HChar{197}}
>>>

A previous definition \Verb+\def\aa{{\Protect\:aa}}+ was problematic because
\Verb+\:aa+ got into an aux file which got loaded with `:' in catcode 13.

\<text symbolsNO\><<<
\def\vdots{\Picture+{ \a:@Picture{vdots}}
   \vbox{\baselineskip4\p@ \lineskiplimit\z@
    \kern6\p@\hbox{.}\hbox{.}\hbox{.}}\EndPicture}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Math symbols}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% 

\<latex math symbols\><<<
\def\ProtectedMathSymbol#1#2{%
   \def\:temp{{\math:sym#1{#2}}}%
   \expandafter\HLet\csname #2 \endcsname\:temp
   \NewConfigure{#2}{1}\Configure{#2}{\csname o:#2 :\endcsname}}
>>>

\<latex math symbols\><<<
\def\EncMathSymbol#1#2#3{%
   \NewConfigure{#2}{1}%
   \edef\:tempc{#3\expandafter\string\csname #2\endcsname}%
   \def\:temp{{\math:sym#1{#2}}}%
   \expandafter\HLet  \csname \:tempc\endcsname\:temp
   \edef\:temp{\noexpand\Configure{#2}{\expandafter\noexpand
       \csname \:tempc\endcsname}}\:temp
}
\EncMathSymbol\mathop{l}{OT1}
\EncMathSymbol\mathop{L}{OT1}
>>>

\<latex math symbols\><<<
\MathSymbol\mathop{mathellipsis}  
\MathSymbol\mathord{hbar}  
>>>

\<latex ltoutenc\><<<
\def\:tempc{\a:textellipsis}
\expandafter\HLet\csname ?\string\textellipsis\endcsname\:tempc
\NewConfigure{textellipsis}{1}
\edef\:temp{%
  \noexpand\Configure{textellipsis}{\expandafter\noexpand
                                    \csname o:?\string\textellipsis:\endcsname}}
\:temp
>>>

\<plain math symbols\><<<
\MathSymbol\mathop{l}
\MathSymbol\mathop{longleftarrow}
\MathSymbol\mathop{longrightarrow}
\MathSymbol\mathop{L}
\MathSymbol\mathrel{buildrelover}
>>>

% \def\ifno:mathchar#1#2{%
%    \def\:tempb##1"##2///{##1}%
%    \edef\:tempa{\expandafter\:tempb\meaning#1"///}%
%    \edef\:tempc{\string\mathchar}%
%    \ifx \:tempa\:tempc \else #2\fi
%}
%\ifno:mathchar

\<fontmath + plain classes\><<<
\MathSymbol\mathop{angle}
\MathSymbol\mathop{cong}
\MathSymbol\mathop{vdots}
\MathSymbol\mathop{ldots}
\MathSymbol\mathrel{Longleftrightarrow}
\MathSymbol\mathrel{Longrightarrow}
\MathSymbol\mathrel{Longleftarrow}
\MathSymbol\mathrel{bowtie}
\MathSymbol\mathrel{cdots}
\MathSymbol\mathrel{ddots}
\MathSymbol\mathrel{doteq}
\MathSymbol\mathrel{hookleftarrow}
\MathSymbol\mathrel{hookrightarrow}
\MathSymbol\mathrel{leftrightharpoons}
\MathSymbol\mathrel{longleftrightarrow}
\MathSymbol\mathrel{longmapsto}
\MathSymbol\mathrel{mapsto}
\MathSymbol+\mathrel{mid}
\MathSymbol\mathrel{models}
\MathSymbol\mathrel{neq} \let\ne|=\neq   \def\c:ne:{\Configure{neq}}
\MathSymbol\mathrel{notin}
\MathSymbol\mathrel{rightleftharpoons}
>>>

\<config fontmath.ltx shared\><<<
\ProtectedMathSymbol\mathop{longleftarrow}
\ProtectedMathSymbol\mathop{longrightarrow}
>>>

\<amsmath.sty and amstex.sty\><<<
\MathSymbol\mathop{dotsc}
\MathSymbol\mathop{dotso}
\MathSymbol\mathrel{longleftarrow}
\MathSymbol\mathrel{longrightarrow}
>>>

\<amsmath.sty\><<<
\MathSymbol\mathrel{@cdots}
\MathSymbol\mathop{doteq}  
   \def\n:doteq:{\expandafter\:same \math:sym\mathop{doteq}\nolimits}
\HLet\dotsb@=\@cdots  
\HLet\intdots@=\@cdots
\HRestore\cdots
>>>

% \HLet\dotsb=\cdots     
% \HLet\dotsm=\dotsb

\<amsmath.sty\><<<
\MathSymbol\mathop{iint}  
   \def\n:iint:{\expandafter\:same \math:sym\mathop{iint}\nolimits}
\MathSymbol\mathop{iiint}  
   \def\n:iiint:{\expandafter\:same \math:sym\mathop{iiint}\nolimits}
\MathSymbol\mathop{iiiint}  
   \def\n:iiiint:{\expandafter\:same \math:sym\mathop{iiiint}\nolimits}
\MathSymbol\mathop{idotsint}  
   \def\n:idotsint:{\expandafter\:same \math:sym\mathop{idotsint}\nolimits}
>>>

\<config fontmath\><<<
\MathSymbol\mathop{int}  
   \def\n:int:{\expandafter\:same \math:sym\mathop{int}\nolimits}
>>>

Where
\`'\def\rightleftharpoons{\m:CondPicture{\mathrel{\mathpalette\rlh@{}}}{}}'
came in for the first time. It is in amstex but not in latex or tex.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{MkHalign-Based Symbols}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

We had a definition like \`'\def\overbrace#1{{\m:CondPicture{%
      \mathop{\vbox{\m@th\ialign{##\crcr\noalign{\kern3\p@}
      \downbracefill\crcr\noalign{\kern3\p@\nointerlineskip}
      $\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}{}}}'
which should have something like
\`'' but it
seems like there is no need for it anymore.
Similarly for \`'\underbrace', \''\overrightarrow', 
\''\overleftarrow', and \''\angle'.

\<over/under fontmath\><<<
\def\:tempc#1{\a:overrightarrow
   \o:overrightarrow:{#1}\b:overrightarrow}
\HLet\overrightarrow|=\:tempc
\NewConfigure{overrightarrow}{2}
\def\:tempc#1{\a:overleftarrow
   \o:overleftarrow:{#1}\b:overleftarrow}
\HLet\overleftarrow|=\:tempc
\NewConfigure{overleftarrow}{2}
>>>

\<plain math\><<<
\def\:tempc#1{\a:overrightarrow
   \o:overrightarrow:{#1}\b:overrightarrow}
\HLet\overrightarrow|=\:tempc
\NewConfigure{overrightarrow}{2}
\def\:tempc#1{\a:overleftarrow
   \o:overleftarrow:{#1}\b:overleftarrow}
\HLet\overleftarrow|=\:tempc
\NewConfigure{overleftarrow}{2}
>>>

\<amsmath.sty\><<<
\def\:tempc#1{\a:underrightarrow
   \o:underrightarrow:{#1}\b:underrightarrow}
\HLet\underrightarrow|=\:tempc
\NewConfigure{underrightarrow}{2}
\def\:tempc#1{\a:underleftarrow
   \o:underleftarrow:{#1}\b:underleftarrow}
\HLet\underleftarrow|=\:tempc
\NewConfigure{underleftarrow}{2}
>>>

\<amsmath.sty\><<<
\def\:tempc#1{\a:overleftrightarrow
   \o:overleftrightarrow:{#1}\b:overleftrightarrow}
\HLet\overleftrightarrow|=\:tempc
\NewConfigure{overleftrightarrow}{2}
\def\:tempc#1{\a:underleftrightarrow
   \o:underleftrightarrow:{#1}\b:underleftrightarrow}
\HLet\underleftrightarrow|=\:tempc
\NewConfigure{underleftrightarrow}{2}
>>>

\<plain, fontmath, amstex\><<<
\def\:temp#1{\a:overbrace \mathop{\hbox{\b:overbrace
   $\o:overbrace:{#1}$\c:overbrace}}\limits}
\HLet\overbrace|=\:temp
\NewConfigure{overbrace}{3}
\def\:temp#1{\a:underbrace \mathop{\hbox{$\b:underbrace
   \o:underbrace:{#1}\c:underbrace$}}\limits}
\HLet\underbrace|=\:temp
\NewConfigure{underbrace}{3}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{New Accents}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

For non-pictorial accents \''\c', \''\b', and \''\d', we want just the
accented part.  The default definitions provide an alternative options.
In the last two cases, the  \''\accent' command uses faked access
number.  

\<revised accent definitions\><<<
\def\:temp#1{{\accent24 #1}}
\let\c:accent|=\c   \HLet\c:accent|=\:temp   \let\c|=\c:accent
>>>

\<revised latex accent definitions\><<<
\def\:temp#1{{\edef\next{\the\font}\rmfamily\accent0 \next#1}}
\let\b:accent|=\b   \HLet\b:accent|=\:temp   \let\b|=\b:accent
\def\:temp#1{{\edef\next{\the\font}\rmfamily\accent1 \next#1}}
\let\d:accent|=\d   \HLet\d:accent|=\:temp   \let\d|=\d:accent
>>>

\<revised plain accent definitions\><<<
\def\:temp#1{{\edef\next{\the\font}\rm\accent0 \next#1}}
\let\b:accent|=\b   \HLet\b:accent|=\:temp   \let\b|=\b:accent
\def\:temp#1{{\edef\next{\the\font}\rm\accent1 \next#1}}
\let\d:accent|=\d   \HLet\d:accent|=\:temp   \let\d|=\d:accent
>>>

The last two faked fonts, similar to the definition of \''\t' in
plain.tex. There, however, we have \''\the\textfont1' instead of
\''\rm' and \''\rmfamily', which doesn't work in LaTeX for some
reasons (what are the reasons?).

\Section{Accents through `accents' Configurations}

When \''\hat{foo}' is encountered, a search is made for an \`'??-i'
that equals  \`'foo' in the given accent table. If found, do-found is
executed; otherwise, do-not-found is executed. The do-found can reference the
??-out through \`'#1'. The do-not-found can reference the 
old definition of \`'\hat' through \`'#1' and the foo through \`'#2'.

\<accents\><<<
\NewConfigure{accents}[2]{\def\a:accents##1##2{#1}%
   \def\b:accents##1##2##3{#2}}
>>>

\List{*}
\item \`'\HChar{...}' sends forward a character to the next printable
char (can be refined to specific characters).  That is, it uses the
character of the command, with the decoration of the character that
follows.
\item \`'\special{t4ht@+...}' sends forward a string to the next printable
chr
\EndList

The space in the definition of \`'\check:sc' is to deal with caese
like \`'cmcsc10 at 14.4pt'.

\<temp patch for accents on small capsPRE-CSS\><<<
\def\check:sc#1 #2|<par del|>{\Check:sc#1}
\def\Check:sc#1#2#3#4#5#6#7#8#9*{%
  \gdef\Check:sc##1##2##3##4##5##6##7##8##9*{%
   {\if #1##1\if #2##2\if ##3#3\if ##4#4\if ##5#5\if ##6#6\if ##7#7%
    \if ##8#8\aftergroup\sc:reg:ac\else \sc:digits#8##8|<par del|>\fi
    \else \sc:digits#7##7#8##8|<par del|>\fi 
    \else \sc:digits#6##6#7##7#8##8|<par del|>\fi
    \fi\fi\fi\fi\fi}}}
{\scshape\expandafter\expandafter\expandafter\check:sc
     \expandafter\fontname\expandafter\font \space |<par del|>xxxxxxxx*}
\def\get:sc{\expandafter\expandafter\expandafter\check:sc
     \expandafter\fontname\expandafter\font \space |<par del|>xxxxxxxx*}
\def\sc:reg:ac#1#2#3{\nxt:srch
   {#3}aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVxXyYzZ\i I\j J%
   {}{}//{#1}{#2}}
\def\nxt:srch#1#2{\if #1#2\expandafter\:found
   \else\expandafter\not:found\fi{#1}}
\def\:found#1#2#3//#4#5{\a:textscaccent#4{#5}{#2}\b:textscaccent}
\def\not:found#1#2#3{\if !#3!\expandafter\endnot:found
  \else\expandafter\nxt:srch\fi{#1}{#3}}
\def\endnot:found#1#2//#3#4{#3{#4}{#1}}
|<sc digits|>
\let\acp:csv=\acp:c
\def\acp:c#1#2{\get:sc\acp:csv{#1}{#2}}
\NewConfigure{textscaccent}{2}
>>>

The checking for digits is needed for cases like \`'eccc1000' vesrus
\`'eccc1200'. Eg.g,

\Verbatim
\documentclass{article}
  \usepackage[T1]{fontenc}
\begin{document}
  \textsc{Po\'e}  \Large \textsc{Po\'e}
\end{document}
\EndVerbatim

\<sc digits\><<<
\def\sc:digits#1#2|<par del|>{%
   \sc:dig{0}{#1}{#2}%
   \sc:dig{1}{#1}{#2}%
   \sc:dig{2}{#1}{#2}%
   \sc:dig{3}{#1}{#2}%
   \sc:dig{4}{#1}{#2}%
   \sc:dig{5}{#1}{#2}%
   \sc:dig{6}{#1}{#2}%
   \sc:dig{7}{#1}{#2}%
   \sc:dig{8}{#1}{#2}%
   \sc:dig{9}{#1}{#2}}
\def\sc:dig#1#2#3{%
   \if #1#2\if !#3!\aftergroup\sc:reg:ac \expandafter\no:sc
           \else                     \expandafter\sc:digits\fi
           #3|<par del|>%
   \fi }
\def\no:sc#1|<par del|>{}
>>>

The second operands must be a single parameter macro.  The previous to
the last field must be empty, and the last one is not used.  

The following put characters over each other and indirectly takes care
of \''\b', \''\d', and \`'\ooalign'.

\<plain,ltplain obeylines,oalign\><<<
\def\:temp#1{\leavevmode\a:oalign\o:oalign:{#1}\b:oalign}
\HLet\oalign|=\:temp
\NewConfigure{oalign}{2}
>>>

\Section{Math Classes  to Symbols}

\SubSection{Type 5: Math Close}

\SubSection{Type 1: Op}

Can come in characters
\`'\mathchardef\coprod="1360
\mathchardef\bigvee="1357
\mathchardef\bigwedge="1356
\mathchardef\biguplus="1355
\mathchardef\bigcap="1354
\mathchardef\bigcup="1353
\mathchardef\intop="1352 \def\int{\intop\nolimits}
\mathchardef\prod="1351
\mathchardef\sum="1350
\mathchardef\bigotimes="134E
\mathchardef\bigoplus="134C
\mathchardef\bigodot="134A
\mathchardef\ointop="1348 \def\oint{\ointop\nolimits}
\mathchardef\bigsqcup="1346
\mathchardef\smallint="1273'
or as functions   \''\mathop{\rm log}',....

In plain.tex, the \''\limits' and \''\nolimits' are used only after
\''\mathop'.
Without the following we get a complain from \`'$\arctan (2)$'
about \''\nolimits' not following the operator immediately
in \`'fonts' mode. This is so because the definition
\`'\arctan ->\mathop {\rm arctan}\nolimits ' gets output
of code from \''\rm'.

\<html math and non-math symbols???\><<<
\def\:temp{\nopic:gobble\o:nolimits:}
\HLet\nolimits|=\:temp
\def\:temp{\nopic:gobble\o:limits:}
\HLet\limits|=\:temp
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Other}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Type 6 is for punctuation (\''\mathpunc', in LaTeX), and type 7 is
``variable ord''.

\`'latex.ltx:\def\pmod#1{\allowbreak\mkern18mu({\operator@font mod}\,\,#1)}       ' ???

%%%%%%%%%%%%%
\Section{Soul}
%%%%%%%%%%%%%

\<soul.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% soul.4ht                              |version %
% Copyright (C) |CopyYear.2005.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<soul hooks|>
\Hinput{soul}
\endinput
>>>        \AddFile{9}{soul}

\<soul hooks\><<<
\expandafter\long\expandafter\def\csname textcaps \endcsname#1{\a:textcaps 
   #1\b:textcaps}
\expandafter\long\expandafter\def\csname texthl \endcsname#1{\a:texthl
   \SOUL@hlcolor{#1}\b:texthl}
\expandafter\long\expandafter\def\csname textso \endcsname#1{\a:textso 
   #1\b:textso}
\expandafter\long\expandafter\def\csname textst \endcsname#1{\a:textst 
   \SOUL@stcolor{#1}\b:textst}
\expandafter\long\expandafter\def\csname textul \endcsname#1{\a:textul 
   \SOUL@ulcolor{#1}\b:textul}
\NewConfigure{textcaps}{2}
\NewConfigure{texthl}{2}
\NewConfigure{textso}{2}
\NewConfigure{textst}{2}
\NewConfigure{textul}{2}
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{Lua-ul}
%%%%%%%%%%%%%%%%%%%%%

\<lua-ul.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% lua-ul.4ht (|version), generated from |jobname.tex
% Copyright 2024 TeX Users Group
|<TeX4ht license text|>
|<lua-ul getxcolor|>
\ExplSyntaxOn
|<lua-ul hooks|>
\ExplSyntaxOff
\Hinput{lua-ul}
\endinput
>>>        \AddFile{9}{lua-ul}

If Xcolor is not loaded explicitly in the document, the \Verb+\get:xcolorcss+ command 
is not available. We want to be able to save colors of underlines etc, so we need 
to provide a variant that will work regardless of Xcolor\dots

\<lua-ul getxcolor\><<<
\def\lua:ul:get:xcolorcss#1#2{%
   \expandafter\extractcolorspec\expandafter{#1}{\tsf:color}%
   \expandafter\convertcolorspec\tsf:color{HTML}\tsf:color%
   \edef#2{\#\tsf:color}%
}
>>>

\<lua-ul hooks\><<<

\NewConfigure{highLight}{2}
\NewDocumentCommand \:highLight {O{\l__luaul_highlight_color_tl} +m} {
  \group_begin:
  \lua:ul:get:xcolorcss{#1}\:highLightColor%
  \a:highLight#2\b:highLight%
  \group_end:
}

\HLet\highLight\:highLight

\NewConfigure{strikeThrough}{2}
\NewDocumentCommand \:strikeThrough {o +m} {
    \group_begin:
    \IfValueTF {#1} {
      \lua:ul:get:xcolorcss{#1}\:strikeThroughColor%
    }{\def\:strikeThroughColor{inherit}}
    \a:strikeThrough#2\b:strikeThrough
    \group_end:
  }

\HLet\strikeThrough\:strikeThrough

\NewConfigure{underLine}{2}
\NewDocumentCommand \:underLine {o +m} {
  \group_begin:
  \IfValueTF {#1} {
    \__luaul_parse_generic_keys:n {
      #1
    }
  }{}
  \bool_if:NTF \l__luaul_color_set_bool {
    % the \l__luaul_current_color_tl contains color in a format suitable for \convertcolorspec, 
    % so we cannot use \lua:ul:get:xcolorcss here
    \expandafter\convertcolorspec\l__luaul_current_color_tl{HTML}\:tempa
    \edef\:underLineColor{\#\:tempa}%
  }{\def\:underLineColor{inherit}}
  \a:underLine#2\b:underLine
  \group_end:
}

\HLet\underLine\:underLine


>>>

Lua-ul can emulate commands defined by Soul, in that case we need to use our
redefinitions of Lua-ul commands.

\<lua-ul hooks\><<<
\bool_if:NT \l__luaul_soulnames_bool {
    \cs_set_eq:NN \textul \underLine     \cs_set_eq:NN \ul \textul
    \cs_set_eq:NN \textst \strikeThrough \cs_set_eq:NN \st \textst
    \cs_set_eq:NN \texthl \highLight     \cs_set_eq:NN \hl \texthl
}
>>>



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Underline and Overline}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\''\ovrline' and \''\undeline' are not macros so they
can't be redefined with \''\pend:defI'.

\<plain math\><<<
\def\:temp#1{\relax \ifvmode\leavevmode\fi
   \a:underline\hbox{$#1$}\b:underline}
\HLet\underline|=\:temp
\NewConfigure{underline}{2}
>>>

Some environments call \Verb+\@@underline+ directly, so we want this
macro also to be defined directly. However, this macro always appears
within math mode, so deine also \Verb+\underline+ directly.

\<latex math\><<<
\def\underline#1{%
  \relax
  \ifmmode\o:@@underline:{#1}%
  \else  $\o:@@underline:{\hbox{#1}}\m@th$\relax\fi}
\def\:tempc#1{\relax\ifvmode\leavevmode\fi
   \a:underline \o:@@underline:{#1}\b:underline}
\HLet\@@underline|=\:tempc
\def\:tempc#1{\relax\ifvmode\leavevmode\fi
   \a:underline \o:underline:{#1}\b:underline}
\HLet\underline|=\:tempc
\NewConfigure{underline}{2}
>>>

\<plain,latex math\><<<
\def\:temp#1{\relax\ifvmode\leavevmode\fi
   \a:overline\hbox{$|<empty base for sub/sup|>#1$}\b:overline}
\HLet\overline|=\:temp
\NewConfigure{overline}{2}
>>>

\<empty base for sub/sup\><<<
{\HCode{}}>>>

\Section{MathJax}

\<latex math\><<<
\NewConfigure{MathjaxSource}{1}
\NewConfigure{MathJaxSource}[1]{\Configure{MathjaxSource}{#1}}
>>>

\Section{Space Characters}

We have the definition \`'\def~{\penalty \@M \ }' in TeX,
and in LaTeX it is also defined through \`'\ '.
The relax is to avoid end-of-line for the control character.

\<config latex.ltx shared\><<<
\let\sp:c|=\  |<latex,plain sp|>
\def\:nbsp{\ifx\EndPicture\:UnDef\protect\leavevmode\ht:special{t4ht@+\string&{35}x00A0{59}}\a:HChar\else\leavevmode\nobreak\ \fi} 
\def\:ensp{\protect\leavevmode\ht:special{t4ht@+\string&{35}x2002{59}}\a:HChar} 
\HLet\nobreakspace\:nbsp
>>>

\<config plain shared\><<<
\let\sp:c|=\space |<latex,plain sp|>%
\def\:nbsp{\ifx\EndPicture\:UnDef\leavevmode\ht:special{t4ht@+\string&{35}x00A0{59}}\a:HChar\else\leavevmode\nobreak\ \fi} 
\def\:ensp{\leavevmode\ht:special{t4ht@+\string&{35}x2002{59}}\a:HChar} 
>>>

\<latex,plain sp\><<<
\def\ {\relax\ifx \EndPicture\:UnDef \a:sp
             \else \sp:c\fi}
\NewConfigure{ }[1]{\def\:temp{#1}%
   \ifx \:temp\empty \let\a:sp|=\sp:c\else\def\a:sp{#1}\fi}
\Configure{ }{\:nbsp}
>>>

% \leavevmode\ht:special{t4ht@+\string&nbsp;}x

Had \`'\let\sp:c|=\ \relax', but manual of TeXproject didn't accept
it.

%%%%%%%%%%%
\Part{TeX Formats}
%%%%%%%%%%

%%%%%%%%%%%
\Chapter{Plain}
%%%%%%%%%%

%%%%%%%%%%%%%%%
\Section{Outline}
%%%%%%%%%%%%%%%

\<plain.4ht\><<<
% plain.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.1997. Eitan M. Gurari
|<TeX4ht copywrite|>
|<exit if already loaded|>
|<record ams definitions|>
|<elements for divs|>
|<tex divisions|>
|<fontmath + plain classes|>
|<plain, amsmath, amstex|>
|<elements for lists|>
|<html lists|>
|<html tex divs|>
|<plain vfootnote|>
|<html tex settabs|>
|<html tex halign|>
|<plain,ltplain obeylines,oalign|>
|<html local env|>
|<more html tex|> 
|<html tex env|>
|<html tex floats|>
|<html TeX4ht local env|>
\:CheckOption{new-accents}     \if:Option 
    |<revised accent definitions|>
    |<revised plain accent definitions|>
    |<new accents|>
\else
    |<accents|>
\fi
|<text symbols|>
|<shared plain,eplain|>
|<config plain utilities|>
|<plain,latex utilities|>
|<config plain shared|>
|<config plain-latex shared|>
|<plain,latex bordermatrix|>
|<displaylines|>
|<plain,latex math symbols|>        
|<plain math symbols|>
|<plain math|>
|<plain halign-based math|>
|<plain,latex math|>
|<html plain|> 
|<html plain+|>             |%keep last in html mode|%
\Hinput{plain}
\endinput
>>>        \AddFile{5}{plain}

\<html plain\><<<
\footline={\hfil}   \headline={\hfil}  
>>>

\<eplain config\><<<
\footline={\hfil}   \headline={\hfil}  
|<date utility|>
>>>

\<plain,latex utilities\><<<
|<date utility|>
>>>

\<date utility\><<<
\tmp:cnt|=\time  \divide\tmp:cnt |by 60
\edef\:temp{\the\tmp:cnt}
\multiply\tmp:cnt |by -60 \advance\tmp:cnt |by \time
\edef\:today{\the\year-\ifnum \month<10 0\fi
  \the\month-\ifnum \day<10 0\fi\the\day 
   \space\ifnum \:temp<10 0\fi \:temp 
   :\ifnum \tmp:cnt<10 0\fi\the\tmp:cnt :00}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Tables}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\SubSection{TeX: Eqalign}

\<plain eqalign pattern\><<<
$\displaystyle{#}$&$\displaystyle{{}#}$%
>>>

\<plain halign-based math\><<<
\def\:tempc#1{\tx:halign{eqalign}{#1}}
\HLet\eqalign|=\:tempc
                                 \catcode`\#|=13 \catcode`\!|=6
\def\reg:eqalign!1{\null\vcenter{\m@th
  \Mk:ialign:egroup
  {|<plain eqalign pattern|>}{eqalign}{!1}#{}}}  
                                 \catcode`\#=6 \catcode`\!=12
\NewConfigure{eqalign}{6}
>>>

\<plain halign-based math\><<<
\def\Mk:ialign:egroup#1#2#3#4#5{%
%    \csname a:#2\endcsname
     \ifx \EndPicture\:UnDef        
        |<SaveMkHalignConfig|>#5\RecallTeXcr
        \MkHalign#4{#1}#3\crcr\EndMkHalign
        \RecallMkHalignConfig 
     \else
        \csname o:#2:\endcsname{#3}%
     \fi
%   \csname b:#2\endcsname
}
>>>

Test:
\Verbatim
\csname tex4ht\endcsname

$\eqalign{
1111&2222\cr
}$
\bye
\EndVerbatim

\SubSection{TeX: eqalignno}

\<plain eqalignno pattern\><<<
$\@lign\displaystyle{#}$%
&$\@lign\displaystyle{{}#}$%
&\hbox{$\@lign#$}%
>>>

\<plain halign-based math\><<<
\def\:tempc#1{\tx:halign{eqalignno}{#1}}
\HLet\eqalignno|=\:tempc
                                 \catcode`\#|=13 \catcode`\!|=6
\def\reg:eqalignno!1{\Mk:ialign:egroup
   {|<plain eqalignno pattern|>}{eqalignno}{!1}#{}}
                                 \catcode`\#=6 \catcode`\!=12
\NewConfigure{eqalignno}{6}
\def\:eqalignno:{\Configure{noalign}{}{}}
>>>

\SubSection{TeX: leqalignno}

\<plain halign-based math\><<<
\def\:tempc#1{\tx:halign{leqalignno}{#1}}
\HLet\leqalignno|=\:tempc
                                 \catcode`\#|=13 \catcode`\!|=6
\def\reg:leqalignno!1{\Mk:ialign:egroup
  {|<plain eqalignno pattern|>}{leqalignno}{!1}#{}}
                                 \catcode`\#=6 \catcode`\!=12
\NewConfigure{leqalignno}{6}
>>>

\SubSection{Tabbing}

LaTeX disables: \`'\tabs', \`'\tabsdone', \''settabs', \''\+',
\''\tabset', \''\cleartabs', and \''\settabs'.

No need for \`'\:CheckOption{settabs-} \if:Option \else ....\fi'
because we can use \`'\Configure{settabs}{}{}{}{}{}'.

The following is from plain TeX.

The following is for \`'\outer\def\+{\settabs}'.

\<html tex settabs\><<<
\def\gt:tab{\def\:temp##1.##2//{##1}\tmp:dim|=\m:tab\wd\z@}
|<set a settabs element|>
|<set a settabs row|>
>>>

\<config plain utilities\><<<
\def\E:tabalign#1{\def\e:tabalgn{\ifx \EndPicture\:UnDef #1\fi}}
\def\c:settabs:{\c:def\:tempa{settabs}\futurelet\:temp\:tblgn}
>>>

\<html tex settabs\><<<
\pend:def\settabs{\e:tabalgn}
>>>

The \''\leavevmode' below save from paragraph breaks
between lines.

\`'\Configure{settabs}[dec const]' for table magnified by
the given decimal constant.  
\`'\Configure{settabs}{at-settabs}{at \+}{at \cr}{before elem}{after elem}'
for user-defined configuration.  The \`'at-settabs' is useful for
tables \`'\settabs..\+..\cr\+..\cr...' that are defined within 
dedicated groups.

\<set a settabs element\><<<
\def\t@bb@x{\if@cr\egroup |<last col; no dim|>%
  \else\hss\egroup  |<col dim|>%
      \global\setbox\tabsyet\hbox{\unhbox\tabsyet
      \global\setbox\@ne\lastbox}% 
    \ifvoid\@ne\global\setbox\@ne\hbox to\wd\z@{}%
    \else\setbox\z@\hbox to\wd\@ne{\unhbox\z@}\fi
    \global\setbox\tabsdone\hbox{\box\@ne\unhbox\tabsdone}\fi
  \ifx \EndPicture\:UnDef \c:tabalgn \fi \box\z@ 
  \ifx \EndPicture\:UnDef \d:tabalgn \fi}
>>>

\<col dim\><<<
\edef\TabWidth{\expandafter\:temp\the\tmp:dim//}%
>>>

\<last col; no dim\><<<
\let\TabWidth|=\empty
>>>

\<set a settabs row\><<<
\def\m@ketabbox{\begingroup  
  \global\setbox\tabsyet\copy\tabs
  \global\setbox\tabsdone\null
  \def\cr{\@crtrue\crcr\egroup\egroup
    \ifus@  \ifx \EndPicture\:UnDef \a:tabalgn \fi
        \unvbox\z@\lastbox
        \ifx \EndPicture\:UnDef \b:tabalgn \fi
    \fi\endgroup
    \setbox\tabs\hbox{\unhbox\tabsyet\unhbox\tabsdone}}%
  \setbox\z@\vbox\bgroup\@crfalse  
  |<ialign|>\bgroup&\t@bbox##\t@bb@x\crcr}
>>>

 

\Verbatim
\ifx \us@false\:UnDef
   \def\:tempa{\expandafter\let\csname ifus@\endcsname|=}
   \expandafter\:tempa\csname iftrue\endcsname
\fi
\EndVerbatim

\''\ialign' stands for initialized \''\halign'.

\<ialign\><<<
\everycr{}\tabskip\z@skip\TeXhalign
>>>

\Section{Discrete Structures}

\SubSection{Sections and Proclaims}

\<config plain shared\><<<
\expandafter\let\csname  beginsection\endcsname\relax
\NewSection\beginsection{}{}
\let\begin:section\beginsection
\expand:after{\csname outer\endcsname\def}\csname
     beginsection\endcsname#1\par{\smallskip
  \message{#1}\begin:section{#1}\smallskip\noindent}
>>>

\<config plain shared\><<<
\edef\:temp{\let\noexpand\o:proclaim:|=\expandafter\noexpand
   \csname proclaim\endcsname}\:temp
\expandafter\def\csname proclaim\endcsname#1. #2\par{\medbreak
  \a:proclaim\noindent{\bf#1.\enspace}\b:proclaim  
  {\sl#2\par}\c:proclaim\medskip}
\NewConfigure{proclaim}{3}
>>>

%%%%%%%%%%%%%%%%%%%%%%%
\SubSection{Items}
%%%%%%%%%%%%%%%%%%%%%%

\<plain+ env\><<<
\def\textindent#1{\indent \ifx \EndPicture\:UnDef \expandafter\hbox
   \else\expandafter\llap\fi {{#1\enspace}}\ignorespaces}
>>>

Extra braces for fonts.

% \SubSection{item}

\<plain+ env\><<<
\def\:temp#1{\:ilist \let\:ilist|=\empty  
   \def\EnditemList{\end:ilist \let\EnditemList|=\empty}%
   \a:item {#1}\b:item}
\HLet\item|=\:temp
\long\def\c:item:#1#2#3#4{
   \let\EnditemList|=\empty
   \c:def\:ilist{#1}
   \c:def\end:ilist{#2\c:def\:iilist{#1}}
   \c:def\a:item{#3}
   \c:def\b:item{#4}}
>>>

If the second parameter is not empty, it is up to the user to 
introduce \''\EnditemList'.

\SubSection{itemitem}

\<plain+ itemitem list\><<<
\def\:temp#1{\:iilist \let\:iilist|=\empty  
   \def\EnditemitemList{\end:iilist \let\EnditemitemList|=\empty}%
   \a:iitem {#1}\b:iitem}
\HLet\itemitem|=\:temp
\long\def\c:itemitem:#1#2#3#4{
   \let\EnditemitemList|=\empty
   \c:def\:iilist{#1}%
   \c:def\end:iilist{#2\c:def\:iilist{#1}}
   \c:def\a:iitem{#3}
   \c:def\b:iitem{#4}}
>>>

   

If the second parameter is not empty, it is up to the user to 
introduce \''\EnditemitemList'.

%%%%%%%%%%%%%%%%%%%%%
\SubSection{/Line}
%%%%%%%%%%%%%%%%%%%%%

Why \''\centerline' are defined also for latex and non-sty env,
but \''\line' not.

Check \''\a:leftline' and \''\b:leftline' before making any change in \''\line'.

\<plain+ env\><<<
\pend:def\line{\ifx \EndPicture\:UnDef \hbox{\ht:everypar{}\a:line}\fi}
>>>

The \`'\hbox' on the group is required for preserving vertical modes.

\<config plain utilities\><<<
\NewConfigure{line}{1}
>>>

\SubSection{Centerline, Leftline, Rightline}

The original for the following is
\`'\def\centerline#1{\line{\hss#1\hss}}'. We replace the
\''\line' with \''\hbox', because the earlier produces
html code of itself, and surrounding horizontal space from its
definition as \''\hbox to \hsize'.  Similarly is the case for
\''\leftline' and  \''\rightline'.

\<html tex env\><<<
\pend:defI\centerline{\pic:gobble\cnt:a}
\append:defI\centerline{\pic:gobble\cnt:b}
\pend:defI\leftline{\pic:gobble\lft:a}
\append:defI\leftline{\pic:gobble\lft:b}
\pend:defI\rightline{\pic:gobble\a:rightline}
\append:defI\rightline{\pic:gobble\b:rightline}
>>>

In the \`'sty' mode we have the following configuration. Otherwise,
the configuration is empty.

\<config plain utilities\><<<
\NewConfigure{centerline}[2]{\c:def
   \cnt:a{\a:leftline{#1}}\c:def\cnt:b{\b:leftline{#2}}}
\NewConfigure{leftline}[2]{\c:def
   \lft:a{\a:leftline{#1}}\c:def\lft:b{\b:leftline{#2}}}
\NewConfigure{rightline}[2]{\c:def
   \a:rightline{\a:leftline{#1}}\c:def\b:rightline{\b:leftline{#2}}}
\long\def\a:leftline#1{{\ht:everypar{}#1}\expandafter\hbox\:gobble}
\long\def\b:leftline#1{{\ht:everypar{}#1}}
>>>

\Section{Other}

\<more html tex\><<<
      \let\makeheadline|=\empty
      \let\makefootline|=\empty

>>>

\SubSection{Plain +}

\<html plain+\><<<
\:CheckOption{plain-} \if:Option \else
   \Log:Note{for reduced implementation, 
       use the command line option `plain-'}
   |<plain+ env|> 
   |<plain+ itemitem list|>
\fi
>>>

\SubSection{Narrower}

\<plain+ env\><<<
\pend:def\narrower{\ifx \EndPicture\:UnDef 
    \aftergroup\b:narrower \a:narrower \fi}
>>>

\<config plain utilities\><<<
\NewConfigure{narrower}{2}
>>>

%%%%%%%%%%%%%%%%%%
\Section{manmac}
%%%%%%%%%%%%%%%%%%

\<manmac.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% manmac.4ht                            |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<manmac hooks|>
  |<manmac chapter|>
  |<manmac demo|>
  |<manmac config|>
\Hinput{manmac}
\endinput
>>>

 \AddFile{9}{manmac}

\<manmac config\><<<
\def\specialhat{\ifmmode\def\next{\sp}\else\let\next=\beginxref\fi\next} 
{\catcode`\^=\active \global\let ^=\specialhat }
>>>

\<manmac hooks\><<<
\proofmodefalse

\let\setcornerrules\empty

\let\o:exercise:=\exercise
\let\exercise\:UnDef

\def\exercise{\a:exercise \csname o:exercise:\endcsname\b:exercise}
\NewConfigure{exercise}{2}
\pend:def\copytoblankline{\begingroup\aftergroup\par\:gobble}

\def\checkequals#1#2{}

\append:def\beginlines{\everypar{\strut\HtmlPar}}

\outer\def\begindisplay{\o:obeylines:\startdisplay}
{\catcode`\#=13
 \catcode`\@=6
 \catcode`\^=7
  \o:obeylines:\gdef\startdisplay@1
  {\catcode`\^^M=5@1\bgroup %
   \Configure{MkHalign}%
      {\csname a:manmac-display\endcsname}%
      {\csname b:manmac-display\endcsname}%
      {\csname c:manmac-display\endcsname}%
      {\csname d:manmac-display\endcsname}%
      {\csname e:manmac-display\endcsname}%
      {\csname f:manmac-display\endcsname}%
   \let\par\endgraf %
   \MkHalign#{\indent#\hfil&&\qquad#\hfil}}}
\outer\def\enddisplay{\crcr\EndMkHalign\egroup}
\NewConfigure{manmac-display}{6}

\outer\def\begintt{\a:ttenv
  \bgroup\let\par=\endgraf \ttverbatim \parskip=\z@
  \catcode`\||=0 \rightskip-5pc \ttfinish}
{\catcode`\^=7 
 \catcode`\||=0 ||catcode`||\=\other %
  ||o:obeylines: % end of line is active
  ||gdef||ttfinish#1^^M#2\endtt{#1||vbox{#2}||endgroup||egroup ||b:ttenv}}

\NewConfigure{ttenv}{2}
>>>

\<manmac hooks\><<<
\pend:def\d@nger{\medbreak\a:danger\:gobble}
\append:def\d@nger{\aftergroup\b:danger}
\pend:def\dd@nger{\medbreak\a:ddanger\:gobble}
\append:def\dd@nger{\aftergroup\b:ddanger}
\NewConfigure{danger}{2}
\NewConfigure{ddanger}{2}
>>>

\<manmac chapter\><<<
\def\:tempc#1 #2#3. #4\par{\vfill\break
   \ifodd\pageno \advancepageno\fi
   \let\SV:halign\halign
   \let\halign\TeXhalign
   \let\title:page\def
   \bb:chapter \global\let\bb:chapter=\b:chapter \a:chapter  \c:chapter
       \o:beginchapter:{#1} {#2}{#3}. {#4}\par
   \d:chapter
   \let\halign\SV:halign
}
\HLet\beginchapter\:tempc
>>>

\<manmac chapter\><<<
\expandafter\let\expandafter\:endchapter\csname endchapter\endcsname
\expandafter\def\csname endchapter\endcsname{%
   \let\title:page\:UnDef
   \bb:chapter \global\let\bb:chapter=\empty \csname :endchapter\endcsname
   \everypar{\sl\HtmlPar}}
\pend:def\at:docend{\bb:chapter}
\let\bb:chapter=\empty
\NewConfigure{chapter}{4}
>>>

\<manmac chapter\><<<
\pend:def\titlepage{%
   \ifx \title:page\def \else
      \let\title:page\:UnDef
      \bb:chapter \a:titlepage
      \global\let\bb:chapter=\b:titlepage 
   \fi
}
\NewConfigure{titlepage}{2}
>>>

\<manmac hooks\><<<
\catcode`\!6
\catcode`\#13
\def\:tempc!1!2{% !1=width, !2=text
  \vtop{%
    \Configure{MkHalign}\a:sampleglue\b:sampleglue\c:sampleglue %
                       \d:sampleglue\e:sampleglue\f:sampleglue
    \MkHalign#{\hfil#}!2\cr\EndMkHalign}}
\HLet\sampleglue\:tempc
\catcode`\!12
\catcode`\#6
\NewConfigure{sampleglue}{6}
>>>

\<\><<<
\expandafter\let\expandafter\:beginmathdemo\csname beginmathdemo\endcsname
\expandafter\def\csname beginmathdemo\endcsname{\bgroup 
   \expandafter\everydisplay\expandafter{\expandafter
       \everydisplay\expandafter{\the\everydisplay}}%
   \csname :beginmathdemo\endcsname
}

\expandafter\let\expandafter\:endmathdemo\csname endmathdemo\endcsname
\expandafter\def\csname endmathdemo\endcsname{%
   \csname :endmathdemo\endcsname\egroup}
>>>

\<manmac demo\><<<
\catcode`\#=13
  |<manmac math demo|>
\catcode`\#=6
\expandafter\def\csname endmathdemo\endcsname{\EndMkHalign\egroup}
>>>

\<manmac math demo\><<<
\expandafter\def\csname beginmathdemo\endcsname{\par\bgroup
  \Configure{MkHalign}\a:mathdemo\b:mathdemo\c:mathdemo
                      \d:mathdemo\e:mathdemo\f:mathdemo
  \MkHalign#{#\hfil&$#$\hfil}}
\NewConfigure{mathdemo}{6}
>>>

\<manmac math demo\><<<
\outer\def\begindisplaymathdemo {\par\bgroup
  \Configure{MkHalign}\a:displaymathdemo
                      \b:displaymathdemo
                      \c:displaymathdemo
                      \d:displaymathdemo
                      \e:displaymathdemo
                      \f:displaymathdemo
  \MkHalign#{\indent\hbox to 160pt{#\hfil}&$\displaystyle{#}$\hfil}}
\NewConfigure{displaymathdemo}{6}
>>>

\<manmac math demo\><<<
\outer\def\beginlongmathdemo{\par\bgroup
  \Configure{MkHalign}\a:longmathdemo
                      \b:longmathdemo
                      \c:longmathdemo
                      \d:longmathdemo
                      \e:longmathdemo
                      \f:longmathdemo
  \MkHalign#{\indent\hbox to 210pt{#\hfil}&$#$\hfil}}
\NewConfigure{longmathdemo}{6}
>>>

\<manmac math demo\><<<
\outer\def\beginlongdisplaymathdemo {\par\bgroup
  \Configure{MkHalign}\a:longdisplaymathdemo
                      \b:longdisplaymathdemo
                      \c:longdisplaymathdemo
                      \d:longdisplaymathdemo
                      \e:longdisplaymathdemo
                      \f:longdisplaymathdemo
  \MkHalign#{\indent\hbox to 210pt{#\hfil}&$\displaystyle{#}$\hfil}}
\NewConfigure{longdisplaymathdemo}{6}
>>>

%%%%%%%%%%%%%%%%%%
\Chapter{mex}
%%%%%%%%%%%%%%%%%%

\<mex.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% mex.4ht                               |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{mex}
\endinput
>>>

 \AddFile{8}{mex}

%%%%%%%%%%%%%%%%%%
\Chapter{eplain}
%%%%%%%%%%%%%%%%%%

\<eplain.4ht\><<<
% eplain.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2004. Eitan M. Gurari
|<TeX4ht copywrite|>
  |<shared plain,eplain|>
  |<eplain hooks|>
  |<eplain listing|>
  |<eplain bbl|>
  |<eplain toc|>
  |<eplain index|>
  |<eplain dates|>
  |<eplain vfootnote|>
  |<eplain lists|>
  |<eplain cols|>
  |<eplain config|>
\Hinput{eplain}
\endinput
>>>

 \AddFile{7}{eplain}

\<eplain bbl\><<<
\def\@citedef#1#2{\expandafter\gdef\csname
   \@citelabel{#1}\endcsname{\a:cite\Link{#1}{}#2\EndLink\b:cite}}
\NewConfigure{cite}{2}
\def\biblabelprint#1{%
   \noindent
   \hbox to \biblabelwidth{%
      \biblabelprecontents
      \a:bibitem
         \bgroup
            \def\csname##1##2##3{##2}%
            \edef\:temp{\noexpand\Link{}{#1}}%
         \expandafter\egroup \:temp
      \biblabelcontents{#1}%
         \EndLink
      \b:bibitem
      \biblabelpostcontents
   }%
   \kern\biblabelextraspace
}%
\NewConfigure{bibitem}{2}
>>>

\<eplain bbl\><<<
\def\:tempc{%
   \let\:bblhook\bblhook
   \append:def\bblhook{\expandafter\everypar
                       \expandafter{\the\everypar \HtmlPar}}%
   \a:bibliography \o:@readbblfile: \b:bibliography
   \let\bblhook\:bblhook}
\HLet\@readbblfile=\:tempc
\NewConfigure{bibliography}{2}
>>>

\<eplain hooks\><<<
\pend:def\flushleft{\a:flushleft}
\append:def\flushleft{\pend:def\@eoljustifyaction{\c:flushleft}}
\pend:def\@endflushleft{\b:flushleft}
\NewConfigure{flushleft}{3}
\pend:def\flushright{\a:flushright}
\append:def\flushright{\pend:def\@eoljustifyaction{\c:flushright}}
\pend:def\@endflushright{\b:flushright}
\NewConfigure{flushright}{3}
\pend:def\center{\a:center}
\append:def\center{\pend:def\@eoljustifyaction{\c:center}}
\pend:def\@endcenter{\b:center}
\NewConfigure{center}{3}
>>>

\<eplain cols\><<<
\catcode`\:=12
\def\makecolumns#1/#2: {\par \begingroup
   \@columndepth = #1
   \advance\@columndepth by #2
   \advance\@columndepth by -1
   \divide \@columndepth by #2
   \@linestogoincolumn = \@columndepth
   \@linestogo = #1
   \currentcolumn = 1
   \def\@endcolumnactions{%
      \ifnum \@linestogo<2
         \the\crtok \egroup
         \csname b:makecolumns\endcsname \endgroup \par 
      \else
         \global\advance\@linestogo by -1
         \ifnum\@linestogoincolumn<2
            \global\advance\currentcolumn by 1
            \global\@linestogoincolumn = \@columndepth
            \expandafter\gdef\csname :makecolumn\endcsname{\csname
               c:makecolumns\endcsname
               \expandafter\global\expandafter\let
                  \csname :makecolumn\endcsname\empty}\the\crtok
         \else
            &\global\advance\@linestogoincolumn by -1
         \fi
      \fi
   }%
   \makeactive\^^M
   \letreturn \@endcolumnactions
   \@columnwidth = \hsize
     \advance\@columnwidth by -\parindent
     \divide\@columnwidth by #2
   \penalty\abovecolumnspenalty
   \noindent \csname a:makecolumns\endcsname
   \valign\bgroup
     &\hbox to \@columnwidth{\strut \hsize = \@columnwidth 
           \csname d:makecolumns\endcsname 
           ##\csname e:makecolumns\endcsname
           \csname :makecolumn\endcsname \hfil}\cr
}
\catcode`\:=11
\let\:makecolumn=\empty
\NewConfigure{makecolumns}{5}
>>>

\<eplain cols\><<<
\def\@columns#1{\def\NumColumns{#1}\a:columns\singlecolumn 
   \ifx \@ndcolumns\relax \let\@ndcolumns=\empty \fi
   \append:def\@ndcolumns{\b:columns}}
\NewConfigure{columns}{2}
>>>

\<eplain index\><<<
\pend:defII\@idxwrite{%
  \csname if@\@idxprefix indexfileopened\endcsname \else
    \expandafter\immediate\openout\csname @\@idxprefix indexfile\endcsname =
      \indexfilebasename.\@idxprefix dx
    \expandafter\global\csname @\@idxprefix indexfileopenedtrue\endcsname
  \fi
  \warn:idx{\jobname}\html:addr
  \hbox{\Link-{}{|<haddr prefix|>\last:haddr}\EndLink}{}%
  \edef\:temp{\write\expandafter\noexpand\csname
     @\@idxprefix indexfile\endcsname{\string \beforeentry{\RefFileNumber
     \FileNumber}{|<haddr prefix|>\last:haddr}{}}}\:temp
}
|<theindex warning|>
\ind:defs
>>>

\<eplain hooks\><<<
\def\:tempc#1#2#3{%
   \html:addr
   \o:definexref:{#1}{\Protect
      \Link{xref\last:haddr}{}#2\Protect\EndLink}{#3}%
   \Link{}{xref\last:haddr}\EndLink
}
\HLet\definexref\:tempc
>>>

\<eplain lists\><<<
\NewConfigure{li}{2}
\def\@finli{%
  \a:li 
  \ifnum\itemnumber=1 \else \interitemskip \fi
  \printitem
  \b:li 
  \ifx\@optionalarg\empty \else
    \expandafter\writeitemxref\expandafter{\@optionalarg}%
  \fi
  \advance\itemnumber by 1
  \advance\itemletter by 1
  \advance\itemromannumeral by 1
  \ignorespaces
}
\NewConfigure{numberedlist}{4}
\append:def\numberedlist{\a:numberedlist
  \Configure{li}{\c:numberedlist}{\d:numberedlist}}
\pend:def\endnumberedlist{\b:numberedlist}
\NewConfigure{orderedlist}{4}
\append:def\orderedlist{\a:orderedlist
  \Configure{li}{\c:orderedlist}{\d:orderedlist}}
\pend:def\endorderedlist{\b:orderedlist}
\NewConfigure{unorderedlist}{4}
\append:def\unorderedlist{\a:unorderedlist
  \Configure{li}{\c:unorderedlist}{\d:unorderedlist}}
\pend:def\endunorderedlist{\b:unorderedlist}
>>>

\<eplain listing\><<<
\def\listing#1{\par \begingroup 
   \a:listing
    \@setuplisting  \setuplistinghook
    \input #1 \b:listing
   \endgroup
}%
\append:def\linenumberedlisting{%
   \everypar = {\advance\lineno by 1 \HtmlPar \printlistinglineno}}
\NewConfigure{listing}{2}
>>>

\<eplain toc\><<<
\pend:defI\readcontentsfile{\a:contents}
\append:defI\readcontentsfile{\b:contents}
\NewConfigure{contents}{2}
>>>

\<eplain toc\><<<
\def\tocchapterentry#1#2{\line{\bf 
   \a:tocchapterentry #1\b:tocchapterentry #2\c:tocchapterentry}}%
\def\tocsectionentry#1#2{\line{\sl 
   \a:tocsectionentry #1\b:tocsectionentry #2\c:tocsectionentry}}%
\def\tocsubsectionentry#1#2{\line{\rm 
   \a:tocsubsectionentry #1\b:tocsubsectionentry
                         #2\c:tocsubsectionentry}}%
\NewConfigure{tocchapterentry}{3}
\NewConfigure{tocsectionentry}{3}
\NewConfigure{tocsubsectionentry}{3}
>>>

\<eplain toc\><<<
\HAssign\toc:N=0
\def\:tempc#1#2#3#4{%
  \def\:temp##1{%
    \o:writenumberedcontentsentry:{#1}{#2}%
      {\Link{toc-##1}{}#3\EndLink}{#4}}%
  \expandafter\:temp\expandafter{\toc:N}%
  \Link{}{toc-\toc:N}\EndLink \gHAdvance\toc:N by 1
}
\HLet\writenumberedcontentsentry=\:tempc
>>>

\<eplain dates\><<<
\let\:tempc\monthname
\pend:def\:tempc{\a:monthname}
\append:def\:tempc{\b:monthname}
\HLet\monthname\:tempc
\let\:tempc\fullmonthname
\pend:def\:tempc{\a:monthname}
\append:def\:tempc{\b:monthname}
\HLet\fullmonthname\:tempc
\NewConfigure{monthname}{2}
\let\:tempc\timestring
\pend:def\:tempc{\a:timestring}
\append:def\:tempc{\b:timestring}
\HLet\timestring\:tempc
\NewConfigure{timestring}{2}
\let\:tempc\timestamp
\pend:def\:tempc{\a:timestamp}
\append:def\:tempc{\b:timestamp}
\HLet\timestamp\:tempc
\NewConfigure{timestamp}{2}
\let\:tempc\today
\pend:def\:tempc{\a:today}
\append:def\:tempc{\b:today}
\HLet\today\:tempc
\NewConfigure{today}{2}
>>>

%%%%%%%%%%%%%%%%%%
\Chapter{ConTeXt}
%%%%%%%%%%%%%%%%%%

texexec try  [--pdf];
psc texexec try  ;
mk4ht xhcontext try 

\Link[http://wiki.contextgarden.net/Main\string _Page]{}{}wiki\EndLink{}
(\Link[http://wiki.contextgarden.net/TABLE]{}{}wiki tables\EndLink{})

\Link[http://www.pragma-ade.nl/]{}{}home\EndLink{}
(\Link[http://www.pragma-ade.nl/general/manuals/mp-cb-en.pdf]{}{}manual\EndLink),
\Link[http://www.berenddeboer.net/tex/LaTeX2ConTeXt.pdf]{}{}LaTeX in proper ConTeXt\EndLink,
\Link[http://www.tug.org/ftp/texlive/Contents/live/texmf/doc/context-omega/context-help.html]{}{}fonts\EndLink

\Link[http://dictionaries.travlang.com/DutchEnglish/]{}{}Dutch dictionary\EndLink

\Link[http://dl.contextgarden.net/myway/]{}{}math in context\EndLink{} (see mathalign.tex/.pdf)

\Verbatim
Words need replacement:
> formulenummer 
 > plaatsblok              placefloat 
 > doplaatskopnummer       placeheadnumber 
 > tekst/teskt             text 
 > commando                command 
 > nummercommando          numbercommand 
 > sectie                  section 
 > opelkaar                packed 
 > plaats samengesteldelijst place combinedlist 
 > inhoud                  content 
\EndVerbatim

\<context.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% context.4ht                           |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<context with special chars|>
\catcode`\!=11
\catcode`\?=11
  |<utilities for context|>
  |<context page-txt|>
  |<context page-flt|>
  |<context core-sec|>
  |<context core-job|>
  |<context core-sys|>
  |<context core-spa|>
  |<context core-lst|>
  |<context core-itm|>
  |<context core-des|>
  |<context core-ver|>
  |<context core-flt|>
  |<context core-fig|>
  |<context core-mat|>
  |<context thrd-tab, core-tab|>
  |<context core-tbl|>
  |<context core-reg|>
  |<context core-log|>
  |<context core-ref|>
  |<context core-ps|>
  |<context core-rul|>
  |<context core-ntb|>
  |<context core-mis|>
  |<context core-not|>
  |<context core-buf|>
  |<context hooks|>
  |<context supp-mps|>
\catcode`\!=12
\catcode`\?=12
\Hinput{context}
\endinput
>>>

 \AddFile{7}{context}

\<m-tex4ht.tex\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% m-tex4ht.tex                          |version %
% Copyright (C) |CopyYear.2004.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\input tex4ht.sty
\appendtoks
   \Preamble{\env{opt-arg},,xhtml}\EndPreamble
\to \everystarttext
\endinput
>>>

\<context core-ps \><<<
\def\dostopcolormode{\special {\b:color}} 
\def\dostartrgbcolormode#1#2#3{\special{\a:color{#1}{#2}{#3}}}  
\def\dostartgraymode#1{\special{\a:color{#1}{#1}{#1}}} 
\def\dostopgraymode{\special {\b:color}} 
\def\dostartgraycolormode#1{\special{\a:color{#1}{#1}{#1}}} 
   %%% \def\dostartcmykcolormode#1#2#3#4{\special{t4ht=color cmyk #1 #2 #3 #4}} 
\NewConfigure{color}[2]{\def\a:color##1##2##3{#1}\def\b:color{#2}}
\Configure{color}{}{}

\newif\ifshowcolor \showcolorfalse
\Configure{color} 
   {\ifshowcolor t4ht=<span style="color:rgb(#1,#2,#3)">\fi} 
   {\ifshowcolor t4ht=</span>\fi} 

>>>

\<context core-rul\><<<
\def\:tempc{\dontshowcomposition  
     \a:framed \box\framebox \b:framed
   \egroup  
   \egroup
} 
\HLet\stoplocalframed\:tempc
\NewConfigure{framed}{2}
>>>

\<context core-mis\><<<
% \appendtoks
  \let\o:forgetall:\forgetall
  \append:def\forgetall{\expandafter\everypar\expandafter{\the\everypar
%     \ifnum\textlevel>0 
      \ifx\EndPicture\:Undef \HtmlPar\fi
%     \fi
  }}
% \to \everystarttext

\def\:temp{\everybeforeshipout\bgroup\let\forgetall\o:forgetall: }
\expandafter\:temp\the\everybeforeshipout}
>>>

\<context hooks\><<<
\tmp:cnt\normaltime  \divide\tmp:cnt  60 
\edef\:temp{\the\tmp:cnt} 
\multiply\tmp:cnt  -60 \advance\tmp:cnt  \normaltime 
\edef\:today{\the\normalyear-\ifnum \normalmonth<10 0\fi 
  \the\normalmonth-\ifnum \normalday<10 0\fi\the\normalday 
   \space\ifnum \:temp<10 0\fi \:temp 
   :\ifnum \tmp:cnt<10 0\fi\the\tmp:cnt :00} 
>>>

\<context page-txt\><<<
\headertextcontent={}
\footertextcontent={}
>>>

%%%%%%%%%%%%%
\Section{Buffers}
%%%%%%%%%%%%%

\<context core-buf\><<<
\def\dodoprocessTEXbuffer[#1][#2]{%
   |<add buffer config|>%
   \csname a:##1-buffer\endcsname
   \getvalue{\??bu#1\c!before}% 
   \dobuffer{16}[#2]\readjobfile 
   \getvalue{\??bu#1\c!after}%
   \csname b:#1-buffer\endcsname
} 
\NewConfigure{-buffer}{2}
>>>

\<add buffer config\><<<
\expandafter\ifx \csname c:#1-buffer:\endcsname\relax
   \:warning{adding \string\NewConfigure{#1-buffer}{2}
        to equal \string\Configure{buffer}{...}{...}}%
   \NewConfigure{#1-buffer}{2}%
   \Configure{#1-buffer}{\a:buffer}{\b:buffer}%
\fi 
>>>

\<context core-buf\><<<
\NewConfigure{buffer}{2}
>>>

\Verbatim

ConTeXt has a bug in its caption numbers.  For the code

    \starttext
    \placefigure[here][fig:1]{One}{xx}
    \placefigure[here][fig:2]{Two}{xxx}
    \stoptext

 texexec  file:
                        xx
                                 Figure 1  One
                        xxx
                                 Figure 0  Two
                                        ^
 texexec  --pdf file:                   |___________ wrong
                        xx
                                 Figure 1  One
                        xxx
                                 Figure 2  Two
\EndVerbatim

%%%%%%%%%%%%%
\Section{Footnotes}
%%%%%%%%%%%%%

\<context core-not\><<<
\def\dostartnote% nog gobble als in pagebody
  {\bgroup
   \settrue\processingnote
   \iftypesettinglines \ignorelines \fi
   |<context footnote mark|>%
   \ignorespaces 
   \a:footnote
   \bgroup 
     \penalty\notepenalty
     \forgetall
     \setnotebodyfont
     \redoconvertfont
     \bgroup 
       {\ifx\lastnotenumber\empty \else
          |<context footnote target mark|>%
        \fi 
        |<context footnote id|>}% 
        \aftergroup\dostopnote 
        \let\next} 
>>>

\<context core-not\><<<
\def\dostopnote{%
   \egroup 
   \b:footnote
   \egroup 
   \kern\notesignal\relax}
 
\NewConfigure{footnote}{4} 
\NewConfigure{footnotemark}{2}
>>>

\<context footnote mark\><<<
\begingroup
  \a:footnotemark
   \let\rawreference\:gobbleII
   \ifnotesymbol       \dolastnotesymbol
   \else \unskip\unskip \globallet\lastnotesymbol\dolastnotesymbol
   \fi
   \b:footnotemark
\endgroup
>>>

\<context footnote target mark\><<< 
\c:footnote
\preparefullnumber{\??vn\currentnote}\lastnotenumber\preparednumber          
\doifelse{\noteparameter\c!interaction}\v!no
  {\noteparameter\c!numbercommand
     {\preparednumber\domovednote\v!nextpage\v!previouspage}}%
  {\gotobox{\noteparameter\c!command 
     {\preparednumber\domovednote\v!nextpage\v!previouspage}}%
     [\s!fnt :f:\internalfootreference]}%
\d:footnote
>>>

\<context footnote id\><<<
\doifelse{\noteparameter\c!interaction}\v!no 
  {\ifconditional\pagewisenotes 
     \rawreference\s!fnt{\s!fnt :t:\internalfootreference}{}% 
   \fi}% 
  {\rawreference\s!fnt{\s!fnt :t:\internalfootreference}{}}%
>>>

%%%%%%%%%%%%%%%%%%
\Section{Sectioning}
%%%%%%%%%%%%%%%%%%

\<context core-sys\><<<
\NewConfigure{sectie}{2}
>>>

\<context sec title env\><<<
\edef\cur:Name{\cur:Name -ko}%
\verify:config\cur:Name{sectie}% 
\csname a:\cur:Name\endcsname        
\def\:tempc{\o:@@nostopattributes: \csname b:\cur:Name\endcsname}%
\HLet\@@nostopattributes\:tempc
\def\:tempc{\o:@@dostopattributes: \csname b:\cur:Name\endcsname}%
\HLet\@@dostopattributes\:tempc
>>>

\<context chapter name\><<<
\v!chapter
>>>

\<context section name\><<<
\v!section
>>>

\<context subsection name\><<<
\v!subsection
>>>

\<context subsubsection name\><<<
\v!subsubsection
>>>

\<context subsubsubsection name\><<<
\v!subsubsubsection
>>>

\<context subsubsubsubsection name\><<<
\v!subsubsubsubsection
>>>

\<context chapter name pre 2005\><<<
\v!hoofdstuk 
>>>

\<context section name pre 2005\><<<
\v!paragraaf 
>>>

\<context subsection name pre 2005\><<<
\v!sub \v!paragraaf 
>>>

\<context subsubsection name pre 2005\><<<
\v!sub \v!sub \v!paragraaf
>>>

\<context subsubsubsection name pre 2005\><<<
\v!sub \v!sub \v!sub \v!paragraaf
>>>

\<context subsubsubsubsection name pre 2005\><<<
\v!sub \v!sub \v!sub \v!sub \v!paragraaf 
>>>

\<context core-sec\><<<
\let\:doplaatskopnummertekst=\doplaatskopnummertekst
\def\doplaatskopnummertekst#1#2#3#4#5{%
   \expandafter\ifx \csname teskt:#1\endcsname\relax
      \plaatskop:warning{#1}%
   \else
      |<gobble context sectioning head|>%
   \fi
   \:doplaatskopnummertekst{#1}{#2}{#3}{#4}{#5}%
   \expandafter\ifx \csname teskt:#1\endcsname\relax \else
      |<recover context sectioning head|>%
   \fi
}
>>>

\<gobble context sectioning head\><<<
\expandafter\let\expandafter\:tekstcommando 
                      \csname \??ko #1\c!tekstcommando\endcsname
\expandafter\let\csname \??ko #1\c!tekstcommando
              \expandafter\endcsname \csname teskt:#1\endcsname  
>>>

\<recover context sectioning head\><<<
\expandafter\let\csname \??ko #1\c!tekstcommando\endcsname
                                                 \:tekstcommando 
>>>

\<gobble context sectioning head\><<<
\expandafter\let\expandafter\:nummercommando 
                      \csname \??ko #1\c!nummercommando\endcsname
\expandafter\let\csname \??ko #1\c!nummercommando\endcsname
                                                 \:gobble
>>>

\<recover context sectioning head\><<<
\expandafter\let\csname \??ko #1\c!nummercommando\endcsname
                                                 \:nummercommando 
>>>

\<gobble context sectioning head\><<<
\ifdisplaysectionhead
    \def\if:displaysectionhead{\displaysectionheadtrue}%
    \displaysectionheadfalse
\else
    \def\if:displaysectionhead{\displaysectionheadfalse}%
\fi
>>>

\<recover context sectioning head\><<<
\if:displaysectionhead
>>>

\<context core-sec\><<<
\def\plaatskop:warning#1{\expandafter 
   \ifx \csname warn:#1\endcsname\relax
      \:warning{Unconfigured `#1'}%
      \expandafter\let\csname warn:#1\endcsname=\def
   \fi }
>>>

\<context core-sec name\><<<
\:tempd{|<context chapter name|>}
\:tempd{|<context section name|>}
\:tempd{|<context subsection name|>}
\:tempd{|<context subsubsection name|>}
\:tempd{|<context subsubsubsection name|>}
\:tempd{|<context subsubsubsubsection name|>}
>>>

\<context core-sec name pre 2005\><<<
\:tempd{|<context chapter name pre 2005|>}
\:tempd{|<context section name pre 2005|>}
\:tempd{|<context subsection name pre 2005|>}
\:tempd{|<context subsubsection name pre 2005|>}
\:tempd{|<context subsubsubsection name pre 2005|>}
\:tempd{|<context subsubsubsubsection name pre 2005|>}
>>>

\<context core-sec ????\><<<
\let\:tempb=\part
\Def:Section\part{\finalsectionnumber}{#1}
\let\teskt:part=\part
\let\part=\:tempb
>>>

%%%%%%%%%%%%%
\SubSection{Head Placement}
%%%%%%%%%%%%%

\<context core-sec\><<<
\pend:defI\beginheadplacement{%
   \expandafter\ifx \csname c:##1-head:\endcsname\relax
      \:warning{adding \string\NewConfigure{##1-head}{3}
           to equal \string\Configure{headplacement}{...}{...}{...}}%
      \NewConfigure{##1-head}{3}%
      \Configure{##1-head}%
          {\a:headplacement}{\b:headplacement}{\c:headplacement}%
   \fi
   \csname c:##1-head\endcsname}
\pend:defII\endheadplacement{\csname a:##1-head\endcsname}
\append:defII\endheadplacement{\csname b:#1-head\endcsname}
\NewConfigure{headplacement}{3}
\Configure{headplacement}{}{}{\IgnorePar}
>>>

% \??ko#1\c!numbercommand
% \??ko#1\c!textcommand

\<context core-sec\><<<
\def\:tmp#1{%
  \let\:tempb=#1%
  \Def:Section#1{\finalsectionnumber}{##1}% 
  \expandafter\let
     \csname teskt:\expandafter\:gobble\string #1\endcsname=#1%
  \let#1=\:tempb }
\def\:tempd#1{%
     |<config core-sec|>%
     \edef\:temp{#1}%
     \expandafter\:tmp\csname \:temp\endcsname
}
|<context core-sec name|>
>>>

\<config core-sec\><<<
\NewConfigure{#1-ko}{2} 
\NewConfigure{#1-head}{3}  
\Configure{#1-head} 
   {} 
   {\csname teskt:#1\endcsname{\text:headplacement}} 
   {% 
     \Configure{#1-ko}{}{}% 
     \expandafter\def\csname \??ko #1\c!numbercommand
                             \endcsname{\gdef\deepnummber:headplacement}% 
     \expandafter\def\csname \??ko #1\c!deeptextcommand
                             \endcsname{\gdef\text:headplacement}% 
     \IgnorePar 
   } 
>>>

\<\><<<
\ifx \v!paragraaf\:UnDef 
  |<context core-sec name|>
  |<context core-sec 2005|>
\else
  |<context core-sec name pre 2005|>
\fi
>>>

\<context core-sec 2005 \><<<
\let\o:endheadplacement\endheadplacement
\def\endheadplacement#1#2{%
  \expandafter\ifx \csname teskt:#1\endcsname\relax
      \o:endheadplacement{#1}{#2}%
  \else
     \def\marking[##1]##2{\expandafter\ifx\csname #1\expandafter
                                \endcsname\csname ##1\endcsname##2\fi}%
     \csname teskt:#1\endcsname{#2}%
  \fi
}
>>>

The following is for mark-less (number-less) sectioning commands.

\<context core-sec \><<<
%%%%%% pre 2005
\def\:tempc#1#2#3#4{%
   \ifverhoognummer
     \ifplaatskop
        \ifkopnummer \else 
            \expandafter\ifx
               \csname teskt:\v!sub \v!paragraaf\endcsname\relax 
               \:warning{Sectioning \expandafter\string 
                       \csname \v!sub \v!paragraaf\endcsname ?}%
            \else
               \let\sv:endheadplacement\endheadplacement
               \def\endheadplacement##1##2{%
                  \global\let\endheadplacement\sv:endheadplacement
                  \setbox0=\hbox{}\endheadplacement{#1}{#4}%
                  \def\finalsectionnumber{}%
                  \csname teskt:\v!sub \v!paragraaf\endcsname{#3}%
               }%
   \fi\fi\fi\fi
   \o:doplaatskoptekst:{#1}{#2}{#3}{#4}%
}
\ifx \doplaatskoptekst\:UnDef\else
   \HLet\doplaatskoptekst\:tempc
\fi
>>>

%%%%%%%%%%%%%
\Section{Table of Contents}
%%%%%%%%%%%%%

Requested through \Verb+\completecontent+ and \Verb+\placecontent+.

\<context core-lst\><<<
\let\:doplaatssamengesteldelijst\doplaatssamengesteldelijst
\def\doplaatssamengesteldelijst[#1][#2]{%
   \ifx #1\v!inhoud
      \expand:after{\TableOfContents[|<context default toc entries|>]}%
   \else 
      \expand:after{\:doplaatssamengesteldelijst[#1][#2]}%
   \fi
}             
\NewConfigure{placecontent}[5]{%
   \def\a:tableofcontents{#1}%
   \def\b:tableofcontents{#2}%
   \def\c:tableofcontents{#3}%
   \def\d:tableofcontents{#4}%
   \def\e:tableofcontents{#5}}
\Configure{placecontent}{}{}{}{}{}
>>>

\<context default toc entries\><<<
part,chapter,section,subsection,subsubsection,%
subsubsubsection,subsubsubsubsection%
>>>

\<context core-lst\><<<
\def\dovolledigesamengesteldelijst[#1][#2]{%
   \expandafter\ifx
       \csname a:\expandafter\:gobble\string#1:head\endcsname
       \relax
       \expandafter\let
          \csname a:\expandafter\:gobble\string#1:head\endcsname
          \empty
       \:warning{No configuration for 
                       `#1' (\expandafter\:gobble\string#1) head}%
   \fi
   \csname a:\expandafter\:gobble\string#1:head\endcsname
   \expanded{\systemsuppliedtitle[#1]{\noexpand\headtext{#1}}}% 
   \csname b:\expandafter\:gobble\string#1:head\endcsname
   \doplaatssamengesteldelijst[#1][#2]}
>>>

NOTE: REPLACE   > plaats samengesteldelijst WITH place combinedlist 

\<context core-lst\><<<
\NewConfigure{contenthead}[2]{%
   \def\a:v!inhoud:head{#1}\def\b:v!inhoud:head{#2}}
\Configure{contenthead}{}{}
>>>

NOTE: REPLACE inhoud WITH content

\<context list element\><<<
\edef\cur:Name{\cur:Name -li}%
\verify:config\cur:Name{listelement}%  |%lijstelement|%
\csname a:\cur:Name\endcsname        
\def\:tempc{\o:@@nostopattributes: \csname b:\cur:Name\endcsname}%
\HLet\@@nostopattributes\:tempc
\def\:tempc{\o:@@dostopattributes: \csname b:\cur:Name\endcsname}%
\HLet\@@dostopattributes\:tempc
>>>

\<context core-lst\><<<
\NewConfigure{listelement}{2}
\pend:def\dobeginoflist{\a:dolist}
\append:def\doendoflist{\b:dolist}
\NewConfigure{dolist}{2}
>>>
%%%%%%%%%%%%%
\Section{Index}
%%%%%%%%%%%%%

\<context core-reg\><<<
\def\:tempc[#1]#2#3{%
   \o:doprocesspageregister:[#1]{#2}{#3}%
   \def\:temp{\v!index}\ifx \:temp\currentregister
      \a:index
   \fi
}
\HLet\doprocesspageregister\:tempc
\NewConfigure{index}{1}
>>>

\<context core-reg\><<<
\NewConfigure{index-env}{2}
\ifx \c!voor\:UnDef \else     %%%%%% pre 2005
  \expandafter\pend:def\csname 
      \??id\v!index\c!voor\endcsname{\everypar{\HtmlPar}}
\fi
\ifx \c!na\:UnDef \else     %%%%%% pre 2005
  \expandafter\append:def\csname 
      \??id\v!index\c!na\endcsname{\everypar{\HtmlPar}}
\fi
\ifx \c!commando\:UnDef \else     %%%%%% pre 2005
  \expandafter\pend:defI\csname
      \??id\v!index\c!commando\endcsname{\a:indexchar}
  \expandafter\append:defI\csname \??id\v!index\c!commando\endcsname{\b:indexchar}
\fi
\NewConfigure{indexchar}{2}
>>>

\<context core-reg\><<<
\def\:tempc#1#2#3#4{%
   \def\:temp{#1}\def\:tempa{\s!ind}\ifx \:temp\:tempa
      \a:indexpage\o:gotonextinternal:{#1}{#2}{#3}{#4}%
   \else
      \o:gotonextinternal:{#1}{#2}{#3}{#4}%
   \fi
}
\HLet\gotonextinternal\:tempc
\def\c:indexpage:{\def\a:indexpage##1##2##3##4##5}
>>>

%%%%%%%%%%%%%
\Section{Floats}
%%%%%%%%%%%%%

\<context core-flt\><<<
\def\:tempc[#1]{%
   \expandafter\ifx \csname c:#1:\endcsname\relax
      |<add contex float configuration|>%
   \fi
   \csname a:#1\endcsname
   |<save everyinsidefloat|>%
   \expandafter\everyinsidefloat\expandafter{%
      \the\everyinsidefloat 
      \restore:every \aftergroup\restore:every
      \expandafter \aftergroup\csname b:#1\endcsname
      |<EndP at end of float box|>%
   }%
   \o:dodocomplexplaatsblok:[#1]}
\HLet\dodocomplexplaatsblok=\:tempc
\NewConfigure{plaatsblok}{2}
>>>

NOTE: REPLACE plaatsblok WITH placefloat

\<save everyinsidefloat\><<<
\expandafter\tmp:toks\expandafter{\the\everyinsidefloat}%
\def\restore:every{\expandafter\everyinsidefloat
   \expandafter{\the\tmp:toks}}%
>>>

\<EndP at end of float box\><<<
\everyvbox{\everyvbox{}\bgroup \aftergroup\EndP\aftergroup\egroup}%
\def\:tempc##1##2{%
   \let\dowithnextboxcontent\o:dowithnextboxcontent:
   \dowithnextboxcontent{##1}{\everyvbox{}##2}%
}%
\HLet\dowithnextboxcontent\:tempc
>>>

\<add contex float configuration\><<<
\:warning{adding \string\NewConfigure{#1}{2} initialized to
     \string\Configure{plaatsblok}}%
\NewConfigure{#1}{2}
\global\expandafter\let\csname c:#1:\expandafter\endcsname
                                     \csname c:#1:\endcsname
\expandafter\gdef\csname a:#1\endcsname{\a:plaatsblok}%
\expandafter\gdef\csname b:#1\endcsname{\b:plaatsblok}%
>>>

\<context core-flt\><<<
\def\:tempc#1#2#3#4{%
   \ifvmode    \IgnorePar\fi
   \o:putcompletecaption:{#1}%
       {\a:caption#2\b:caption}%
       {\c:caption#3\d:caption}{#4}}
\HLet\putcompletecaption\:tempc
\NewConfigure{caption}{4}
>>>

%%%%%%%%%%%%%
\Section{Figures}
%%%%%%%%%%%%%

\<context core-fig\><<<
\def\dodoplaceexternalfigure[#1][#2][#3][#4][#5][#6]{%
  \doifsomething{#3}%
     {\bgroup
      \def\textunderscore{_}% brrr, temp hack
      \calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
      \calculateexternalscreenfigure[#1][#2][#3][#4][#5][#6]%
      \a:externalfigure{#3}%
      \egroup}}
\NewConfigure{externalfigure}{1}
>>>

Toc of figures:

\<context core-fig\><<<
\NewConfigure{figure-li}[4]{%
   \expandafter\def\csname a:figure-li\endcsname{%
      #1%
      \def\:tempc####1####2{#2\o:limitatedlistentry:{####1}{####2}#3}%
      \HLet\limitatedlistentry\:tempc
    }%
    \expandafter\def\csname b:figure-li\endcsname{#4}%
}
\Configure{figure-li}{}{}{}{}
\NewConfigure{title-ko}{2} 
>>>

Captions:

\<context core-fig\><<<
\NewConfigure{-@@kjfigure}{2}
>>>

\<context page-flt\><<<
\def\dodocomplexplacefloat[#1][#2][#3]#4%
  {\flushnotes
   \flushsidefloats
   \ifsomefloatwaiting
     \doifinsetelse\v!always{#2}
       {\showmessage\m!floatblocks5\empty}
       {\expanded{\doifcommonelse{#2}{\flushfloatslist}}\doflushfloats
                                                       \donothing}%
   \fi
   \ifmargeblokken
     \doifinset\v!margin{#2}\endgraf
   \fi
   \global\insidefloattrue
   \a:placefloat
   \begingroup
   \ifmargeblokken
     \doifinset\v!margin{#2}{\hsize\@@mbwidth}%
   \fi
   \the\everyinsidefloat
   \let\@@extrafloat\empty
   \presetmorefloatvariables{#2}%
   \aftergroup   \b:placefloat
   \dowithnextboxcontent
     {\setlocalfloathsize
      \getvalue{\??fl#1\c!inner}%
      \fuzzysnappingfalse
      \postponenotes} % new
     {\doifvaluesomething{\??fl#1\c!criterium}
        {\ifdim\wd\nextbox>\getvalue{\??fl#1\c!criterium}\relax
           \edef\forcedfloatmethod{\executeifdefined
                                     {\??fl#1\c!fallback}\v!here}%
         \fi}%
       \xdocompletefloat{#1}{#3}{#1}{#2}{#1}{#4}%
      \doifnotinset\v!text{#2}{\carryoverpar\endgroup}%
      \global\sidefloatdownshift \zeropoint
      \global\sidefloatextrashift\zeropoint
      \ifparfloat
        \doifinset\v!reset{#2}\forgetsidefloats
        \doinhibitblank
      \fi}%     
     \vbox}
\NewConfigure{placefloat}{2}
>>>

%%%%%%%%%%%%%
\Section{Item Groups}
%%%%%%%%%%%%%

\<context core-itm\><<<
\def\:tempc[#1][#2]{\o:redostartitemgroup:[#1][#2]%
   \verify:config{\currentitemgroup-group}{itemgroup}%
   \csname a:\currentitemgroup-group\endcsname}
\HLet\redostartitemgroup=\:tempc
\pend:def\stopitemgroup{%
   \csname b:\currentitemgroup-group\endcsname}
\NewConfigure{itemgroup}{2}
>>>

\<context core-itm\><<<
\pend:def\dolistitem{\HLet\noindent\item:noindent}
\append:def\dolistitem{%   
   \csname b:|<itemize group type|>-item\endcsname}
\def\item:noindent#1\strutdepth{#1\strutdepth
   \let\noindent\o:noindent:
   \verify:config{|<itemize group type|>-item}%
                 {|<itemize type|>-listitem}%
   \csname a:|<itemize group type|>-item\endcsname}%
\NewConfigure{head-listitem}{2}
\NewConfigure{symbol-listitem}{2}
\NewConfigure{other-listitem}{2}
\NewConfigure{itemize-group}{2}
\NewConfigure{itemize-other-item}{2}
>>>

\<itemize type\><<<
\ifconditional\headlistitem
  \ifconditional\symbollistitem
    symbol%
  \else
    head%
  \fi
\else
  \ifconditional\symbollistitem
    symbol%
  \else
    other%
  \fi
\fi
>>>

\<\><<<
\ifconditional\headlistitem     head\else
\ifconditional\symbollistitem symbol\else
              other\fi\fi
>>>

\<itemize group type\><<<
\currentitemgroup -|<itemize type|>%
>>>

%%%%%%%%%%%%%
\Section{Verbatim}
%%%%%%%%%%%%%

\<context core-ver\><<<
\pend:defI\dostarttyping{\a:typing}
\append:defI\initializetyping{%
   \aftergroup\b:typing
   \def\obeyedspace {\d:typing}%
   \def\obeyedline{}%
   \Configure{HtmlPar}{\c:typing}{\c:typing}{}{}%
}
\NewConfigure{typing}{4}
>>>

The configurations fail to recognize empty lines. Why??

\Verbatim
\def\obeyedline{\HCode{<br />}}   
\def\obeyedspace{\HCode{\string&}\HChar{-35}\HCode{x00A0;}}
\EndVerbatim

\<context core-ver\><<<
\let\o:dodotypefile:=\dodotypefile
\def\dodotypefile{\a:typing \o:dodotypefile:}
>>>

\<\><<<
\let\o:dodotypefile:=\dodotypefile 
\def\dodotypefile[#1]{% 
   \expandafter\ifx\csname c:\??tp#1:\endcsname\relax 
      \NewConfigure{\??tp#1}{4}% 
      \Configure{\??tp#1}% 
         {\a:typefile}% 
         {\b:typefile}% 
         {\c:typefile}% 
         {\d:typefile}% 
      \expandafter\pend:def \csname \??tp#1\c!before\endcsname{% 
                              \csname a:\??tp#1\endcsname}% 
      \expandafter\append:def \csname \??tp#1\c!before\endcsname{% 
                              \csname b:\??tp#1\endcsname}% 
      \expandafter\pend:def \csname \??tp#1\c!after\endcsname{% 
                              \csname c:\??tp#1\endcsname}% 
      \expandafter\append:def \csname \??tp#1\c!after\endcsname{% 
                              \csname d:\??tp#1\endcsname}% 
      \:warning{Introducing implicit configurations for \??tp#1}% 
   \fi 
   \o:dodotypefile:[#1]} 
\NewConfigure{typefile}{4} 

\Configure{typefile} 
   {} 
   {\ifvmode \IgnorePar \fi  \EndP  
    \HCode{<div class="typefile">}% 
    \def\verb:par{\gdef\verb:par{\HCode{<br />}}}} 
   {\ifvmode \IgnorePar \fi  \EndP  \HCode{</div>}} 
   {} 
\Css{div.typefile { white-space: nowrap; }}
>>>

%%%%%%%%%%%%%%%%%%
\Section{Pictures}
%%%%%%%%%%%%%%%%%%

\<context supp-mps\><<<
\long\def\:temp{\begingroup \obeyMPlines \dostartMPcode}
\ifx \startMPcode\:temp
   \pend:def \startMPcode{%
      \let\:temp\begingroup
      \def\begingroup{\let\begingroup\:temp
          \a:MPcode
          \begingroup
          \aftergroup\b:MPcode }%
   }
\fi   
\NewConfigure{MPcode}{2}
>>>

%%%%%%%%%%%%%%%%%%
\Section{Tables: bTABLE}
%%%%%%%%%%%%%%%%%%

\<context core-ntb\><<<
\def\begintbl  
  {\doglobal\newcounter\colTBL  
   \doglobal\newcounter\rowTBL  
   \doglobal\decrement\rowTBL  
   \tabskip\zeropoint  
   \TeXhalign\bgroup  
   \registerparoptions
   \ignorespaces\ifnum\rowTBL=0 \a:bTABLE\else\d:bTABLE\fi 
                \c:bTABLE\e:bTABLE##\f:bTABLE\unskip&& 
   \ignorespaces\e:bTABLE##\f:bTABLE\unskip\cr}  
\def\endtbl  
  {\o:noalign:{\d:bTABLE\b:bTABLE}\egroup}  
\NewConfigure{bTABLE}{6} 
>>>

\<context core-ntb\><<<
\def\begintblrow  
  {\o:noalign:  
     {\doglobal\increment\rowTBL  
      \doglobal\newcounter\colTBL}%  
   \nexttblcol}    
\def\endtblrow{\crcr  
   \o:noalign:  
     {\nointerlineskip  
      \allowbreak  
      \bgroup % protect local vars  
        \@@tblsplitafter  
      \egroup  
}}  
\def\spanTBL#1#2%  
  {\scratchcounter\gettblcol{#1}{#2}\relax  
   \ifnum\scratchcounter>\zerocount  
     \advance\scratchcounter \minusone  
%     \dorecurse\scratchcounter{\appendtoks\spantblcol\to\tbltoks}%  
     \dorecurse\scratchcounter{\appendtoks\skiptblcol\to\tbltoks}%  
                               \appendtoks\nexttblcol\to\tbltoks  
   \fi}  
>>>

\<context core-ntb\><<<
\let\o:settbltxt:\settbltxt
\def\settbltxt{%
   \edef\:tempc{\maximumrow}\HAdvance\:tempc by -1
   \expandafter\edef\csname bTBL\:tempc,\currentcol
        \endcsname{{\csname\@@tbl\c!ny\endcsname}{\csname\@@tbl\c!nx\endcsname}}%
   \o:settbltxt:
}
>>>

%%%%%%%%%%%%%
\Section{Tables}
%%%%%%%%%%%%%

\Verbatim
[c]   \cc:table \c:tableCell ##\d:tableCell \tabskip \LeftTabskip & 
[g-|] \g:tableCell \hfil \startglobalTABLEcolor \vrule \!thWidth 4\!taLTU 
       ##\hfil \s topglobalTABLEcolor 
       \tabskip 8.81241pt plus 1.5fil minus 4.4062pt\relax \d:tabl eCell & 
[a-R] \hfil \a:tableCell \raggedleft ##\b:tableCell \empty & 
[g-|] \g:tableCell \hf il \startglobalTABLEcolor 
      \vrule \!thWidth 4\!taLTU ##\hfil 
      \stopglobalTABLEcol or \relax \h:tableCell & 
[a-R] \hfil \a:tableCell \raggedleft ##\b:tableCell \empty & 
[g-|] \g:tableCell \hfil \startglobalTABLEcolor 
      \vrule \!thWidth 4\!taLTU ##\hfil \s topglobalTABLEcolor \relax 
      \h:tableCell & 
[a-L] \empty \a:tableCell \raggedright ##\f :tableCell \hfil & 
[g-|] \g:tableCell \hfil \startglobalTABLEcolor \vrule 
      \!thWidth 4 \!taLTU ##\hfil \stopglobalTABLEcolor \relax \h:tableCell & 
[a-P] \hfil \a:tableCell  \BeginTableParBox {1.25in}##\EndTableParBox 
      \b:tableCell \hfil & 
[g-|] \g:tableCell \ hfil \startglobalTABLEcolor \vrule 
      \!thWidth 4\!taLTU ##\hfil 
      \stopglobalTABLEc olor \relax 
      \h:tableCell \tabskip \RightTabskip & 
[e]   \e:tableCell ##\f:tableCell \ tabskip 0pt \cr 

a: cell-1
c: cell-2
e: cell-3
g: cell-4
\EndVerbatim

THe c-cells seem to be ignored

\<context with special chars\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\putVBorder{\expandafter\put:VBorder\VBorder</>!*?: }
\def\put:VBorder#1</#2>#3!*?: {\def\:temp{#2}\ifx\:temp\empty
     \HCode{\VBorder}%
     \def\:temp{#1}\ifx\:temp\empty \else\HCode{</colgroup>}\fi
     \HCode{<colgroup><col/></colgroup>}%
  \else  \def\:temp{\put:VBorder#3!*?: }\expandafter\:temp\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>>

currentTABLEcolumn,
maxTABLEcolumn

\<context thrd-tab, core-tab\><<<
\gdef\cc:table{\c:table}

\NewConfigure{tableCell}{5}
\def\showbaselines
  {\testrulewidth\defaulttestrulewidth
   \EveryPar{\HtmlPar\ruledbaseline}}

\NewConfigure{table}{6}
\def\:tempc{%
   \ifnum \!taColumnNumber>0
       \expandafter\!taDataColumnTemplate\expandafter
          {\expandafter\a:tableCell
           \the\!taDataColumnTemplate\x:tableCell}%
\expandafter\let\expandafter\:temp
                     \csname preamble-\the\!taColumnNumber\endcsname
       \expandafter\expandafter\expandafter\!taDataColumnTemplate
       \expandafter\expandafter\expandafter
          {\expandafter\:temp
           \the\!taDataColumnTemplate\x:tableCell}%
\expandafter\let\csname preamble-\the\!taColumnNumber\endcsname\:UnDef
   \fi
   \o:!tfAdjoinPriorColumn:
}
\HLet\!tfAdjoinPriorColumn=\:tempc

\def\!ttDoHalign
  {\baselineskip \zeropoint
   \lineskiplimit\zeropoint
   \lineskip     \zeropoint
   \tabskip      \zeropoint
   \HRestore\noalign
   \a:table
   \TeXhalign \the\!taTableSpread \bgroup
   \span\the\!taPreamble }

\def\finishTABLE
  {\chuckTABLEautorow
   \unskip\dd:table\crcr
   \egroup \b:table \expandafter\:gobble
   \EndTable
   \global\intablefalse
   \egroup}

\def\finishTABLErow
  {\dd:table\crcr
   \TABLEnoalign
     {\nobreak
      \setTABLEaction\TABLEunknown
      \setTABLEerror\TABLEunknown
      \globalletempty\checkTABLEautorow
      \globalletempty\chuckTABLEautorow
      \global\currentTABLEcolumn\zerocount}}

\def\endofTABLEline[#1][#2->#3]#4#5%
  {\ifx#2#3\else
     \writestatus\m!TABLE{\string#2\space changed into \string#3}%
   \fi
   \iftracetables
     \bgroup
     \tttf\space
     \ifnum\TABLEerror=\TABLEunknown
       \ifx#2#3\else\string#2->\fi
     \else
       ->%
     \fi
     \color[#1]{\string#3}%
     \ifsplittables\space\the\TABLEmaxheight/\the\TABLEheight\fi
     \ifx\TABLEgraylineerror\empty
       \space\TABLEgraylinestatus
     \else
       \space\TABLEgraylineerror
     \fi
     \egroup
   \else\ifx\TABLEgraylineerror\empty \else   \fi\fi
   \globalletempty\TABLEgraylinestatus
   \globalletempty\TABLEgraylineerror
   \expandafter\normalTABLElineformat#4#5\dd:table\crcr 
   \TABLEnoalign{\nobreak\global\setTABLEactiontrue}}

\def\!ttDoZero#1{\dd:table\cr}

\def\!ttDoPlus#1#2#3{% #1 eats the +
  \AugmentedTableStrut{#2}{#3}%
  \dd:table\cr}

% DO STANDARD: Insert standard table strut
\def\!ttDoStandard{%
  \StandardTableStrut
  \dd:table\cr}

\def\!tfFinishFormat{%
  \ifnum \TracingFormats>0
    \!thMessage{%
      \space \space r: \the\!taOldRuleColumnTemplate
        \tabskip \the\RightTabskip}%
    \!thMessage{%
      \space *c: ##\tabskip 0pt}
  \fi
  \ifnum \!taColumnNumber<2
    \!thError{%
      \ifnum \!taColumnNumber=0
        No
      \else
        Only 1
      \fi
      "||"}%
      {\!thReadErrorMsg\!tfTooFewBarsA
       ^^J\!thReadErrorMsg\!tfTooFewBarsB
       ^^J\!thReadErrorMsg\!tkFixIt}%
  \fi
  \!thToksEdef\!taPreamble={%
    \noexpand\cc:table \noexpand
    \b:tableCell ####\noexpand\x:tableCell\tabskip\LeftTabskip
    &
    \the\!taPreamble \tabskip\RightTabskip
    &
    \noexpand\c:tableCell ####\noexpand\x:tableCell
                                       \tabskip 0pt \noexpand\cr}%
  \ifnum \TracingFormats>1
    \!thMessage{Preamble=\the\!taPreamble}
  \fi
  \ifnum \TracingFormats>2
    \!thMessage{Row Of Widths="\!tfRowOfWidths"}
  \fi
  \!taBeginFormatfalse % Intercepts "||", tabskips, and "."
  \catcode`\||=13
  \catcode`\"=13
  \!ttDoHalign}

\def\!tfSetVrule
  {\!thToksEdef\!taRuleColumnTemplate=
      {\noexpand\d:tableCell
       \noexpand\hfil
       \noexpand\startglobalTABLEcolor % added
       \noexpand\vrule
       \noexpand\!thWidth
       \ifnum\!tgCode=\plusone
         \ifx\!tgValue\empty
           \the\LineThicknessFactor
         \else
           \!tgValue
         \fi
         \!taLTU
       \else
         \!tgValue
       \fi
       ####%
       \noexpand\hfil
       \noexpand\stopglobalTABLEcolor % added
       \the\!taRuleColumnTemplate
       \relax \noexpand\x:tableCell
   }%
  \!tfAdjoinPriorColumn}

\NewConfigure{VBorder}{4}

\HAssign\NewGroup=0
\HAssign\Next:TableNo=0
\HAssign\ar:cnt=0

\let\:mALIGN\empty \let\hT:D\empty

\pend:defI\ReadFormatKeys{%
   \expandafter\ifx\csname preamble-\the\!taColumnNumber\endcsname\relax
   \expandafter\def\csname preamble-\the\!taColumnNumber\endcsname{%
        \let\:mALIGN\empty \def\hT:D{\csname \string ##1:T:D\endcsname}}%
   \fi
   \:FormatKey
}

\let\:FormatKey=\empty
\NewConfigure{FormatKey}[2]{%
   \def\:temp{#1#2}\ifx \:temp\empty  \let\:FormatKey=\empty
   \else
      \append:def\:FormatKey{\def\:tempa{#1}\ifx \:temp\:tempa
         #2%
      \fi }%
   \fi
}

\Configure{FormatKey}{l}{\add:ar<}
\Configure{FormatKey}{r}{\add:ar>}
\Configure{FormatKey}{c}{\add:ar-}
\Configure{FormatKey}{p}{\d:VBorder}
\Configure{FormatKey}{||}{\b:VBorder}
\pend:def\BeginFormat{\add:ar-}

\let\HAlign=\empty
\def\add:ar#1{\HAdvance\ar:cnt by 1
   \def\ch:class{#1}%
   \c:VBorder
   \edef\HAlign{\HAlign 0 \ar:cnt\space #1 }}

\def\!ttDoZero#1{\dd:table\cr}
\def\!ttDoPlus#1#2#3{% 
  \AugmentedTableStrut{#2}{#3}%
  \dd:table \cr}
\def\!ttDoStandard{%
  \StandardTableStrut
  \dd:table \cr}

\def\normalTABLElongrule{\a:TABLElongrule}
\NewConfigure{TABLElongrule}{1}

\def\simpleTableHL{\a:TableHL}
\NewConfigure{TableHL}{1}
>>>

%%%%%%%%%%%%%
\Section{Tables: Tabulate}
%%%%%%%%%%%%%

\<context core-tbl\><<<
\expandafter\def\csname \e!start\v!tabulate\endcsname{%
    \csname a:\v!tabulate\endcsname \bgroup
         \expandafter\aftergroup\csname b:\v!tabulate\endcsname
           \HRestore\noalign \let\halign\TeXhalign
            \dodoubleempty\donormalstarttabulate}
\NewConfigure{\v!tabulate}{2}
>>>

\<context core-tbl\><<<
\catcode`\||=13
\def\nexttabulate#1||%  
  {\chardef\tabulatealign\@@tabulatealign  
   \chardef\tabulatemodus\zerocount  
   \chardef\tabulatedimen\zerocount  
   \tabulatebefore  \emptytoks  
   \tabulateafter   \emptytoks  
   \tabulatebmath   \emptytoks  
   \tabulateemath   \emptytoks  
   \tabulatefont    \emptytoks  
   \tabulatesettings\emptytoks  
   \global\advance\tabulatecolumns\plusone  
   \letvalue{\@@tabsetups@@\the\tabulatecolumns}\donothing  
   \settabulatepreamble#1\relax\relax % permits i without n  
   \ifcase\tabulatemodus\relax  
     \ifcase\tabulatealign\relax  
       \dodosettabulatepreamble{{<}\empty}       
                               {\tabulate:endcol\tabulatehss}   \or  
       \dodosettabulatepreamble{{<}\empty}       
                               {\tabulate:endcol\tabulatehss}   \or  
       \dodosettabulatepreamble{{>}\tabulatehss} 
                               {\tabulate:endcol\empty}         \or  
       \dodosettabulatepreamble{{-}\tabulatehss} 
                               {\tabulate:endcol\tabulatehss}   \fi  
   \or % fixed width  
     \ifcase\tabulatealign\relax  
       \dodosettabulatepreamble{{-}\bskip}   
                               {\tabulate:endcol\eskip} \or  
       \dodosettabulatepreamble{{<}\bskip\tabulateraggedright } 
                               {\tabulate:endcol\eskip} \or  
       \dodosettabulatepreamble{{>}\bskip\tabulateraggedleft  } 
                               {\tabulate:endcol\eskip} \or  
       \dodosettabulatepreamble{{-}\bskip\tabulateraggedcenter} 
                               {\tabulate:endcol\eskip} \fi  
   \or % auto width  
     \global\advance\nofautotabulate\plusone  
     \ifcase\tabulatealign\relax  
       \dodosettabulatepreamble{{-}\bskip}                      
                                {\tabulate:endcol\eskip} \or  
       \dodosettabulatepreamble{{<}\bskip\tabulateraggedright } 
                               {\tabulate:endcol\eskip} \or  
       \dodosettabulatepreamble{{>}\bskip\tabulateraggedleft  } 
                               {\tabulate:endcol\eskip} \or  
       \dodosettabulatepreamble{{-}\bskip\tabulateraggedcenter} 
                               {\tabulate:endcol\eskip} \fi  
   \or % simple  
     \dodosettabulatepreamble {{-}\xbskip} {\tabulate:endcol\xeskip}  
   \fi  
   \futurelet\next\donexttabulate}  
\catcode`\||=11 
>>>

\<context core-tbl\><<< 
\let\o:dodosettabulatepreamble=\dodosettabulatepreamble 
\def\dodosettabulatepreamble#1#2{%
   \let\tabulate:col=\relax 
   \let\tabulate:endcol=\relax 
   \edef\:temp{\tabulate:col{\the\tabulatecolumns}}% 
   \expandafter\o:dodosettabulatepreamble 
                        \expandafter{\expandafter{\:temp #1}}{#2}% 
   \let\tabulate:col=\tabulate:Col
   \let\tabulate:endcol=\tabulate:Endcol
} 
\def\tabulate:Col#1#2{\def\HCol{#1}%
                      \edef\HRow{\noftabulatelines}\def\HAlign{#2}%
   \ifnum #1=1
      \ifnum \noftabulatelines=0
      \else \csname d:\v!tabulate\endcsname\fi
      \csname c:\v!tabulate\endcsname
   \fi
   \csname e:\v!tabulate\endcsname}
\def\tabulate:Endcol{\csname f:\v!tabulate\endcsname} 
>>>

\<context core-tbl\><<<
\expandafter\def\csname \e!start\v!tabulate\endcsname{%
    \csname a:\v!tabulate\endcsname \bgroup
         \expandafter\aftergroup\csname d:\v!tabulate\endcsname
         \expandafter\aftergroup\csname b:\v!tabulate\endcsname
           \HRestore\noalign \let\halign\TeXhalign
            \dodoubleempty\donormalstarttabulate}
\NewConfigure{\v!tabulate}{6}
>>>

%%%%%%%%%%%%%
\Section{Math}
%%%%%%%%%%%%%

\<context core-mat\><<<
\def\:tempc#1#2#3{\relax\mathematics{{\a:frac{#1{#2}}\b:frac
                                 \over\c:frac{#1{#3}}\d:frac}}}
\HLet\dofrac\:tempc
\NewConfigure{frac}{4}
>>>

\<context core-mat\><<<
\let\normalreqno\eqno
\let\normalleqno\leqno
>>>

\'+(#1,#2)=outer(ref,sub) (#3,#4)=inner(ref,sub)+

\<context core-mat\><<<
\def\:tempc#1#2#3#4{%
   \a:formulenummer
      \o:dododoformulenummer:{#1}{#2}{#3}{#4}%
   \b:formulenummer}
\HLet\dododoformulenummer\:tempc

\NewConfigure{formulenummer}{2}
\Configure{formulenummer}
    {\HCode{<span class="formulenummer">}}
    {\HCode{</span>}}
\Css{.formulenummer {width:20\%; float:right;}}
>>>

\<context core-mat\><<<
\pend:def\startdisplaymath{\a:displaymath}
\append:def\stopdisplaymath{\b:displaymath}
\NewConfigure{displaymath}{2}
\Configure{displaymath}
   {\ifvmode \IgnorePar\fi \EndP \HCode{<div class="displaymath">}}
   {\ifvmode \IgnorePar\fi \EndP \HCode{</div>}}
\Css{div.displaymath {text-align:center;}}
>>>

\<context core-mat\><<<
\NewConfigure{-@@fm}{2}
>>>

\<context core-mat\><<<
\def\:tempc#1%
  {\ifmmode
    \displ@y
    \global\chardef\mathnumberstatus\plusone
     %
     \vcenter\bgroup
     \def\finishalignno{\f:mtable\d:mtable\b:mtable\crcr
                        \egroup\egroup}%
   \else
     \def\finishalignno{\f:mtable\d:mtable\b:mtable\crcr
                        \egroup}%
   \fi
   #1%
   \TeXhalign \@EA \bgroup \the\scratchtoks\crcr}
\HLet\dobothaligneqalignno\:tempc
>>>

\<context core-mat\><<<
\let\:tempc\dointertext
\pend:defI\:tempc{\a:intertext}
\append:defI\:tempc{\b:intertext}
\HLet\dointertext\:tempc
\NewConfigure{intertext}{2}
>>>

\<context core-mat\><<<
\def\:tempc[#1][#2]%
  {%
   \expandafter\ifx \csname a:#1\endcsname\relax
      \Configure{mtable}
         {\a:mathalignment}
         {\b:mathalignment}
         {\c:mathalignment}
         {\d:mathalignment}
         {\e:mathalignment}
         {\f:mathalignment}%
   \else
      \Configure{mtable}
         {\csname a:#1\endcsname}
         {\csname b:#1\endcsname}
         {\csname c:#1\endcsname}
         {\csname d:#1\endcsname}
         {\csname e:#1\endcsname}
         {\csname f:#1\endcsname}%
   \fi
   \pushmacro\doalignNC
   \edef\currentmathalignment{#1}%
   \doifassignmentelse{#2}{\setupmathalignment[#1][#2]}\donothing
   \def\NC{\doalignNC }%
   \global\let\doalignNC\dodoalignNC
   \def\EQ{\HCode{<!--??? 1-->}&=}%
   \def\NR{\f:mtable&\e:mtable \global\let\doalignNC \dodoalignNC
                     \doxxdoubleempty\doalignNR}%
   %
   \def\notag{\def\\{\HCode{<!--??? 2-->}&\crcr}}%
   \doifelse{#2}{*}{\def\\{\HCode{<!--??? 3-->}&\crcr}}%
                   {\def\\{\HCode{<!--??? 4-->}&\doalignNR[+][]\crcr}}%
   %
   \eqaligncolumn\zerocount
   \a:mtable \c:mtable \e:mtable
   \processcommacommand
     [\mathalignmentparameter\c!align]
     {\advance\eqaligncolumn\plusone\doseteqaligncolumn}% takes argument
   %
   \global\eqaligncolumn\plusone
   \numberedeqalign}
\HLet\dostartmathalignment\:tempc
>>>

\<context core-mat\><<<
\def\:tempc{\gdef\doalignNC##1{\f:mtable&\e:mtable ##1}}
\HLet\dodoalignNC\:tempc
\def\:tempc[#1][#2]%
  {\donestedformulanumber{#1}{#2}\f:mtable\d:mtable
                                 \c:mtable\e:mtable\crcr}
\HLet\doalignNR\:tempc
\NewConfigure{mtable}{6}
\NewConfigure{mathalignment}{6}
>>>

%%%%%%%%%%%%%
\Section{Spacing}
%%%%%%%%%%%%%

\<context core-spa\><<<
\append:def\crlf{\ifhmode \a:crlf\fi}
\NewConfigure{crlf}{1}
>>>

\<context core-spa\><<<
\def\:tempc[#1]{%
   \o:complexstartsmaller:[#1]%
   \a:narrower\bgroup\aftergroup\b:narrower\aftergroup\egroup}
\HLet\complexstartsmaller\:tempc
\NewConfigure{narrower}{2}
>>>

\<context core-spa\><<<
\def\:tempc#1#2{%
   \o:doalignline:{|<open doalign|>}{|<close doalign|>}}
\HLet\doalignline\:tempc
\NewConfigure{midaligned}{2}
\NewConfigure{leftaligned}{2}
\NewConfigure{rightaligned}{2}
>>>

\<open doalign\><<<
\ifx #1\hss
  \ifx #2\hss\a:midaligned
  \else      \a:rightaligned
  \fi
\else        \a:leftaligned 
\fi
>>>

\<close doalign\><<<
\ifx #1\hss
  \ifx #2\hss\b:midaligned 
  \else      \b:rightaligned
  \fi
\else        \b:leftaligned
\fi
\hss
>>>

\<context core-spa\><<<
\def\:tempc#1{%
   \def\last:Attributes{#1}%
   \ifx \last:Attributes\empty
   \else
      |<do at start attributes|>%
      \let\last:Attributes=\empty
   \fi
   \o:dostartattributes:{#1}
  }
\HLet\dostartattributes\:tempc
>>>

\<do at start attributes\><<<
\get:curName\??be          \ifx \cur:Name\empty 
   \get:curName\??li       \ifx \cur:Name\empty 
      \get:curName\??ly    \ifx \cur:Name\empty 
         \get:curName\??ko \ifx \cur:Name\empty 
            |<another context env|>%
         \else
            |<context sec title env|>%
         \fi
      \else
         |<context layout env|>%
      \fi
   \else
      |<context list element|>%
   \fi
\else
   |<start stop env|>%
\fi
>>>

\<context core-sys\><<<
\NewConfigure{layout}{2}
>>>

\<context layout env\><<<
\edef\cur:Name{\cur:Name -ly}%
\verify:config\cur:Name{layout}% 
\csname a:\cur:Name\endcsname        
\def\:tempc{\o:@@nostopattributes: \csname b:\cur:Name\endcsname}%
\HLet\@@nostopattributes\:tempc
\def\:tempc{\o:@@dostopattributes: \csname b:\cur:Name\endcsname}%
\HLet\@@dostopattributes\:tempc
>>>

\<context core-sys\><<<
\NewConfigure{context-attr}{2}
>>>

\<another context env\><<<
\edef\cur:Name{\cur:Name -\last:Attributes}%
\verify:config\cur:Name{context-attr}% 
\csname a:\cur:Name\endcsname        
\def\:tempc{\o:@@nostopattributes: \csname b:\cur:Name\endcsname}%
\HLet\@@nostopattributes\:tempc
\def\:tempc{\o:@@dostopattributes: \csname b:\cur:Name\endcsname}%
\HLet\@@dostopattributes\:tempc
>>>

\<context core-spa\><<<
\def\:tempc[#1]{%
   \o:dostartopelkaar:[#1]%
   \verify:config{\currentregister-env}{null-default-env}%
   \csname a:\currentregister-env\endcsname
}
\HLet\dostartopelkaar\:tempc
%%%%%% pre 2005
\ifx \stopopelkaar\:UnDef \else
  \pend:def\stopopelkaar{%
     \csname b:\currentregister-env\endcsname
  }
\fi
>>>

NOTE: REPLACE opelkaar WITH packed

%%%%%%%%%%%%%
\Section{System Macros}
%%%%%%%%%%%%%

\<context core-sys\><<<
\NewConfigure{startstop}{2}
>>>

\<start stop env\><<<
\verify:config\cur:Name{startstop}%
\csname a:\cur:Name\endcsname        
\def\:tempc{\o:@@nostopattributes: \csname b:\cur:Name\endcsname}%
\HLet\@@nostopattributes\:tempc
\def\:tempc{\o:@@dostopattributes: \csname b:\cur:Name\endcsname}%
\HLet\@@dostopattributes\:tempc
>>>

\<context core-sec\><<<
\expand:after{\let\o:normalend}\csname normalend\endcsname
\expandafter\def\csname normalend\endcsname{\HtmlEnv
   \at:docend
   \csname export:hook\endcsname   \csname o:normalend\endcsname}
>>>

\<utilities for context\><<<
\def\get:curName#1{%
   \ifx \last:Attributes\empty
      \let\cur:Name\empty
   \else
      \bgroup
         \let#1=\empty 
         \edef\:temp{\def\noexpand\:temp{\last:Attributes}}%
         \expandafter
      \egroup\:temp
      \edef\:tempa{\last:Attributes}%
      \edef\cur:Name{\ifx\:temp\:tempa\else\:temp\fi}%
   \fi }
\let\last:Attributes=\empty
>>>

\<utilities for context\><<<
\def\verify:config#1#2{%
   \expandafter\ifx \csname c:#1:\endcsname\relax
      \expandafter\ifx \csname c:#2:\endcsname\relax
        \:warning{adding null \string\NewConfigure{#1}{2}}%
        \expandafter\def\csname c:#1:\endcsname##1##2{}%
      \else
        \:warning{adding \string\NewConfigure{#1}{2} 
                to equal \string\Configure{#2}{...}{...}}%
        \edef\:temp{\noexpand\NewConfigure{#1}[2]{%
           \gdef\expandafter\noexpand\csname
                    a:#1\endcsname{\expandafter
                                \noexpand\csname a:#2\endcsname}%
           \gdef\expandafter\noexpand\csname
                    b:#1\endcsname{\expandafter
                                \noexpand\csname b:#2\endcsname}%
        }}\:temp
        \Configure{#1}{}{}%
        \global\expandafter\let \csname c:#1:\expandafter
                       \endcsname \csname c:#1:\endcsname
      \fi
   \fi
}
>>>

\<utilities for context\><<<
\def\verify:configIII#1#2{%
   \expandafter\ifx \csname c:#1:\endcsname\relax
      \expandafter\ifx \csname c:#2:\endcsname\relax
        \:warning{adding null \string\NewConfigure{#1}{3}}%
        \expandafter\def\csname c:#1:\endcsname##1##2##3{}%
      \else
        \:warning{adding \string\NewConfigure{#1}{3} 
                to equal \string\Configure{#2}{...}{...}{...}}%
        \edef\:temp{\noexpand\NewConfigure{#1}[3]{%
           \gdef\expandafter\noexpand\csname
                    a:#1\endcsname{\expandafter
                                \noexpand\csname a:#2\endcsname}%
           \gdef\expandafter\noexpand\csname
                    b:#1\endcsname{\expandafter
                                \noexpand\csname b:#2\endcsname}%
           \gdef\expandafter\noexpand\csname
                    c:#1\endcsname{\expandafter
                                \noexpand\csname c:#2\endcsname}%
        }}\:temp
        \Configure{#1}{}{}{}%
        \global\expandafter\let \csname c:#1:\expandafter
                       \endcsname \csname c:#1:\endcsname
      \fi
   \fi
}
>>>

\<utilities for context\><<<
\def\verify:configIV#1#2{%
   \expandafter\ifx \csname c:#1:\endcsname\relax
      \expandafter\ifx \csname c:#2:\endcsname\relax
        \:warning{adding null \string\NewConfigure{#1}{4}}%
        \expandafter\def\csname c:#1:\endcsname##1##2##3##4{}%
      \else
        \:warning{adding \string\NewConfigure{#1}{4} 
                to equal \string\Configure{#2}{...}{...}{...}{...}}%
        \edef\:temp{\noexpand\NewConfigure{#1}[4]{%
           \gdef\expandafter\noexpand\csname
                    a:#1\endcsname{\expandafter
                                \noexpand\csname a:#2\endcsname}%
           \gdef\expandafter\noexpand\csname
                    b:#1\endcsname{\expandafter
                                \noexpand\csname b:#2\endcsname}%
           \gdef\expandafter\noexpand\csname
                    c:#1\endcsname{\expandafter
                                \noexpand\csname c:#2\endcsname}%
           \gdef\expandafter\noexpand\csname
                    d:#1\endcsname{\expandafter
                                \noexpand\csname d:#2\endcsname}%
        }}\:temp
        \Configure{#1}{}{}{}{}%
        \global\expandafter\let \csname c:#1:\expandafter
                       \endcsname \csname c:#1:\endcsname
      \fi
   \fi
}
>>>

%%%%%%%%%%%%%
\Section{Descriptions}
%%%%%%%%%%%%%

\<context core-des\><<<
\def\normal@@definitiewoord#1[#2]#3#4{%
   \verify:config{#1-des}{description-word}%
   \csname a:#1-des\endcsname \doattributes
     {\??dd#1}\c!kopletter\c!kopkleur
     {\getvalue{\??dd#1\c!commando}{#4}}%
   \csname b:#1-des\endcsname \rawreference\s!def{#2}{#3}}
\NewConfigure{description-word}{2}
>>>

\<context core-des\><<<
\def\@@somedefinitie#1[#2]#3{%
  \dowithpar 
     {\bgroup
         \verify:configIII{#1-item}{description-item}%
         \csname a:#1-item\endcsname 
         \executedoordefinitie{#1}[#2]{#3}\csname 
                            b:#1-item\endcsname }%
     {\csname c:#1-item\endcsname \@@stopdefinitie{#1}}}
\def\@@startsomedefinitie#1[#2]#3{%
   \bgroup 
      \verify:configIII{#1-item}{description-item}%
      \csname a:#1-item\endcsname
      \BeforePar{%
         \executedoordefinitie{#1}[#2]{#3}\csname 
                               b:#1-item\endcsname}\bgroup
                                       \expandafter\aftergroup
             \csname c:#1-item\endcsname\aftergroup\egroup
   \GotoPar}
\NewConfigure{description-item}{3}
>>>

%%%%%%%%%%%%%
\Section{Cross Referencing}
%%%%%%%%%%%%%

\<context core-ref\><<<
\NewConfigure{-@@ur}{2}
\NewConfigure{pubs-li}{2}
>>>

\<context core-ref\><<<
\catcode`\:=12 
\expandafter\def\csname :temp\endcsname{\def\redospecialfrom[##1::##2]} 
\catcode`\:=11 
 
\:temp  
  {\ifundefined{\v!file :::#1}%  
     \tttf[#1]%  
   \else  
     \def\doexternaldocument##1##2##3{\a:externaldocument 
                       [##1]{}{}\goto{##3}[#1::#2]\b:externaldocument}%  
     \csname\v!file :::#1\endcsname  
   \fi }  
\NewConfigure{externaldocument}{2} 
>>>

\<context core-ref\><<<
\def\:tempc[#1][#2]{%
   \o:docite:[#1][#2]%
   \expandafter\ifx \csname o:bib\@@citedefault ref:\endcsname\relax
      \expandafter\global\expandafter\let
           \csname o:bib\@@citedefault ref:\endcsname = \empty
      \:warning{No configuration is available for \expandafter
                   \string \csname bib\@@citedefault ref\endcsname}%
   \fi
}
\HLet\docite\:tempc
\ifx \dotypesetapublication\:UnDef\else
   \pend:defI\dotypesetapublication{\Link{}{##1}\EndLink}
\fi
>>>

\<context core-ref\><<<
\def\:tempc[#1]{%
      \Link{#1}{}\o:bibauthoryearref:[#1]\EndLink
}
\HLet\bibauthoryearref\:tempc
>>>

\<context core-ref\><<<
\def\:tempc[#1]{%
   \bibalternative\v!left
   \bgroup
      \let\v!left=\empty
      \let\v!right=\empty
      \Link{#1}{}\o:bibauthoryearsref:[#1]\EndLink
   \egroup
   \bibalternative\v!right
}
\HLet\bibauthoryearsref\:tempc
>>>

\<context core-ref\><<<
\def\:tempc[#1]{%
   \bibalternative\v!left
   \bgroup
      \let\v!left=\empty
      \let\v!right=\empty
      \Link{#1}{}\o:bibauthorref:[#1]\EndLink
   \egroup
   \bibalternative\v!right
}
\HLet\bibauthorref\:tempc
>>>

\<context core-ref\><<<
\def\:tempc[#1]{%
   \bibalternative\v!left
   \bgroup
      \let\v!left=\empty
      \let\v!right=\empty
      \Link{#1}{}\o:bibyearref:[#1]\EndLink
   \egroup
   \bibalternative\v!right
}
\HLet\bibyearref\:tempc
>>>

\<\><<<
\def\dodowritereference#1#2#3\end#4#5#6% 
  {\bgroup 
   \global\advance\crossreferencenumber \plusone\relax 
   \if#1-\if#2:% 
     \let\referenceprefix\empty 
     \xdef\lastreference{#3}% 
   \else 
     % \xdef\lastreference{#1#2#3}% here we loose the space 
   \fi\else 
     % \xdef\lastreference{#1#2#3}% here we loose the space 
   \fi 
   \ifx\lastreference\empty \else 
     \doiffirstreferenceoccurance\lastreference 
       {\thisisdestination{\referenceprefix\lastreference}}% 
     \referentieinfo>\lastreference 
     \edef\:temp{#6}%
     \edef\dododowritereference 
       {\writeutilitycommand 
          {\mainreference{\referenceprefix}{\lastreference}{#4}%
             {#5}{\ifx\:temp\empty\else \mk:ref#6\fi}}}% 
     \dododowritereference 
   \fi 
   \egroup   
   \a:Tagreference
} 
\def\mk:ref#1#2{%
    {\string\rEfLiNK{\lastreference}{#1}}%
    {\string\rEfLiNK{\lastreference}{#2}}}
>>>

\<context core-refOUT\><<<
\def\dodowritereference#1#2#3\end#4#5#6% 
  {\bgroup 
   \global\advance\crossreferencenumber \plusone\relax 
   \if#1-\if#2:% 
     \let\referenceprefix\empty 
     \xdef\lastreference{#3}% 
   \else 
     % \xdef\lastreference{#1#2#3}% here we loose the space 
   \fi\else 
     % \xdef\lastreference{#1#2#3}% here we loose the space 
   \fi 
   \ifx\lastreference\empty \else 
     \doiffirstreferenceoccurance\lastreference 
       {\thisisdestination{\referenceprefix\lastreference}}% 
     \referentieinfo>\lastreference 
     \edef\:temp{#6}%
     \edef\dododowritereference 
       {\writeutilitycommand 
          {\mainreference{\referenceprefix}{\lastreference}{#4}%
             {#5}{\string\rEfLiNK{\lastreference}{#6}}}}% 
     \dododowritereference 
   \fi 
   \egroup   
   \a:Tagreference
} 
>>>

\<context core-refOUT\><<<
\def\rEfLiNK#1#2{\Protect\Link{#1}{}#2\EndLink}
\pend:defI\rawdoifinsetelse{\let\rEfLiNK\secondoftwoarguments}
>>>

\<context core-refOUT\><<<
\NewConfigure{Tagreference}{1}
\Configure{Tagreference}
  {\ifvmode
         \vbox{\Link{}{\lastreference}\EndLink\EndP}%
   \else \hbox{\Link{}{\lastreference}\EndLink}\fi}
>>>

%%%%%%%%%%%%%
\Section{Logos}
%%%%%%%%%%%%%

\<context core-log\><<<
\def\:tempc{ConTeXt}
\HLet\ConTeXt\:tempc
>>>

%%%%%%%%%%%%%%%%%%
\Part{Xhtml}
%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%
\Section{Xhtml}
%%%%%%%%%%%%%%%%%%

\<configure 4ht\><<<
\ConfigureHinput>>>

\<end configure 4ht\><<<

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput\empty\empty\empty\empty\empty\empty                  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%>>>

%%%%%%%%%%%%%%%%%%%
\SubSection{amsopn}
%%%%%%%%%%%%%%%%%%%

\<amsopn.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% amsopn.4ht                            |version %
% Copyright (C) |CopyYear.1997.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<amsopn hooks|>
\Hinput{amsopn}
\endinput
>>>        \AddFile{5}{amsopn}

\<amsopn hooks\><<<
\expandafter\pend:defIII\csname qopname \endcsname{\a:qopname}
\NewConfigure{qopname}{1}
\ifx \nmlimits@\o:displaylimits:
    \def\:tempc{\displaylimits}
    \HLet\nmlimits@\:tempc
\fi
>>>

%%%%%%%%%%%%%%%%%%%%%
\Section{Languages and encodings}
%%%%%%%%%%%%%%%%%%%%%%

Latex  records current encoding in \`'\cf@encoding'.

\<cp850.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% cp850.4ht                          |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<cp850 config|>
\Hinput{cp850}
\endinput
>>>                        \AddFile{9}{cp850}

\<cp850 config\><<<
|<config textdegree|>
\long\def\mathonesuperior{{\sp1}} 
\long\def\maththreesuperior{{\sp3}} 
\long\def\mathtwosuperior{{\sp2}} 
>>>

\<cp852.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% cp852.4ht                          |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<cp852 config|>
\Hinput{cp852}
\endinput
>>>                        \AddFile{9}{cp852}

\<cp852 config\><<<
|<config textdegree|>
>>>

\<cp862.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% cp862.4ht                          |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<cp862 config|>
\Hinput{cp862}
\endinput
>>>                        \AddFile{9}{cp862}

\<cp862 config\><<<
|<config textdegree|>
\long\def\mathtwosuperior{{\sp2}} 
\long\def\mathordmasculine{{\sp o}} 
\long\def\mathordfeminine{{\sp a}} 
>>>

\<cp1250.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% cp1250.4ht                         |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<cp1250 config|>
\Hinput{cp1250}
\endinput
>>>                        \AddFile{9}{cp1250}

\<cp1250 config\><<<
|<config textdegree|>
>>>

\<cp1252.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% cp1252.4ht                         |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<cp1252 config|>
\Hinput{cp1252}
\endinput
>>>                        \AddFile{9}{cp1252}

\<cp1252 config\><<<
|<config textdegree|>
\long\def\mathtwosuperior{{\sp2}} 
\long\def\mathordmasculine{{\sp o}} 
\long\def\mathordfeminine{{\sp a}} 
>>>

\<cp437.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% cp437.4ht                          |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<cp437 config|>
\Hinput{cp437}
\endinput
>>>                        \AddFile{9}{cp437}

\<cp437 config\><<<
|<config textdegree|>
\long\def\mathtwosuperior{{\sp2}} 
\long\def\mathnsuperior{{\sp n}} 
>>>

\<cp437de.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% cp437de.4ht                        |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<cp437de config|>
\Hinput{cp437de}
\endinput
>>>                        \AddFile{9}{cp437de}

\<cp437de config\><<<
|<config textdegree|>
\long\def\mathtwosuperior{{\sp2}} 
\long\def\mathnsuperior{{\sp n}} 
>>>

\<cp865.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% cp865.4ht                          |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<cp865 config|>
\Hinput{cp865}
\endinput
>>>                        \AddFile{9}{cp865}

\<cp865 config\><<<
|<config textdegree|>
\long\def\mathtwosuperior{{\sp2}} 
\long\def\mathnsuperior{{\sp n}} 
>>>

\<norsk.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% norsk.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{norsk}
\endinput
>>>                        \AddFile{9}{norsk}

\<polish.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% polish.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{polish}
\endinput
>>>                        \AddFile{9}{polish}

\<polski.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% polski.4ht                          |version %
% Copyright (C) |CopyYear.2002.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<load ot4enc if needed|>
\Hinput{polski}
\endinput
>>>                        \AddFile{9}{polski}

\<load ot4enc if needed\><<<
\def\:temp{OT4}\ifx \:temp\encodingdefault
      \def\:tempa#1#2{%
         \def\:tempb##1{%
           \def\:temp####1##1####2//{\def\:temp{####2}}%
           \expandafter\:temp\@filelist##1//%
         }
         \edef\:temp{\noexpand\:tempb{%
            \expandafter\expandafter\expandafter
              \:gobble\expandafter\string \csname #1\endcsname
              .#2}}%
         \:temp}
   \:tempa{ot4enc}{def}
   \ifx \:temp\empty
     \:tempa{ot4cmr}{fd}         
      \ifx \:temp\empty \else
         \input ot4enc.4ht
      \fi
   \fi
\fi
>>>

\<portuges.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% portuges.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{portuges}
\endinput
>>>                        \AddFile{9}{portuges}

\<romanian.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% romanian.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{romanian}
\endinput
>>>                        \AddFile{9}{romanian}

We must prevent russian.ldf from loading EU1 or EU2 font encoding.
Declarationf for Cyrillics characters are loaded with XeLaTeX

\<russianb.4ht\><<<
% russianb.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2000. Eitan M. Gurari
|<TeX4ht copywrite|>

\if@uni@ode                                                                                                                                           
\DeclareRobustCommand{\cyrillictext}{%                                                                                                                
\language\l@russian}%
\fi
\ifdefined\XeTeXrevision%
\xeuniuseblock{Cyrillic}%
\fi%

\Hinput{russianb}
\endinput
>>>                        \AddFile{9}{russianb}

\<scottish.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% scottish.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{scottish}
\endinput
>>>                        \AddFile{9}{scottish}

\<slovak.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% slovak.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
|<config slovak|>
\Hinput{slovak}
\endinput
>>>                        \AddFile{9}{slovak}

\<config slovak\><<<
\edef\:temp{\noexpand\catcode`\noexpand\^=\the\catcode`\^}
\catcode`\^=13
\AtBeginDocument{
  \def^{\ifmmode \expandafter \pr:sp \else \expandafter \sys:sp \fi }
}
\:temp
>>>

\<slovene.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% slovene.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{slovene}
\endinput
>>>                        \AddFile{9}{slovene}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{spanish.ldf}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<spanish.4ht\><<< 
% spanish.4ht (|version), generated from |jobname.tex 
% Copyright 2021-2023 TeX Users Group 
|<TeX4ht license text|> 
|<spanish defs|>
\Hinput{spanish} 
\endinput 
>>> \AddFile{9}{spanish}

The following is needed to compensate for the extra \''\relax\space' in
\''\def\protect##1{\string\protect\string##1\relax\space}'.

\<spanish defsNO\><<<
\Configure{writetoc}
   {\def\:writetoc{\protect\@umlaut}\ifx \"\:writetoc
       \def\"{\string\"}%
    \fi
    \def\:writetoc{\protect\@tilde}\ifx \~\:writetoc
       \def\~{\string\~}%
    \fi
    \def\:writetoc{\protect\@acute}\ifx \'\:writetoc
       \def\'{\string\'}%
    \fi
   }
\bgroup
\catcode`\"=13
\def\:temp{\Configure{writetoc}{\add:protect"\add:protect\>}}
\expandafter\egroup \:temp
>>>

\<spanish defs\><<< 
\expandafter\def\csname spanish:"shorthand\endcsname
               #1{\leavevmode \hbox{\csname a:spanish"#1\endcsname}}
\edef\:temp{\expandafter\noexpand
               \csname spanish:"shorthand\endcsname\space a}
\expandafter\HLet\csname spanish@sh@\string"@a@\endcsname=\:temp
\NewConfigure{spanish"a}{1}
\edef\:temp{\expandafter\noexpand
               \csname spanish:"shorthand\endcsname\space o}
\expandafter\HLet\csname spanish@sh@\string"@o@\endcsname=\:temp
\NewConfigure{spanish"o}{1}
\edef\:temp{\expandafter\noexpand
               \csname spanish:"shorthand\endcsname\space e}
\expandafter\HLet\csname spanish@sh@\string"@e@\endcsname=\:temp
\NewConfigure{spanish"e}{1}
\edef\:temp{\expandafter\noexpand
               \csname spanish:"shorthand\endcsname\space A}
\expandafter\HLet\csname spanish@sh@\string"@A@\endcsname=\:temp
\NewConfigure{spanish"A}{1}
\edef\:temp{\expandafter\noexpand
               \csname spanish:"shorthand\endcsname\space O}
\expandafter\HLet\csname spanish@sh@\string"@O@\endcsname=\:temp
\NewConfigure{spanish"O}{1}
\edef\:temp{\expandafter\noexpand
               \csname spanish:"shorthand\endcsname\space E}
\expandafter\HLet\csname spanish@sh@\string"@E@\endcsname=\:temp
\NewConfigure{spanish"E}{1}
>>>

\<spanish defs\><<< 
\edef\:tempc{\expandafter\noexpand
               \csname spanish:'shorthand\endcsname\space i}
\expandafter\HLet\csname spanish@sh@\string'@i@\endcsname=\:tempc
\NewConfigure{spanish'i}{1}
\def\:tempc{\csname a:spanish'i\endcsname}
\expandafter\HLet\csname \string\OT1\string\'-i\endcsname\:tempc
>>>

\<spanish defs\><<< 
\AtBeginDocument{
   \def\:tempc{\a:guillemotright}
   \HLet\guillemotright\:tempc
   \def\:tempc{\a:guillemotleft}
   \HLet\guillemotleft\:tempc
}
\NewConfigure{guillemotright}{1}
\Configure{guillemotright}{\o:guillemotright:}
\NewConfigure{guillemotleft}{1}
\Configure{guillemotleft}{\o:guillemotright:}
>>>

\<spanish defs\><<< 
\def\:tempc#1#2#3{%
    \expandafter\:text@composite@x
    \csname OT1\string#1\endcsname#3\@empty}
\HLet\es@accent\:tempc
\def\:text@composite@x#1#2{%
   \expandafter\ifx \csname \string#1-\string#2\endcsname\relax
      \expandafter\ifx \csname \string#1- :\endcsname\relax
          \expandafter\expandafter\expandafter\:gobble
      \else
          \expandafter\expandafter
          \expandafter\expandafter
          \expandafter\expandafter
          \csname \string#1- :\endcsname
      \fi
   \else \expandafter\:gobble
   \fi
   {#2}%
   }
\def\chk:acc#1#2#3{%
   \if !#2!\expandafter\:gobbleIII \else
       \if \noexpand#1\noexpand#2%
          \a:es@accents#3\b:es@accents
          \expandafter\expandafter\expandafter\gob:accc
       \else
          \expandafter\expandafter\expandafter\chk:acc
       \fi
   \fi
   {#1}%
}
\def\gob:accc#1{\gob:acc}
\def\gob:acc#1#2{\if !#2!\expandafter\gobe:acc
   \else \expandafter\gob:acc\fi 
}
\expandafter\ifx\csname documentclass\endcsname\relax\then
   \def\gobe:acc#1\@text@composite#2\@text@composite#3{}
\else 
   \let\gobe:acc=\:gobble
\fi
\NewConfigure{es@accent}[2]{\expandafter
   \def\csname #1- :\endcsname##1{\chk:acc{##1}#2{}{}}}
\NewConfigure{es@accents}{2}
>>>

\<spanish defs\><<< 
\AtBeginDocument{%
   \def\bbl@umlauta{\ifx \EndPicture \:UnDef \expandafter \n:bbl@umlauta: 
                    \else \expandafter \o:bbl@umlauta: \fi }%
}
>>>

This is necessary to fix clash between mathml option and some definitions
in Spanish babel.

\<spanish defs\><<<
\let\orig:nolimits\nolimits
\let\nolimits\o:nolimits:
\AtBeginDocument{
  \let\nolimits\orig:nolimits
  \let\es@operators\relax
}
>>>

% \def\@text@composite#1#2#3\@text@composite{%
%    \writesixteen{....\string#1-\string#2...\expandafter
%                      \meaning\csname\string#1-\string#2\endcsname}%
%    \expandafter\@text@composite@x 
%       \csname\string#1-\string#2\endcsname} 

\<swedish.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% swedish.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{swedish}
\endinput
>>>                        \AddFile{9}{swedish}

\<turkish.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% turkish.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{turkish}
\endinput
>>>                        \AddFile{9}{turkish}

\<ukraineb.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ukraineb.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{ukraineb}
\endinput
>>>                        \AddFile{9}{ukraineb}

\<usorbian.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% usorbian.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{usorbian}
\endinput
>>>                        \AddFile{9}{usorbian}

\<welsh.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% welsh.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{welsh}
\endinput
>>>                        \AddFile{9}{welsh}

\<hebrew.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% hebrew.4ht                            |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>
  |<hebrew ldf|>
\Hinput{hebrew}
\endinput
>>>                        \AddFile{9}{hebrew}

\<hebrew ldf\><<< 
\def\hebdate#1#2#3{%
  \a:moreR\beginR\a:moreL\beginL\number#1\endL\b:moreL\ \bet\hebmonth{#2}
         \a:moreL\beginL\number#3\endL\b:moreL\endR\b:moreR}
\def\@@hebrew#1{\a:moreR\beginR{{\tohebrew#1}}\b:moreR\endR}
>>>

\<austrian.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% austrian.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{austrian}
\endinput
>>>                        \AddFile{9}{austrian}

\<catalan.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% catalan.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{catalan}
\endinput
>>>                        \AddFile{9}{catalan}

\<croatian.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% croatian.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{croatian}
\endinput
>>>                        \AddFile{9}{croatian}

\<czech.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% czech.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copywrite|>
\let\clqq\quotedblbase
\Hinput{czech}
\endinput
>>>                        \AddFile{9}{czech}

\<danish.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% danish.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{danish}
\endinput
>>>                        \AddFile{9}{danish}

\<dutch.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% dutch.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{dutch}
\endinput
>>>                        \AddFile{9}{dutch}

\<english.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% english.4ht                        |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{english}
\endinput
>>>                        \AddFile{9}{english}

\<esperant.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% esperant.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{esperant}
\endinput
>>>                        \AddFile{9}{esperant}

\<estonian.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% estonian.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{estonian}
\endinput
>>>                        \AddFile{9}{estonian}

\<finnish.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% finnish.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{finnish}
\endinput
>>>                        \AddFile{9}{finnish}

\<francais.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% francais.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{francais}
\endinput
>>>                        \AddFile{9}{francais}

\<galician.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% galician.4ht                          |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|<TeX4ht copyright|>

\Hinput{galician}
\endinput
>>>                        \AddFile{9}{galician}

\<greek.4ht\><<<
% greek.4ht (|version), generated from |jobname.tex
% Copyright |CopyYear.2000. Eitan M. Gurari
|<TeX4ht copywrite|>

\Configure{AtBeginDocument}
  {\immediate\write\@mainaux{\catcode`\string\^=7}} {}

\ifdefined\XeTeXrevision%
\renewcommand*{\greekfontencoding}{OT1}
\xeuniuseblock{Greek}
\fi
\ifdefined\luatexversion
\renewcommand*{\greekfontencoding}{OT1}
\fi

\Hinput{greek}
\endinput
>>>                        \AddFile{9}{greek}

grrek.sty sends \`'\catcode`^^9f\active' into the aux file.
Hence the change of \`'^' into catcode 7. The aux file is
loaded within group, so the above changes are local.


\<magyar.4ht\><<<
% magyar.4ht (|version), generated from |jobname.tex
% Copyright 2018 TeX Users Group
|<TeX4ht license text|>
|<magyar fixes|>
\Hinput{magyar}
\endinput
>>>        \AddFile{5}{magyar}


\<magyar fixes\><<<
\def\magyar:third:arg#1#2#3{#3}
\def\@@magyar@firsthfuzz#1#2\hfuzz{\bgroup\magyar:third:arg#1\egroup}
\def\@@magyar@firstarg#1#2\hbox${\magyar:third:arg#1}%
>>>

%%%%%%%%%%%%%%%%%%%%
\Section{Exams}
%%%%%%%%%%%%%%%%%%%%%%%

\<exam.4ht\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% exam.4ht                                  |version %
% Copyright (C) |CopyYear.2001.       Eitan M. Gurari         %
|<TeX4ht copyright|>
\ifx \ps@examheadings\:unDef 
   |<start skip|>
\fi
\:temp
   |<hook Meer exam|>
   \Hinput{exam}
|<end skip|>
\ifx \@checkqueslevel\:unDef 
   |<start skip|>
\fi
\:temp
   |<hook Hirschhorn' exam|>
   \Hinput{exam}
|<end skip|>
\ifx \@OneKeyHook\:unDef 
   |<start skip|>
\fi
\:temp
   |<hook Alexanders' exam|>
   \Hinput{exam}
|<end skip|>
\endinput
>>>                        
\AddFile{9}{exam}

\<start skip\><<<
\bgroup
   \catcode`\%=12
   \def\:temp{\catcode`\\=9 \catcode`\#=9 \:tempa}
   \long\def\:tempa#1%%%%%%%%%%%%%%%%%%%end:skip{\egroup}
\else
   \let\:temp\empty
>>>

\<end skip\><<<
%%%%%%%%%%%%%%%%%%%end:skip
>>>

\SubSection{Philip Hirschhorn}

\Link[http://www-math.mit.edu/\string ~psh/]{}{}home\EndLink{}
(\Link[http://ctan.tug.org/tex-archive/macros/latex/contrib/supported/exam/]{}{}ctan\EndLink)

\<hook Hirschhorn' exam\><<<
\let\exam:questions=\questions
\def\questions{%
   \let\exam:list=\list 
   \def\list{\let\list=\exam:list\begin{list}}%
   \exam:questions  }
\pend:def\endquestions{%
   \let\exam:list=\endlist 
   \def\endlist{\let\endlist=\exam:list \end{list}}}
\let\exam:parts=\parts
\def\parts{%
   \let\exam:list=\list 
   \def\list{\let\list=\exam:list\begin{list}}%
   \exam:parts  }
\pend:def\endparts{%
   \let\exam:list=\endlist 
   \def\endlist{\let\endlist=\exam:list \end{list}}}
\let\exam:subparts=\subparts
\def\subparts{%
   \let\exam:list=\list 
   \def\list{\let\list=\exam:list\begin{list}}%
   \exam:subparts  }
\pend:def\endsubparts{%
   \let\exam:list=\endlist 
   \def\endlist{\let\endlist=\exam:list \end{list}}}
>>>

\<hook Hirschhorn' exam\><<<
\long\def\uplevel#1{\par\a:uplevel{#1}\b:uplevel\par}
\long\def\fullwidth#1{\par\a:fullwidth{#1}\b:fullwidth\par}
\NewConfigure{uplevel}{2}
\NewConfigure{fullwidth}{2}
>>>

\<hook Hirschhorn' exam\><<<
\def\@setpoints{%
  \if@placepoints
    \if@pointsinmargin
            \a:setpoints(\@points\@marginpointname)\b:setpoints            
    \else
            \a:setpoints(\@points\@pointname)\b:setpoints
    \fi
    \@placepointsfalse
  \fi
}
\NewConfigure{setpoints}{2}
>>>

\SubSection{Hans van der Meer's class}

\Link[http://www.tex.ac.uk/tex-archive/macros/latex/contrib/supported/exams/]{}{}Hans van der Meer's class\EndLink

\<hook Meer exam\><<<
\pend:defI\scorebox{\a:scorebox}
\append:defI\scorebox{\b:scorebox}
\NewConfigure{scorebox}{2}
>>>

\SubSection{<Alexanders' Exam}

\Link[http://ctan.tug.org/tex-archive/macros/latex/contrib/supported/examdesign/]{}{}Alexanders' exam\EndLink

\<hook Alexanders' exam\><<<
|<alex hook utilities|>
|<hooks for section types|>
\pend:def\@enddocumenthook{{\tt \tmp:cnt=1 \seed:hooks }}
>>>

\<alex hook utilities\><<<
\def\seed:hooks{%
  \ifnum \tmp:cnt>\c@section \else 
     |<trace exam data|>%     
     |<type-oriented hooks|>
     \advance\tmp:cnt by 1
     \expandafter\seed:hooks 
  \fi  
}
>>>

\<type-oriented hooks\><<<
\expandafter\ifx\csname type@sec\romannumeral\tmp:cnt\endcsname
      \@shortanswer
  |<hooks for shortanswer|>
\fi
\expandafter\ifx\csname type@sec\romannumeral\tmp:cnt \endcsname\@fixed
  |<hooks for fixed|>
\fi
\expandafter\ifx\csname type@sec\romannumeral\tmp:cnt \endcsname\@fillin
  |<hooks for fillin|>
\fi
\expandafter\ifx\csname type@sec\romannumeral\tmp:cnt \endcsname\@fillinstar
  |<hooks for fillinstar|>
\fi
\expandafter\ifx\csname type@sec\romannumeral\tmp:cnt \endcsname\@MC
  |<hooks for MC|>
\fi
\expandafter\ifx\csname type@sec\romannumeral\tmp:cnt \endcsname\@MCstar
  |<hooks for MCstar|>
\fi
\expandafter\ifx\csname type@sec\romannumeral\tmp:cnt \endcsname
     \@shortanswerstar
  |<hooks for shortanswerstar|>
\fi
\expandafter\ifx\csname type@sec\romannumeral\tmp:cnt \endcsname
     \@truefalse
  |<hooks for truefalse|>
\fi
\expandafter\ifx\csname type@sec\romannumeral\tmp:cnt \endcsname
     \@truefalsestar
  |<hooks for truefalsestar|>
\fi
\expandafter\ifx\csname type@sec\romannumeral\tmp:cnt \endcsname\@fixedstar
  |<hooks for fixedstar|>
\fi
>>>

\<hooks for shortanswer\><<<
\def\:temp{|<redef blank|>}%
|<hooks for answers|>%
|<hooks for section heads|>% 
|<hooks on instruction preamble|>%
>>>

\<hooks for shortanswerstar\><<<
|<cond head and inst hooks|>% 
>>>

% \def\:temp{|<redef blank|>}%
% |<hooks for answers|>%

\<hooks for fixed\><<<
\def\:temp{|<redef blank|>}%
|<hooks for answers|>%
|<hooks for section heads|>% 
|<hooks on instruction preamble|>%
>>>

\<hooks for fixedstar\><<<
\def\:temp{|<redef blank|>}%
|<hooks for answers|>%
|<cond head and inst hooks|>%
>>>

\<hooks for fillin\><<<
\def\:temp{|<redef blank|>}%
|<hooks for answers|>%
|<hooks for section heads|>% 
|<hooks on instruction preamble|>%
>>>

\<hooks for fillinstar\><<<
\def\:temp{|<redef blank|>}%
|<hooks for answers|>%
|<cond head and inst hooks|>%
>>>

\<hooks for MC\><<<
\def\:temp{|<reconfigure multiplechoice|>}%
|<hooks for answers|>%
|<hooks for section heads|>% 
|<hooks on instruction preamble|>%
>>>

MC stands for multi-choice

\<hooks for MCstar\><<<
\def\:temp{|<reconfigure multiplechoice|>}%
|<hooks for answers|>%
|<cond head and inst hooks|>%
>>>

\<hooks for truefalse\><<<
\def\:temp{|<redef truefalse answer|>}%
|<hooks for answers|>%
|<hooks for section heads|>%
|<hooks on instruction preamble|>%
>>>

\<hooks for truefalsestar\><<<
\def\:temp{|<redef truefalse answer|>}%
|<hooks for answers|>%
|<cond head and inst hooks|>%
>>>

\<cond head and inst hooks\><<<
\expandafter\ifx
   \csname head@sec\romannumeral\tmp:cnt \endcsname\relax \else
   |<hooks for section heads|>%
\fi
\expandafter\ifx
   \csname inst@sec\romannumeral\tmp:cnt \endcsname\relax \else
   |<hooks on instruction preamble|>%
\fi
>>>

\<hooks for section heads\><<<
\expandafter\pend:def\csname sec\romannumeral\tmp:cnt @fixed\endcsname{%
  \gdef\beforesectsep{0pt \a:sectiontitle
     \global\let\beforesectsep\sv:beforesectsep}%
  \gdef\aftersectsep{0pt \b:sectiontitle
     \global\let\aftersectsep\sv:aftersectsep}% 
}%
\global\expandafter
  \let\csname sec\romannumeral\tmp:cnt @fixed\expandafter\endcsname
     \csname sec\romannumeral\tmp:cnt @fixed\endcsname
>>>

\<hook Alexanders' exam\><<<
\NewConfigure{sectiontitle}{2}
>>>

\<alex hook utilities\><<<
\let\sv:beforesectsep\beforesectsep
\let\sv:aftersectsep\aftersectsep
>>>

\<hooks on instruction preamble\><<<
\expandafter\pend:def
    \csname inst@sec\romannumeral\tmp:cnt\endcsname{\a:instructions}%
\expandafter\append:def
    \csname inst@sec\romannumeral\tmp:cnt\endcsname{\b:instructions\par}%
\global\expandafter\let
    \csname inst@sec\romannumeral\tmp:cnt \expandafter\endcsname
    \csname inst@sec\romannumeral\tmp:cnt\endcsname
>>>

\<hooks for answers\><<<
\global  \csname qlist@scr@sec\romannumeral\tmp:cnt 
  \expandafter\expandafter\expandafter
     \endcsname
  \expandafter\expandafter\expandafter{\expandafter\:temp
     \the\csname qlist@scr@sec\romannumeral\tmp:cnt \endcsname}
>>>

\<redef blank\><<<
\ifx \blank\:UnDef 
  \:warning{tex4ht encountered a problem
      with \csname type@sec\current@section\endcsname}
\else
\ifanswer
   \ifcblanks
      \def\blank####1{\a:answer ####1\b:answer}%
   \fi
   \ifpblanks
      \def\blank####1{\a:answer ####1\b:answer}%
   \fi
\else
   \ifcblanks
      \pend:defI\blank{\a:question}
      \append:defI\blank{\b:question}
   \fi
   \ifpblanks
      \pend:defI\blank{\a:question}
      \append:defI\blank{\b:question}
   \fi
\fi \fi
>>>

\<redef truefalse answer\><<<
  \pend:defI\@separator{\def\@tfitem{%
    \ifanswer
       \item[\a:answer
           \csname tf@sol\current@question\endcsname\b:answer]%
    \else
       \item
    \fi}}%
>>>

\<hook Alexanders' exam\><<<
\NewConfigure{answer}{2}
\NewConfigure{question}{2}
>>>

\<hook Alexanders' exam\><<<
\pend:defI\MCfont{\a:MCfont}
\append:defI\MCfont{\b:MCfont}
\NewConfigure{MCfont}{2}
>>>

\<hook Alexanders' exam\><<< 
\Configure{MCfont}
 {\HCode{<span class="MCfont">}}    {\HCode{</span>}}
\Css{dt .MCfont {text-decoration:underline;}}
>>>

\<reconfigure multiplechoice\><<<
\boxfalse
>>>>

\<hook Alexanders' exam\><<<
\NewConfigure{instructions}{2}
>>>

\<trace exam data\><<<
\section:data
>>>

\<alex hook utilities\><<<
\def\section:data{
\par[\the\tmp:cnt]
\par [qlist@sec\romannumeral\tmp:cnt]  
   \expandafter\meaning\csname qlist@sec\romannumeral\tmp:cnt\endcsname :
   \expandafter \edef\expandafter \:temp\expandafter {\expandafter
      \the\csname qlist@sec\romannumeral\tmp:cnt\endcsname}
   \meaning\:temp
\par [qlist@scr@sec\romannumeral\tmp:cnt] 
   \expandafter\meaning\csname qlist@scr@sec\romannumeral\tmp:cnt\endcsname :
   \expandafter \edef\expandafter \:temp\expandafter {\expandafter
      \the\csname qlist@scr@sec\romannumeral\tmp:cnt\endcsname}
   \meaning\:temp
\par [inst@sec\romannumeral\tmp:cnt] 
   \expandafter\meaning\csname inst@sec\romannumeral\tmp:cnt\endcsname
\par [head@sec\romannumeral\tmp:cnt]
   \expandafter\meaning\csname head@sec\romannumeral\tmp:cnt\endcsname
\par [type@sec\romannumeral\tmp:cnt] 
   \expandafter\meaning\csname type@sec\romannumeral\tmp:cnt\endcsname
\par [sec\romannumeral\tmp:cnt @fixed]  
   \expandafter\meaning\csname sec\romannumeral\tmp:cnt @fixed\endcsname
\par ****************************************\par
}
\let\section:data=\empty
>>>

\<hook Alexanders' exam\><<<
\pend:def\@examtopmatter{\bgroup
   \pend:def\namedata{\let\hrulefill=\empty \a:namedata}%
   \append:def\namedata{\b:namedata}%
   \pend:def\classdata{\a:classdata}%
   \append:def\classdata{\b:classdata}%
   \let\examtop=\empty  \let\endexamtop=\empty
   \begin{examtop}}
\append:def\@examtopmatter{%
    \end{examtop} \egroup\bigskip}
\NewConfigure{classdata}{2}
\NewConfigure{namedata}{2}
>>>

\<hook Alexanders' exam\><<<
\pend:def\@keytopmatter{\bgroup
   \let\keytop=\empty  \let\endkeytop=\empty
   \begin{keytop}}
\append:def\@keytopmatter{%
    \end{keytop} \egroup\bigskip}
>>>

\<hook Alexanders' exam\><<<
\append:def\frontmatter@wrap@up{%
  \ifx\@frontmattertext\relax  \else
     \pend:def\@frontmattertext{\a:frontmatter}
     \append:def\@frontmattertext{\b:frontmatter}
  \fi
}
\NewConfigure{frontmatter} {2}
>>>

%% begin comment. 29/09/2016 (dg)
%% mktex4ht.4ht is generated by cond4ht.4ht
%% Remove file generation from tex4ht-4ht.tex
%% Detaching mktex4ht.cnf, mktex4ht-cnf.tex is read instead.
%% end
\def\Skipmkfilename{\csname BYE\endcsname\endinput}
\input cond4ht.4ht

%-------------------------------------------------------
\let\OPO=\OutputCodE
\def\OutputCodE\<#1\>{%
   \openin15=\HOME/#1
%   \ifeof15    \Needs{"ln -s #1 \HOME/#1"} 
    \ifeof15    \Needs{"cp -f #1 \HOME#1"} 
        \writesixteen{"cd \HOME; ln -s \SOURCE/#1 . ; cd \SOURCE"} \fi
   \closein15
   \OPO\<#1\>}

\OutFiles

\OutputCodE\<m-tex4ht.tex\>
\OutputCodE\<usepackage.4ht\>
\OutputCodE\<showfonts.4ht\>
\OutputCodE\<idxmake.4ht\>
\OutputCodE\<bibtex.4ht\>
\OutputCodE\<fontspec-4ht.lua\>
\bye
