~ubuntu-branches/debian/sid/tex4ht/sid

« back to all changes in this revision

Viewing changes to texmf/tex/generic/tex4ht/article.4ht

  • Committer: Bazaar Package Importer
  • Author(s): Kapil Hari Paranjape
  • Date: 2005-04-05 14:14:41 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050405141441-x4dojdgz3frkfyet
Tags: 20050402.1817-1
* New upstream release (2005-04-02-18:17). Closes: #299934.
* See README.src, README.validate, README.Debian and copyright
  for information on minor changes.
* This upload fixes a some .htf files. Closes: #295109.
* Updated the description to reflect recent changes.
* Fixed some typos in src/tex4ht-mkht.tex and consequently
  in the mk4ht script.
* Updated the man page to include mk4ht. 
* Updated the description of options for the scripts in the man page.
  Put more information in the man page about the way the system works.
  Closes: #219348, #219347.
* Added debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
2
% article.4ht                           2005-03-27-10:43 %
 
3
% Copyright (C) 1997--2005       Eitan M. Gurari         %
 
4
%                                                        %
 
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   %
 
9
% in                                                     %
 
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.                  %
 
13
%                                                        %
 
14
% This work has the LPPL maintenance status "maintained".%
 
15
%                                                        %
 
16
% This Current Maintainer of this work                   %
 
17
% is Eitan M. Gurari.                                    %
 
18
%                                                        %
 
19
% If you modify this program your changing its signature %
 
20
% with a directive of the following form will be         %
 
21
% appreciated.                                           %
 
22
%            \message{signature}                         %
 
23
%                                                        %
 
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}
 
28
 
 
29
 
 
30
\Configure{UndefinedSec}{likepart}
 
31
\Configure{UndefinedSec}{likechapter}
 
32
\Configure{UndefinedSec}{likesection}
 
33
\Configure{UndefinedSec}{likesubsection}
 
34
 
 
35
 
 
36
 
 
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{%   
 
41
   {\cptA: \cap:ref{#1}%
 
42
\cptB:}{\cptC:{#2}\cptD:}}
 
43
 
 
44
 
 
45
\pend:def\caption{\SkipRefstepAnchor}
 
46
\long\def\c:theindex:#1#2#3#4#5#6#7#8#9{%
 
47
   \def\theindex{%
 
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}}
 
54
\def\warn:idx#1{%
 
55
  \expandafter\ifx \csname #1warn:idx\endcsname\relax
 
56
     \expandafter\global
 
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
 
62
      ^^Jinstead of
 
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.
 
66
     }%
 
67
     {\Configure{Needs}{File: #1.4idx}\Needs{}}%
 
68
  \fi}
 
69
\ifOption{info}{\Log:Note{
 
70
A script of the form
 
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
 
82
              \LNKidx{##3}\fi
 
83
           \global\let\LNKidx\empty
 
84
        \b:LNK
 
85
      \fi}%
 
86
   \def\:LNKno{0}}
 
87
\NewConfigure{LNK}{3}
 
88
\Configure{LNK}{\Link}{\EndLink}{}
 
89
 
 
90
\Configure{@begin}{theindex}{\ind:defs}
 
91
 
 
92
 
 
93
\let\o:maketitle:\maketitle
 
94
\def\maketitle{\bgroup
 
95
   \gHAdvance\:mpNum by 1
 
96
\HAssign\minipageNum=\:mpNum \relax
 
97
%
 
98
   \ifx \EndPicture\:UnDef
 
99
      \def\sec:typ{title}%
 
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
 
106
%
 
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
 
113
}{\egroup}
 
114
      \ConfigureEnv{tabular}{\empty}{}{}{}%
 
115
      %
 
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}%
 
119
      \def\and{\a:and}
 
120
%
 
121
   \fi
 
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}}
 
129
 
 
130
\append:def\quotation{\a:quotation\par\@totalleftmargin\z@}
 
131
\NewConfigure{quotation}{1}
 
132
\NewConfigure{listof}{6}
 
133
 
 
134
 
 
135
 
 
136
\edef\:TOC{%
 
137
   \noexpand\ifx [\noexpand\:temp
 
138
      \noexpand\expandafter\noexpand\:TableOfContents
 
139
   \noexpand\else
 
140
      \noexpand\Auto:ent{\ifnum \c@tocdepth >-2 part,\fi
 
141
\expandafter\ifx \csname @chapter\endcsname\relax
 
142
   \ifnum \c@tocdepth >\z@  section,\fi
 
143
\else
 
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
 
147
\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
 
152
UnDFexyz}%
 
153
   \noexpand\fi}
 
154
\def\:tableofcontents{\futurelet\:temp\:TOC}
 
155
\def\Auto:ent#1{%
 
156
   \edef\auto:toc{\noexpand\:TableOfContents[\ifx \auto:toc\:UnDef
 
157
      #1\else \auto:toc \fi]}  \auto:toc
 
158
   \global\let\auto:toc\:UnDef }
 
159
 
 
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}
 
166
\def\@starttoc#1{%
 
167
  \begingroup
 
168
    \makeatletter   \Configure{cite}{}{}{}{}%
 
169
    \def\:temp{#1}\def\:tempa{toc}%
 
170
    \a:listof\par
 
171
    \@input{\jobname.\ifx \:temp\:tempa 4ct\else #1\fi}%
 
172
    \b:listof
 
173
    \if@filesw
 
174
      \expandafter\expandafter\csname
 
175
          newwrite\endcsname\csname tf@#1\endcsname
 
176
      \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
 
177
    \fi
 
178
    \global\@nobreakfalse
 
179
  \endgroup}
 
180
 
 
181
 
 
182
 
 
183
\NewConfigure{tableofcontents*}[1]{%
 
184
   \def\:tempa{#1}\ifx\empty\:tempa
 
185
      \ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
 
186
   \else
 
187
      \edef\auto:toc{#1}%
 
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}}%
 
193
   \fi  \fi
 
194
}
 
195
     
 
196
\ifx \@openbib@code\:UnDef \else
 
197
 \pend:def\@openbib@code{\labelsep\z@}
 
198
\fi
 
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}}}
 
