% $Id: tex4ht-4ht.tex 1615 2024-12-08 22:14:41Z 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{}} % \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{

A `Literate' View of tex4ht.sty

} \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} %%%%%%%%%%%%%%%%%% \<<< !*?: >>> \
<<< |1-\file:id-\TitleCount >>> \<<< 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. \<<< % % 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 . % % 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. \<<< % Copyright 2009-|the|year|empty TeX Users Group >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< % book.4ht (|version), generated from |jobname.tex % Copyright |CopyYear.1997. Eitan M. Gurari | | | | | | | | | | \Hinput{book} \endinput >>> \AddFile{2}{book} \<<< % report.4ht (|version), generated from |jobname.tex % Copyright |CopyYear.1997. Eitan M. Gurari | | | | | | | | | | | \Hinput{report} \endinput >>> \AddFile{2}{report} \<<< % article.4ht (|version), generated from |jobname.tex % Copyright |CopyYear.1997. Eitan M. Gurari | | | | | | | | | |
|
\Hinput{article} \endinput >>> \AddFile{2}{article} \<<< | | | |%after tocs, divs, and cuts|% >>> \<<< | >>> \<<< \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} >>> \<<< |
\ConfigureToc{appendix} {\empty}{\ }{}{\newline} \ConfigureToc{chapter} {\empty}{\ }{}{\newline} \ConfigureToc{likechapter} {}{\empty}{}{\newline} >>> \
<<< \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 \<<< packagename,>>> \<<< \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 \<<< % 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 (|version), generated from |jobname.tex % Copyright 2020 TeX Users Group | % 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 (|version), generated from |jobname.tex % Copyright |CopyYear.2003. Eitan M. Gurari | | \endinput >>> \<<< \def\:temp{tex4ht}\ifx \:temp\@currname \:warning{\string\usepackage{tex4ht} again?} | \fi \gdef\a:usepackage{\use:package |,|} \gdef\use:package#1,{% \if :#1:\def\:temp##1|{}\else \def\:temp{#1}\ifx \@currname\:temp \def\:temp##1|{\input usepackage.4ht }% \else \let\:temp=\use:package \fi \fi \:temp} | >>> \<<< \def\:temp#1htex4ht.def,tex4ht.sty#2|{\def\:temp{#2}} \expandafter\:temp \@filelist htex4ht.def,tex4ht.sty|% \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 (|version), generated from |jobname.tex % Copyright |CopyYear.1997. Eitan M. Gurari | | | | | | |%|1.ltclass.|% |%|1.ltdirchk.|% | |%|1.ltplain.|% |%|1.ltvers.|% |%|1.ltdefns.|% |%|1.ltalloc.|% |%|1.ltcntrl.|% |%|1.lterror.|% |%|1.ltpar.|% | |%|1.ltspace.|% |%|1.ltlogos.|% |%|1.ltfiles.|% | |%|1.ltoutenc.|% | |%|1.ltcounts.|% | |%|1.ltlength.|% |%|1.ltfssbas.|% | |%|1.ltfsstrc.|% |%|1.ltfsscmp.|% | |%|1.ltfssdcl.|% |%|1.ltfssini.|% |%|1.ltfntcmd.|% |%|1.ltpageno.|% | |%|1.ltxref.|% | |%|1.ltmiscen.|% | |%|1.ltmath.|% | |%|1.ltlists.|% | |%|1.ltboxes.|% | |%|1.lttab.|% | |%|1.oltpictur.|% | |%|1.ltthm.|% | |%|1.ltsect.|% | |%|1.ltfloat.|% | |%|1.ltidxglo.|% | |%|1.ltbibl.|% | |%|1.ltpage.|% | |%|1.ltoutput.|% | |%|1.ltfinal.|% | | \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} \<<< \edef\:temp{% \every@math@size={\noexpand\ifx \noexpand\EndPicture\noexpand\:UnDef \noexpand\else \the\every@math@size \noexpand\fi}% } \:temp >>> \<<< \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{}) \<<< \: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} >>> \<<< \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} >>> \<<< \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'. \<<< \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} >>> \<<< \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 | \expandafter \:tempa\fi } >>> \<<< \def\:temp{#1}\expandafter \:iffil\@filelist,,|% \ifx \:tempa\:temp \def\:tempa{#2}\else \def\:tempa{#3}\fi >>> \<<< \def\:iffil#1,#2|{\def\:tempa{#1}\ifx \:temp\:tempa \let\:tempb=\empty \else \ifx \:tempa\empty \let\:tempb=\empty \else \def\:tempb{\:iffil#2|}\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 \<<< \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 (|version), generated from |jobname.tex % Copyright |CopyYear.2000. Eitan M. Gurari | \ifx \ttl@assign@ii\:Undef \ifx \ttl@sect\:UnDef\else | \fi \ifx \ttl@useclass\:UnDef\else | \fi | \else | \fi \Hinput{titlesec} \endinput >>> \AddFile{9}{titlesec} \<<< \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 >>> \<<< \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 >>> \<<< \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}{}} >>> \<<< \let\:seccntformat=\@seccntformat \def\@seccntformat#1{\ifnum 0=0\the\csname c@#1\endcsname\else \:seccntformat{#1}\fi} >>> \<<< \let\ttl:straight@i\ttl@straight@i \def\ttl@straight@i#1[#2]#3{% |% \ifttl@label \else |% \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 \<<< \let\ttlh@runin\ttlh@hang \let\ttlh@display\ttlh@hang >>> \<<< \def\:temp{#1}\edef\:tempa{\expandafter \expandafter\expandafter\:gobble \expandafter\string\csname section\endcsname}\ifx \:temp\:tempa \else |% \fi >>> \<<< \edef\:tempa{\expandafter\expandafter\expandafter\:gobble \expandafter\string\csname subsection\endcsname}\ifx \:temp\:tempa \else {\ttl@labeltrue \ttl@addcontentsline{like#1}{#3}}% \fi >>> \<<< \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. \<<< \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. \<<< \Configure{PackageHooks}{titlesec.sty}{titlesec-hooks.4ht} >>> \<<< % titlesec-hooks.4ht (|version), generated from |jobname.tex % Copyright 2022-2023 TeX Users Group | | \endinput >>> \AddFile{9}{titlesec-hooks} \<<< \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 | } >>> Titlesec formatting can cause various issues, so it is best to disable it completely. \<<< \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 (|version), generated from |jobname.tex % Copyright |CopyYear.2000. Eitan M. Gurari | | \expandafter\ifx \csname @TCItagstar\endcsname\relax | \else | \ifx \@msidraft\:Undef | \fi \fi | \Hinput{tcilatex} \endinput >>> \AddFile{2}{tcilatex} \<<< \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. \<<< \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 }} >>> \<<< \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'. \<<< \def\y@hyperref#1#2#3#4{% \Link[#4]{}{}#1\EndLink \catcode`\~ = 13 \catcode`\$ = 3 \catcode`\_ = 8 \catcode`\# = 6 \catcode`\& = 4 } >>> \<<< \let\:tempc=\GRAPHICSPS \pend:defI\:tempc{\a:GRAPHICSPS} \append:defI\:tempc{\b:GRAPHICSPS} \HLet\GRAPHICSPS=\:tempc \NewConfigure{GRAPHICSPS}{2} >>> \<<< \let\:tempc=\GRAPHICSHP \pend:defI\:tempc{\a:GRAPHICSHP} \append:defI\:tempc{\b:GRAPHICSHP} \HLet\GRAPHICSHP=\:tempc \NewConfigure{GRAPHICSHP}{2} >>> \<<< \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}% \<<< \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} >>> \<<< \expandafter\ifx \csname o:dfrac:\endcsname \relax | \fi >>> The following protection, e.g., for titles of sections. \<<< \let\o:Greekmath:|=\Greekmath \def\Greekmath{\protect\o:Greekmath:} >>> \<<< %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % seslideb.4ht |version % % Copyright (C) |CopyYear.2001. Eitan M. Gurari % | | \Hinput{seslideb} \endinput >>> \AddFile{7}{seslideb} \<<< \NewSection\swSlide{}{} \def\PageBreak{\swSlide{\swTitle}} \let\swTitle|=\relax >>> \<<< %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % jeep.4ht |version % % Copyright (C) |CopyYear.2002. Eitan M. Gurari % | | \Hinput{jeep} \endinput >>> \AddFile{9}{jeep} \<<< \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 \<<< | | >>> plain.tex and latex. The following is assumed to be within a group. \<<< \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

