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

<..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.>%
 }
 -_-_-

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

<..TeX4ht (like)ch and app..>+
 \ifx\ChapterFonts\:UnDef
    \font\:ChFont=cmbx10 scaled \magstep5
 
    \def\ChapterFonts{\let\bf=\:ChFont
        \baselineskip=29.85pt}
 \fi
 -_-_-

The command \magstepi 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 ( = 12 (1.2)5pt).

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

<..non-html TeX4ht (like)ch and app..>+
 \BeforeEveryChapter{\:clearpage}
 \BeforeEveryLikeChapter{\:clearpage}
 \BeforeEveryAppendix{\:clearpage}
 -_-_-