1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
% article.4ht 2005-03-27-10:43 %
3
% Copyright (C) 1997--2005 Eitan M. Gurari %
5
% This work may be distributed and/or modified under the %
6
% conditions of the LaTeX Project Public License, either %
7
% version 1.3 of this license or (at your option) any %
8
% later version. The latest version of this license is %
10
% http://www.latex-project.org/lppl.txt %
11
% and version 1.3 or later is part of all distributions %
12
% of LaTeX version 2003/12/01 or later. %
14
% This work has the LPPL maintenance status "maintained".%
16
% This Current Maintainer of this work %
17
% is Eitan M. Gurari. %
19
% If you modify this program your changing its signature %
20
% with a directive of the following form will be %
22
% \message{signature} %
24
% gurari@cse.ohio-state.edu %
25
% http://www.cse.ohio-state.edu/~gurari %
26
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27
\immediate\write-1{version 2005-03-27-10:43}
30
\Configure{UndefinedSec}{likepart}
31
\Configure{UndefinedSec}{likechapter}
32
\Configure{UndefinedSec}{likesection}
33
\Configure{UndefinedSec}{likesubsection}
37
\append:def\quote{\par\@totalleftmargin\z@}
38
\NewConfigure{caption}[4]{\c:def\cptA:{#1}\c:def\cptB:{#2}%
39
\c:def\cptC:{#3}\c:def\cptD:{#4}}
40
\long\def\@makecaption#1#2{%
42
\cptB:}{\cptC:{#2}\cptD:}}
45
\pend:def\caption{\SkipRefstepAnchor}
46
\long\def\c:theindex:#1#2#3#4#5#6#7#8#9{%
48
\def\idx:item{\SaveEverypar\ht:everypar{}#1}%
49
\def\endtheindex{\idx:item#2\RecallEverypar}%
50
\def\item{\idx:item\def\idx:item{#4}\let\index\@gobble #3}%
51
\def\subitem{\idx:item\def\idx:item{#6}\let\index\@gobble #5}%
52
\def\subsubitem{\idx:item\def\idx:item{#8}\let\index\@gobble #7}}%
53
\def\indexspace{\idx:item#9\let\idx:item\empty}}
55
\expandafter\ifx \csname #1warn:idx\endcsname\relax
57
\expandafter\let \csname #1warn:idx\endcsname\def
58
\:warning{If not done so, the index is to be processed by
59
^^J\space\space tex '\string\def\string\filename
60
{{#1}{idx}{4dx}{ind}} \noexpand\input\space idxmake.4ht'
61
^^J\space\space makeindex -o #1.ind #1.4dx
63
^^J\space\space makeindex -o #1.ind #1.idx
64
^^JOn some platforms, the quotation marks ' should be
65
^^J replaced by double quotation marks " or eliminated.
67
{\Configure{Needs}{File: #1.4idx}\Needs{}}%
69
\ifOption{info}{\Log:Note{
71
^^Jtex '\def\string\filename{{\%\%1}{idx}{4dx}{ind}}
72
\string\input\space idxmake.4ht'
73
^^Jmakeindex -o \%\%1.ind \%\%1.4dx
74
^^Jin the env file, automatically calls to the revised makeindex
75
^^Jcommand. An extra compilation of the source LaTeX file is required,
76
^^Jto get the index correctly into the output.}}{}
77
\def\ind:defs{\let\LNKidx\empty
78
\def\LNK##1##2##3##4{\ifx\NewConfigure\:UnDef\else
79
\a:LNK[##1]{##2}{}\gHAdvance\:LNKno1
80
\def\:THIrd{##3}\ifx\:THIrd\empty
81
\LNKidx{\ifx\c:LNK\empty\:LNKno\else \c:LNK\fi}\else
83
\global\let\LNKidx\empty
88
\Configure{LNK}{\Link}{\EndLink}{}
90
\Configure{@begin}{theindex}{\ind:defs}
93
\let\o:maketitle:\maketitle
94
\def\maketitle{\bgroup
95
\gHAdvance\:mpNum by 1
96
\HAssign\minipageNum=\:mpNum \relax
98
\ifx \EndPicture\:UnDef
100
\Configure{HtmlPar}{}{}{}{}%
101
\ConfigureEnv{center}{\empty}{}{\empty}{\empty}
102
\let\a:tabular:sv\a:tabular \let\b:tabular:sv\b:tabular
103
\let\c:tabular:sv\c:tabular \let\d:tabular:sv\d:tabular
104
\let\e:tabular:sv\e:tabular \let\f:tabular:sv\f:tabular
105
\let\before:begintabular:sv\before:begintabular
107
\Configure{HBorder}{}{}{}{}{}{}{}{}{}{}%
108
\Configure{tabular}{}{}{}{\e:mktl}
109
{\bgroup \let\a:tabular\a:tabular:sv \let\b:tabular\b:tabular:sv
110
\let\c:tabular\c:tabular:sv \let\d:tabular\d:tabular:sv
111
\let\e:tabular\e:tabular:sv \let\f:tabular\f:tabular:sv
112
\let\before:begintabular\before:begintabular:sv
114
\ConfigureEnv{tabular}{\empty}{}{}{}%
116
\pend:def\@title{\a:ttl}\append:def\@title{\b:ttl}%
117
\pend:def\@date{\a:dat}\append:def\@date{\b:dat}%
118
\pend:def\@author{\a:aut}\append:def\@author{\b:aut}%
122
\pic:gobble\a:mktl \o:maketitle: \pic:gobble\b:mktl
123
\egroup \let\maketitle\empty}
124
\NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
125
\c:def\a:ttl{#3}\c:def\b:ttl{#4}}
126
\NewConfigure{thanks author date and}[8]{%
127
\c:def\a:thanks{#1}\c:def\b:thanks{#2}\c:def\a:aut{#3}\c:def\b:aut{#4}%
128
\c:def\a:dat{#5}\c:def\b:dat{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}
130
\append:def\quotation{\a:quotation\par\@totalleftmargin\z@}
131
\NewConfigure{quotation}{1}
132
\NewConfigure{listof}{6}
137
\noexpand\ifx [\noexpand\:temp
138
\noexpand\expandafter\noexpand\:TableOfContents
140
\noexpand\Auto:ent{\ifnum \c@tocdepth >-2 part,\fi
141
\expandafter\ifx \csname @chapter\endcsname\relax
142
\ifnum \c@tocdepth >\z@ section,\fi
144
\ifnum \c@tocdepth >\m@ne chapter,appendix,\fi
145
\ifnum \z@>\c@tocdepth\else section,\fi
146
\ifnum 1>\c@tocdepth \else subsection,\fi
148
\ifnum 2>\c@tocdepth \else subsection,\fi
149
\ifnum 3>\c@tocdepth \else subsubsection,\fi
150
\ifnum 4>\c@tocdepth \else paragraph,\fi
151
\ifnum 5>\c@tocdepth \else subparagraph,\fi
154
\def\:tableofcontents{\futurelet\:temp\:TOC}
156
\edef\auto:toc{\noexpand\:TableOfContents[\ifx \auto:toc\:UnDef
157
#1\else \auto:toc \fi]} \auto:toc
158
\global\let\auto:toc\:UnDef }
160
\def\:tocs{\noexpand\:tableofcontents}
161
\pend:defIII\addcontentsline{%
162
\def\:temp{##1}\def\:tempa{toc}\ifx \:temp\:tempa
163
\gHAdvance\TitleCount 1 \fi }
164
\def\@dottedtocline#1#2#3#4#5{\hbox{\def\numberline##1{\e:listof
165
##1\f:listof}\c:listof#4\d:listof}\ignorespaces}
168
\makeatletter \Configure{cite}{}{}{}{}%
169
\def\:temp{#1}\def\:tempa{toc}%
171
\@input{\jobname.\ifx \:temp\:tempa 4ct\else #1\fi}%
174
\expandafter\expandafter\csname
175
newwrite\endcsname\csname tf@#1\endcsname
176
\immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
178
\global\@nobreakfalse
183
\NewConfigure{tableofcontents*}[1]{%
184
\def\:tempa{#1}\ifx\empty\:tempa
185
\ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
188
\ifx \au:StartSec\:UnDef
189
\let\au:StartSec\:StartSec
190
\def\:StartSec{\:tableofcontents
191
\global\let\auto:toc\:UnDef \:StartSec}%
192
\pend:def\:tableofcontents{\gdef\:StartSec{\au:StartSec}}%
196
\ifx \@openbib@code\:UnDef \else
197
\pend:def\@openbib@code{\labelsep\z@}
199
\def\:temp#1#2!*?: {\def\:temp{#1}}
200
\expandafter\:temp\usepackage!*?:
201
\def\:tempa{\@latex@e@error}
202
\ifx \:temp\:tempa \else
203
\def\:tempa#1#2#3#4{\tmp:toks{#1{#2}}%
204
\long\expandafter\edef\csname #4 \endcsname{\the\tmp:toks
205
{\expandafter\noexpand
206
\csname o:\expandafter\:gobble\string #3:\endcsname}}}
208
\expandafter\ifx \csname #1 \endcsname\relax\else
209
\expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}%
220
\ifx \part\:UnDef\else
222
\ifnum \c@secnumdepth >-2\relax
223
\SkipRefstepAnchor \refstepcounter{part}%
224
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
226
\addcontentsline{toc}{part}{#1}%
228
\csname @endpart\endcsname}
230
\Def:Section\part{\thepart}{#1}
235
{\let\addcontentsline\:gobbleIII\no@part[#1]{}}%
236
\HtmlEnv \Toc:Title{#1}\:part{#2}}
237
\Def:Section\likepart{}{#1}
238
\let\:likepart\likepart
242
{\let\addcontentsline\:gobbleIII\no@spart{}}%
243
\HtmlEnv \:likepart{#1}}
246
\ifx \section\:UnDef\else
247
\let\no@section\section
248
\Def:Section\section{\ifnum \c:secnumdepth>\c@secnumdepth \else
250
\let\no:section\section
251
\def\section{\rdef:sec{section}}
252
\Def:Section\likesection{}{#1}
253
\let\:likesection\likesection
254
\let\likesection\:UnDef
257
\let\no@subsection\subsection
258
\Def:Section\subsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
259
\thesubsection \fi}{#1}
260
\let\no:subsection\subsection
261
\def\subsection{\rdef:sec{subsection}}
262
\Def:Section\likesubsection{}{#1}
263
\let\:likesubsection\likesubsection
264
\let\likesubsection\:UnDef
266
\let\no@subsubsection\subsubsection
267
\Def:Section\subsubsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
268
\thesubsubsection \fi}{#1}
269
\let\no:subsubsection\subsubsection
270
\def\subsubsection{\rdef:sec{subsubsection}}
271
\Def:Section\likesubsubsection{}{#1}
272
\let\:likesubsubsection\likesubsubsection
273
\let\likesubsubsection\:UnDef
275
\let\no@paragraph\paragraph
276
\Def:Section\paragraph{\ifnum \c:secnumdepth>\c@secnumdepth \else
277
\theparagraph \fi}{#1}
278
\let\no:paragraph\paragraph
279
\def\paragraph{\rdef:sec{paragraph}}
280
\Def:Section\likeparagraph{}{#1}
281
\let\:likeparagraph\likeparagraph
282
\let\likeparagraph\:UnDef
283
\let\no@subparagraph\subparagraph
284
\Def:Section\subparagraph{\ifnum \c:secnumdepth>\c@secnumdepth \else
285
\thesubparagraph \fi}{#1}
286
\let\no:subparagraph\subparagraph
287
\def\subparagraph{\rdef:sec{subparagraph}}
288
\Def:Section\likesubparagraph{}{#1}
289
\let\:likesubparagraph\likesubparagraph
290
\let\likesubparagraph\:UnDef
292
\let\:tempc\listoffigures
293
\pend:def\:tempc{\begingroup \a:listoffigures
294
\def\@starttoc{\:tableofcontents[lof]\:gobble}}
295
\append:def\:tempc{\b:listoffigures \endgroup}
296
\HLet\listoffigures\:tempc
297
\let\:tempc\listoftables
298
\pend:def\:tempc{\begingroup \a:listoftables
299
\def\@starttoc{\:tableofcontents[lot]\:gobble}}
300
\append:def\:tempc{\b:listoftables \endgroup}
301
\HLet\listoftables\:tempc
303
\NewConfigure{listoffigures}{2}
304
\NewConfigure{listoftables}{2}
307
\def\tableofcontents{%
308
\ifx\contentsname\empty \else
309
\ifx\contentsname\:UnDef \else
311
\section*{\contentsname}%
317
\ConfigureToc{likeparagraph} {}{\empty}{}{\newline}
318
\ConfigureToc{likepart} {}{\empty}{}{\newline}
319
\ConfigureToc{likesection} {}{\empty}{}{\newline}
320
\ConfigureToc{likesubparagraph} {}{\empty}{}{\newline}
321
\ConfigureToc{likesubsection} {}{\empty}{}{\newline}
322
\ConfigureToc{likesubsubsection} {}{\empty}{}{\newline}
323
\ConfigureToc{paragraph} {\empty}{\ }{}{\newline}
324
\ConfigureToc{part} {\empty}{\ }{}{\newline}
325
\ConfigureToc{section} {\empty}{\ }{}{\newline}
326
\ConfigureToc{subparagraph} {\empty}{\ }{}{\newline}
327
\ConfigureToc{subsection} {\empty}{\ }{}{\newline}
328
\ConfigureToc{subsubsection} {\empty}{\ }{}{\newline}