neither do

things too high for me.

xxxxxxxxxxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxx neither do

things too high for me. xxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxxxx neither do

things too high for me.

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. \<<< \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 \<<< \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}'. \<<< \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. \<<< \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} %%%%%%%%%%%%% \<<< | | >>> %%%%%%%%%%%%% \SubSection{Index Labels} %%%%%%%%%%%%% Try to delete, or at least contain, \''\no:lbl:idx'. \<<< \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} %%%%%%%%%%%%% \<<< \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}{}{}{} >>> \<<< \NewConfigure{@newlabel}[1]{\concat:config\a:@newlabel{#1}} \let\a:@newlabel|=\relax | \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} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \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 |% \let\protect|=\@unexpandable@protect \cur:lbl{}% \ifx \EndPicture\:UnDef \ifx \cur:th\skip:anchor |% \else \ifx \:currentlabel\empty |

%
      \fi \fi
   \else
      |%
   \fi
   \a:@newlabel
   \edef\@tempa{\write\@auxout{\string
      \newlabel{#1}{{|}%
                    {|}|}}}%
   \expandafter}\@tempa
   \if@nobreak \ifvmode\nobreak\fi\fi\fi
   |%
   \@esphack}
|
>>>

\<<<
\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'.

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

\<<<
\let\skip:anchor|=\:UnDef
>>>

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

