1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
% book.4ht 2001-12-14-17:07 %
3
% Copyright (C) 1997--2001 Eitan M. Gurari %
5
% This program can redistributed and/or modified under %
6
% the terms of the LaTeX Project Public License %
7
% Distributed from CTAN archives in directory %
8
% macros/latex/base/lppl.txt; either version 1 of the %
9
% License, or (at your option) any later version. %
11
% However, you are allowed to modify this program %
12
% without changing its name, if you modify its %
13
% signature. Changes to the signature can be introduced %
14
% with a directive of the form %
15
% \message{signature} %
17
% gurari@cis.ohio-state.edu %
18
% http://www.cis.ohio-state.edu/~gurari %
19
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20
\immediate\write-1{version 2001-12-14-17:07}
22
\Configure{UndefinedSec}{likepart}
23
\Configure{UndefinedSec}{likechapter}
24
\Configure{UndefinedSec}{likesection}
25
\Configure{UndefinedSec}{likesubsection}
27
\def\tableofcontents{%
28
\ifx\contentsname\empty \else
30
\chapter*{\contentsname}%
38
\Def:Section\chapter{\thechapter}{#1}
41
\def\@makechapterhead#1{}
42
\let\no@chapter\@chapter
44
{\SkipRefstepAnchor \let\addcontentsline\:gobbleIII\no@chapter[#1]{}}%
45
\HtmlEnv \Toc:Title{#1}\:chapter{#2}}
46
\Def:Section\likechapter{}{#1}
47
\let\:likechapter\likechapter
48
\let\likechapter\:UnDef
49
\let\no@schapter\@schapter
51
{\let\addcontentsline\:gobbleIII\no@schapter{}}%
52
\HtmlEnv \:likechapter{#1}}
53
\let\no@appendix\appendix
54
\Def:Section\appendix{\thechapter}{#1}
55
\let\:appendix\appendix
57
\def\@chapter[##1]##2{%
58
{\def\addcontentsline####1####2####3{}\no@chapter[##1]{}}%
59
\HtmlEnv \Toc:Title{##1}\:appendix{##2}}%
64
\noexpand\ifx [\noexpand\:temp
65
\noexpand\expandafter\noexpand\:TableOfContents
67
\noexpand\Auto:ent{\ifnum \c@tocdepth >-2 part,\fi
68
\expandafter\ifx \csname @chapter\endcsname\relax
69
\ifnum \c@tocdepth >\z@ section,\fi
71
\ifnum \c@tocdepth >\m@ne chapter,appendix,\fi
72
\ifnum \z@>\c@tocdepth\else section,\fi
73
\ifnum 1>\c@tocdepth \else subsection,\fi
75
\ifnum 2>\c@tocdepth \else subsection,\fi
76
\ifnum 3>\c@tocdepth \else subsubsection,\fi
77
\ifnum 4>\c@tocdepth \else paragraph,\fi
78
\ifnum 5>\c@tocdepth \else subparagraph,\fi
81
\def\:tableofcontents{\futurelet\:temp\:TOC}
83
\edef\auto:toc{\noexpand\:TableOfContents[\ifx \auto:toc\:UnDef
84
#1\else \auto:toc \fi]} \auto:toc
85
\global\let\auto:toc\:UnDef }
87
\def\:tocs{\noexpand\:tableofcontents}
88
\pend:defIII\addcontentsline{%
89
\def\:temp{##1}\def\:tempa{toc}\ifx \:temp\:tempa
90
\gHAdvance\TitleCount 1 \fi }
91
\def\@dottedtocline#1#2#3#4#5{\hbox{\def\numberline##1{\e:listof
92
##1\f:listof}\c:listof#4\d:listof}\ignorespaces}
95
\makeatletter \Configure{cite}{}{}{}{}%
96
\def\:temp{#1}\def\:tempa{toc}%
98
\@input{\jobname.\ifx \:temp\:tempa 4ct\else #1\fi}%
101
\expandafter\expandafter\csname
102
newwrite\endcsname\csname tf@#1\endcsname
103
\immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
105
\global\@nobreakfalse
110
\NewConfigure{tableofcontents*}[1]{%
111
\def\:tempa{#1}\ifx\empty\:tempa
112
\ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
115
\ifx \au:StartSec\:UnDef
116
\let\au:StartSec\:StartSec
117
\def\:StartSec{\:tableofcontents
118
\global\let\auto:toc\:UnDef \:StartSec}%
119
\pend:def\:tableofcontents{\gdef\:StartSec{\au:StartSec}}%
123
\ifx \@openbib@code\:UnDef \else
124
\pend:def\@openbib@code{\labelsep\z@}
126
\def\:temp#1#2!*?: {\def\:temp{#1}}
127
\expandafter\:temp\usepackage!*?:
128
\def\:tempa{\@latex@e@error}
129
\ifx \:temp\:tempa \else
130
\def\:tempa#1#2#3#4{\tmp:toks{#1{#2}}%
131
\long\expandafter\edef\csname #4 \endcsname{\the\tmp:toks
132
{\expandafter\noexpand
133
\csname o:\expandafter\:gobble\string #3:\endcsname}}}
135
\expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}}
144
\let\:tempc\listoffigures
145
\pend:def\:tempc{\begingroup \a:listoffigures
146
\def\@starttoc{\:tableofcontents[lof]\:gobble}}
147
\append:def\:tempc{\b:listoffigures \endgroup}
148
\HLet\listoffigures\:tempc
149
\let\:tempc\listoftables
150
\pend:def\:tempc{\begingroup \a:listoftables
151
\def\@starttoc{\:tableofcontents[lot]\:gobble}}
152
\append:def\:tempc{\b:listoftables \endgroup}
153
\HLet\listoftables\:tempc
155
\NewConfigure{listoffigures}{2}
156
\NewConfigure{listoftables}{2}
158
\ifx \part\:UnDef\else
160
\ifnum \c@secnumdepth >-2\relax
161
\SkipRefstepAnchor \refstepcounter{part}%
162
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
164
\addcontentsline{toc}{part}{#1}%
166
\csname @endpart\endcsname}
168
\Def:Section\part{\thepart}{#1}
173
{\let\addcontentsline\:gobbleIII\no@part[#1]{}}%
174
\HtmlEnv \Toc:Title{#1}\:part{#2}}
175
\Def:Section\likepart{}{#1}
176
\let\:likepart\likepart
180
{\let\addcontentsline\:gobbleIII\no@spart{}}%
181
\HtmlEnv \:likepart{#1}}
184
\ifx \section\:UnDef\else
185
\let\no@section\section
186
\Def:Section\section{\ifnum \c:secnumdepth>\c@secnumdepth \else
188
\let\no:section\section
189
\def\section{\rdef:sec{section}}
190
\Def:Section\likesection{}{#1}
191
\let\:likesection\likesection
192
\let\likesection\:UnDef
195
\let\no@subsection\subsection
196
\Def:Section\subsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
197
\thesubsection \fi}{#1}
198
\let\no:subsection\subsection
199
\def\subsection{\rdef:sec{subsection}}
200
\Def:Section\likesubsection{}{#1}
201
\let\:likesubsection\likesubsection
202
\let\likesubsection\:UnDef
204
\let\no@subsubsection\subsubsection
205
\Def:Section\subsubsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
206
\thesubsubsection \fi}{#1}
207
\let\no:subsubsection\subsubsection
208
\def\subsubsection{\rdef:sec{subsubsection}}
209
\Def:Section\likesubsubsection{}{#1}
210
\let\:likesubsubsection\likesubsubsection
211
\let\likesubsubsection\:UnDef
213
\let\no@paragraph\paragraph
214
\Def:Section\paragraph{\ifnum \c:secnumdepth>\c@secnumdepth \else
215
\theparagraph \fi}{#1}
216
\let\no:paragraph\paragraph
217
\def\paragraph{\rdef:sec{paragraph}}
218
\Def:Section\likeparagraph{}{#1}
219
\let\:likeparagraph\likeparagraph
220
\let\likeparagraph\:UnDef
221
\let\no@subparagraph\subparagraph
222
\Def:Section\subparagraph{\ifnum \c:secnumdepth>\c@secnumdepth \else
223
\thesubparagraph \fi}{#1}
224
\let\no:subparagraph\subparagraph
225
\def\subparagraph{\rdef:sec{subparagraph}}
226
\Def:Section\likesubparagraph{}{#1}
227
\let\:likesubparagraph\likesubparagraph
228
\let\likesubparagraph\:UnDef
234
\NewConfigure{caption}[4]{\c:def\cptA:{#1}\c:def\cptB:{#2}%
235
\c:def\cptC:{#3}\c:def\cptD:{#4}}
236
\long\def\@makecaption#1#2{%
237
{\cptA: \cap:ref{#1}%
238
\cptB:}{\cptC:{#2}\cptD:}}
241
\pend:def\caption{\SkipRefstepAnchor}
242
\append:def\quote{\par\@totalleftmargin\z@}
243
\long\def\c:theindex:#1#2#3#4#5#6#7#8#9{%
245
\ifx \idx:item\:UnDef \ifx \LNK\:UnDef \ifx \LNKno\:UnDef
246
\:warning{Process with
247
^^J\space\space tex '\string\def\string\filename
248
{{\jobname}{ind}{idx}{in}{out}} \noexpand\input\space idxmake.4ht'
249
^^J\space\space makeindex -o \jobname .out \jobname .in
251
^^J\space\space makeindex -o \jobname .ind \jobname .idx
252
^^JOn some platforms, the quotation marks ' should be
253
^^J replaced by double quotation marks " or eliminated
256
\def\idx:item{\SaveEverypar\ht:everypar{}#1}%
257
\def\endtheindex{\idx:item#2\RecallEverypar}%
258
\def\item{\idx:item\let\index\@gobble #3\def\idx:item{#4}}%
259
\def\subitem{\idx:item\let\index\@gobble #5\def\idx:item{#6}}%
260
\def\subsubitem{\idx:item\let\index\@gobble #7\def\idx:item{#8}}}%
261
\def\indexspace{\idx:item#9\let\idx:item\empty}}
262
\let\o:maketitle:\maketitle
263
\def\maketitle{\bgroup
264
\ifx \EndPicture\:UnDef
266
\Configure{HtmlPar}{}{}{}{}%
267
\ConfigureEnv{center}{\empty}{}{\empty}{\empty}
268
\Configure{tabular}{}{}{}{\e:mktl}{}{}%
269
\ConfigureEnv{tabular}{\empty}{}{}{}%
271
\pend:def\@title{\a:ttl}\append:def\@title{\b:ttl}%
272
\pend:def\@date{\a:dat}\append:def\@date{\b:dat}%
273
\pend:def\@author{\a:aut}\append:def\@author{\b:aut}%
277
\pic:gobble\a:mktl \o:maketitle: \pic:gobble\b:mktl
278
\egroup \let\maketitle\empty}
279
\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
280
\c:def\a:ttl{#3}\c:def\b:ttl{#4}}
281
\NewConfigure{thanks author date and}[8]{%
282
\c:def\a:thanks{#1}\c:def\b:thanks{#2}\c:def\a:aut{#3}\c:def\b:aut{#4}%
283
\c:def\a:dat{#5}\c:def\b:dat{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}
286
\append:def\quotation{\a:quotation\par\@totalleftmargin\z@}
287
\NewConfigure{quotation}{1}
288
\NewConfigure{listof}{6}
290
\ConfigureToc{likeparagraph} {}{\empty}{}{\newline}
291
\ConfigureToc{likepart} {}{\empty}{}{\newline}
292
\ConfigureToc{likesection} {}{\empty}{}{\newline}
293
\ConfigureToc{likesubparagraph} {}{\empty}{}{\newline}
294
\ConfigureToc{likesubsection} {}{\empty}{}{\newline}
295
\ConfigureToc{likesubsubsection} {}{\empty}{}{\newline}
296
\ConfigureToc{paragraph} {\empty}{\ }{}{\newline}
297
\ConfigureToc{part} {\empty}{\ }{}{\newline}
298
\ConfigureToc{section} {\empty}{\ }{}{\newline}
299
\ConfigureToc{subparagraph} {\empty}{\ }{}{\newline}
300
\ConfigureToc{subsection} {\empty}{\ }{}{\newline}
301
\ConfigureToc{subsubsection} {\empty}{\ }{}{\newline}
303
\ConfigureToc{appendix} {\empty}{\ }{}{\newline}
304
\ConfigureToc{chapter} {\empty}{\ }{}{\newline}
305
\ConfigureToc{likechapter} {}{\empty}{}{\newline}