207
\def\:temp#1{%
 
208
  \expandafter\ifx \csname #1 \endcsname\relax\else
 
209
     \expandafter\expandafter\expandafter\:tempa\csname #1 \endcsname{#1}%
 
210
  \fi
 
211
}
 
212
\:temp{rm}
 
213
\:temp{sf}
 
214
\:temp{tt}
 
215
\:temp{bf}
 
216
\:temp{it}
 
217
 
 
218
\fi
 
219
 
 
220
\ifx \part\:UnDef\else
 
221
   \def\@part[#1]#2{%
 
222
    \ifnum \c@secnumdepth >-2\relax
 
223
      \SkipRefstepAnchor \refstepcounter{part}%
 
224
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
 
225
    \else
 
226
      \addcontentsline{toc}{part}{#1}%
 
227
    \fi
 
228
    \csname @endpart\endcsname}
 
229
\let\:tempb\part
 
230
\Def:Section\part{\thepart}{#1}
 
231
\let\:part\part
 
232
\let\part\:tempb
 
233
\let\no@part\@part
 
234
\def\@part[#1]#2{%
 
235
   {\let\addcontentsline\:gobbleIII\no@part[#1]{}}%
 
236
   \HtmlEnv   \Toc:Title{#1}\:part{#2}}
 
237
\Def:Section\likepart{}{#1}
 
238
\let\:likepart\likepart
 
239
\let\likepart\:UnDef
 
240
\let\no@spart\@spart
 
241
\def\@spart#1{%
 
242
   {\let\addcontentsline\:gobbleIII\no@spart{}}%
 
243
   \HtmlEnv   \:likepart{#1}}
 
244
 
 
245
\fi
 
246
\ifx \section\:UnDef\else
 
247
   \let\no@section\section
 
248
\Def:Section\section{\ifnum \c:secnumdepth>\c@secnumdepth   \else
 
249
   \thesection \fi}{#1}
 
250
\let\no:section\section
 
251
\def\section{\rdef:sec{section}}
 
252
\Def:Section\likesection{}{#1}
 
253
\let\:likesection\likesection
 
254
\let\likesection\:UnDef
 
255
 
 
256
\fi
 
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
 
265
 
 
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
 
274
 
 
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
 
291
 
 
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
 
302
 
 
303
  \NewConfigure{listoffigures}{2}
 
304
\NewConfigure{listoftables}{2}
 
305
 
 
306
 
 
307
\def\tableofcontents{%
 
308
   \ifx\contentsname\empty \else
 
309
      \ifx\contentsname\:UnDef \else
 
310
         %
 
311
\section*{\contentsname}%
 
312
         %
 
313
%
 
314
   \fi\fi
 
315
   \:tableofcontents}
 
316
 
 
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}
 
329
 
 
330
\Hinput{article}
 
331
\endinput
 
332