\
<<<
\def\:currentlabel{doc}%
|%
>>>
         

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

The following is to ensure anchors for labels in 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}\] '.

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

\<<<
\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 \`'' links are not allowed. 

\<<<
\a:newlabel\thepage
>>>

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

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

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

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

\<<<
\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'.

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

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

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

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

\<<<
\html:addr \edef\cur:th{|\last:haddr r}% 
>>>

\<<<
\anc:lbl r{}%
>>>

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

\<<<
\append:defI\refstepcounter{%
  |%
  \anc:lbl r{#1}}
\def\anc:lbl#1#2{%
   \html:addr   \xdef\cur:th{|\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{|\last:haddr}\ShowRefstepAnchor
   \let\skip:anchor|=\cur:th}}
\def\ShowRefstepAnchor{\let\anc:lbl|=\onc:lbl}
|
\html:addr   \edef\cur:th{|\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.

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

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

\<<<
\HAssign\Labels:Cnt |= 0
\def\trim:Labels{%
   \ifnum \Labels:Cnt>100 
      \def\:tempa##1|{}%
      \gHAssign\Labels:Cnt = 0
      \let\:tempb\Made:Labels  
      \let\Made:Labels\empty
      \expandafter\keep:Labels\:tempb|%
   \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}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<<<
\def\Get:SecAnchor#1#2#3{%
   |%
   \xdef\cur:th{|\last:haddr}%
   |%
   \xdef\:currentlabel{#2}%
   \edef\:SecAnchor{\cur:th\:currentlabel}%
 }
>>>

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

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

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

\<<<
\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 
\`'' 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                           |version %
% Copyright (C) |CopyYear.2000.       Eitan M. Gurari         %
|
   | 
   \ifx \@@citeNP\:UnDef
     |
   \else
     |
   \fi
\Hinput{apacite}
\endinput
>>>        \AddFile{9}{apacite}

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

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

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

\
<<<
\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                             |version %
% Copyright (C) |CopyYear.2002.      Eitan M. Gurari         %
|
   | 
\Hinput{mla}
\endinput
>>>        \AddFile{9}{mla}

\<<<
\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 (|version), generated from |jobname.tex
% Copyright |CopyYear.2007. Eitan M. Gurari
|
   | 
   |
   |
   |
   |
\Hinput{biblatex}
\endinput
>>>        \AddFile{6}{biblatex}

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

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

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

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

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

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

\<<<
\def\bibConfigure{\ConfigureList{thebibliography}%
      {\IgnorePar\EndP \gHAdvance\bib:N by 1
       \HCode{
              \Hnewline
             }
           \NoFonts\ref:name\EndNoFonts
       \HCode{\Hnewline
%
           \Hnewline
%
            \Hnewline
%
           : \Hnewline
           \Hnewline
           , \Hnewline
%
           \Hnewline
           , \Hnewline
%
           \Hnewline
           \Hnewline\Hnewline
           \Hnewline
           \Hnewline}%
         \let\en:bib=\empty
      }%
      {\en:bib\HCode{}}
      {\en:bib\gdef\en:bib{\HCode{\Hnewline}}%
        \HCode{}%
        \gHAdvance\bibN by 1
        \HCode{%
          }%
      }%
      {}{}
  }
>>>

\<<<
 \def\bibConfigure{%
  \ConfigureList{thebibliography}
  {\ifvmode \IgnorePar \fi \EndP \EndP
    \HCode {
}% % % 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] % % % % \immediate\write\@auxout{% \string\providecommand\string\BibFileName[2][]{} }% \immediate\write\@auxout{% \string\BibFileName[\therefsection]{\FileName}}% % % % \PushMacro \end:itm \global \let \end:itm =\empty}% {\ifvmode \IgnorePar \fi \EndP \PopMacro \end:itm \global \let \end:itm \end:itm \EndP \HCode {
}\ShowPar}% {\ifvmode \IgnorePar \fi \EndP \gHAdvance \bibN by 1 \end:itm \global \def \end:itm {\EndP \Tg }% \HCode {
}\bgroup \bf}% {\ifvmode \IgnorePar \fi \EndP \egroup \HCode {
}% \par \ShowPar}% } >>> \<<< \:CheckOption{ooffice}\if:Option | \else | \fi >>> \<<< \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 }% } >>> \<<< \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. \<<< % 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 % \<<< \let\blx@anchors\@empty \let\bib@field@entrykey\@empty \protected\def\blx@anchor{% \xifinlist{|\bib@field@entrykey}{\blx@anchors}% {}% {\listxadd\blx@anchors{|\bib@field@entrykey}% \hyper:natanchorstart{|\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{|#1}% #2\hyper:natlinkend}% \protected\long\def\blx@bibhyperlink#1#2{% \hyper:natlinkstart{|#1}% #2\hyper:natlinkend}% \protected\long\def\blx@bibhypertarget#1#2{% \@bsphack \hyper:natanchorstart{|#1}% \@esphack #2\hyper:natanchorend}% >>> \<<< X\the\c@refsection -%@ >>> \<<< X\the\c@refsection --%: >>> \<<< \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 and % Christian Fearnot 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. % % \<<< % \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}} % >>> \<<< \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 % }% } >>> \<<< \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}% } >>> \<<< \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} >>> \<<< \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 >>> \<<< \NewConfigure{printfield}[1]{\def\a:printfield##1{#1}} \Configure{printfield}{% \Configure{#1}% {\HCode{}}% {\HCode{}}% } >>> \<<< \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 >>> \<<< \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 >>> \<<< \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 >>> \<<< \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 >>> \<<< \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 >>> \<<< \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}% } >>> \<<< \NewConfigure{thebibliography}{4} >>> \<<< \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 } >>> \<<< \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 % % 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. \<<< \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. \<<< \renewrobustcmd*{\addnbspace}{% \unspace\blx@postpunct% % insert real non-breaking space character \nobreakspace\blx@imc@resetpunctfont} >>> \<<< \append:def\blx@bibinit{\a:bibinit}% \NewConfigure{bibinit}{1}% >>> \<<< \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{
}% \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{}% \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{
}% \PushMacro\end:itm \global\let\end:itm=\empty}% {\PopMacro\end:itm \global\let\end:itm \end:itm \EndP\HCode{
}\ShowPar}% {\end:itm \global\def\end:itm{\EndP\Tg}\HCode{
}\bgroup \bf}% {\egroup\EndP\HCode{
}} >>> Fix backlink support in BibLaTeX \<<< \pend:defI\blx@backref{% % prevent duplicate backlink on the same page \ifcsdef{bk##1\thepage}{}{% % insert link to the page \html:addr\Link-{}{|\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}{|\last:haddr}{\folio}}% % we need to save the link destination in .xref file % too, otherwise \Link command would issue warning \Tag{)Q|\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 (|version), generated from |jobname.tex % Copyright 2021 TeX Users Group | | \Hinput{backref} \endinput >>> \AddFile{9}{backref} \<<< % 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-{}{|\last:haddr}\EndLink% % save link to the .xref file \Tag{)Q##1\thepage}{|\last:haddr}% % we need to save the link destination in .xref file % too, otherwise \Link command would issue warning \Tag{)Q|\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 (|version), generated from |jobname.tex % Copyright 2024 TeX Users Group | \Hinput{multibib} \endinput >>> \AddFile{9}{multibib} \<<< \Configure{PackageHooks}{multibib.sty}{multibib-hooks.4ht} >>> \<<< % multibib-hooks.4ht (|version), generated from |jobname.tex % Copyright 2024 TeX Users Group | \:AtEndOfPackage{ | } \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. \<<< \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 (|version), generated from |jobname.tex % Copyright |CopyYear.2008. Eitan M. Gurari | | \Hinput{reading} \endinput >>> \AddFile{6}{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 } >>> \<<< \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} >>> \<<< \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 % Bug posted by Joanna Bryson % \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] \<<< \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}{}{}% } >>> \<<< \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}{}{}% } >>> \<<< \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 } >>> \<<< \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 (|version), generated from |jobname.tex % Copyright 2018 TeX Users Group | \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. \<<< \Configure{PackageHooks}{biblatex-chicago.sty}{biblatex-chicago-hooks.4ht} >>> \<<< % biblatex-chicago-hooks.4ht (|version), generated from |jobname.tex % Copyright 2021 TeX Users Group | \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 |version % % Copyright (C) |CopyYear.2008. Eitan M. Gurari % | | \Hinput{debug} \endinput >>> \AddFile{5}{debug} \<<< \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 |version % % Copyright (C) |CopyYear.2008. Eitan M. Gurari % | | \Hinput{footnote-dw} \endinput >>> \AddFile{5}{footnote-dw} \<<< \def\bib@macro@footref{\:label{\thefield {entrykey}}} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \Section{amstex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \