Debian Codegraph @

texmf-dist/tex/generic/tex4ht/article.4ht

raw
1 % article.4ht (2023-04-10-13:46), generated from tex4ht-4ht.tex
2 % Copyright 1997-2009 Eitan M. Gurari
3 % Copyright 2009-2023 TeX Users Group
4 %
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either
7 % version 1.3c of this license or (at your option) any
8 % later version. The latest version of this license is in
9 % http://www.latex-project.org/lppl.txt
10 % and version 1.3c or later is part of all distributions
11 % of LaTeX version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status "maintained".
14 %
15 % The Current Maintainer of this work
16 % is the TeX4ht Project <http://tug.org/tex4ht>.
17 %
18 % If you modify this program, changing the
19 % version identification would be appreciated.
20 \immediate\write-1{version 2023-04-10-13:46}
21
22
23 \Configure{UndefinedSec}{likepart}
24 \Configure{UndefinedSec}{likechapter}
25 \Configure{UndefinedSec}{likesection}
26 \Configure{UndefinedSec}{likesubsection}
27
28
29
30 \append:def\quote{\par\@totalleftmargin\z@}
31 \NewConfigure{caption}[4]{\c:def\cptA:{#1}\c:def\cptB:{#2}%
32 \c:def\cptC:{#3}\c:def\cptD:{#4}}
33 \long\def\@makecaption#1#2{%
34 {\cptA: \cap:ref{#1}%
35 \if :#1:\else\cptB:\fi}{\cptC:{#2}\cptD:}}
36
37
38 \pend:def\caption{\SkipRefstepAnchor}
39 \long\def\c:theindex:#1#2#3#4#5#6#7#8#9{%
40 \def\theindex{\SaveEverypar\ht:everypar{}#1%
41 \def\idx:item{}%
42 \def\endtheindex{\idx:item#2\RecallEverypar}%
43 \def\item{\idx:item\def\idx:item{#4}\let\index\@gobble #3}%
44 \def\subitem{\idx:item\def\idx:item{#6}\let\index\@gobble #5}%
45 \def\subsubitem{\idx:item\def\idx:item{#8}\let\index\@gobble #7}}%
46 \def\indexspace{\idx:item#9\let\idx:item\empty}}
47 \def\warn:idx#1{%
48 \expandafter\ifx \csname #1warn:idx\endcsname\relax
49 \expandafter\global
50 \expandafter\let \csname #1warn:idx\endcsname\def
51 \writesixteen
52 {---------------------------------------------------------}%
53 \:warning{If not done so, the index is to be processed by
54 ^^J\space\space tex '\string\def\string\filename
55 {{#1}{idx}{4dx}{ind}} \noexpand\input\space idxmake.4ht'
56 ^^J\space\space makeindex -o #1.ind #1.4dx
57 ^^Jinstead of
58 ^^J\space\space makeindex -o #1.ind #1.idx
59 ^^JOn some platforms, the quotation marks ' should be
60 ^^J replaced by double quotation marks " or eliminated.
61 ^^J---------------------------------------------------------
62 }%
63 {\Configure{Needs}{File: #1.4idx}\Needs{}}%
64 \fi}
65 \ifOption{info}{\Log:Note{
66 A script of the form
67 ^^Jtex '\def\string\filename{{\%\%1}{idx}{4dx}{ind}}
68 \string\input\space idxmake.4ht'
69 ^^Jmakeindex -o \%\%1.ind \%\%1.4dx
70 ^^Jin the env file, automatically calls to the revised makeindex
71 ^^Jcommand. An extra compilation of the source LaTeX file is required,
72 ^^Jto get the index correctly into the output.}}{}
73 \def\ind:defs{\let\LNKidx\empty
74 \def\LNK##1##2##3##4{\ifx\NewConfigure\:UnDef\else
75 \def\LNK:number{##4}%
76 \a:LNK[##1]{##2}{}\gHAdvance\:LNKno1
77 \def\:THIrd{##3}\ifx\:THIrd\empty
78 \LNKidx{\ifx\c:LNK\empty\:LNKno\else \c:LNK\fi}\else
79 \LNKidx{##3}\fi
80 \global\let\LNKidx\empty
81 \b:LNK
82 \fi}%
83 \def\:LNKno{0}}
84 \NewConfigure{LNK}{3}
85 \Configure{LNK}{\Link}{\EndLink}{}
86 \def\yhbLNK#1{\expandafter\let\expandafter\LNKidx\csname
87 #1\endcsname\LNK}
88
89 \Configure{@begin}{theindex}{\ind:defs}
90
91
92 \let\o:maketitle:\maketitle
93 \def\maketitle{\bgroup
94 \gHAdvance\:mpNum by 1
95 \HAssign\minipageNum=\:mpNum \relax
96 %
97 \ifx \EndPicture\:UnDef
98 \def\sec:typ{title}%
99 \Configure{HtmlPar}{}{}{}{}%
100 \Configure{newpage}{}%
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:date}\append:def\@date{\b:date}%
118 \pend:def\@author{\a:author}\append:def\@author{\b:author}%
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:author{#3}\c:def\b:author{#4}%
128 \c:def\a:date{#5}\c:def\b:date{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}
129
130 \long\def\:tempc{\@roman \c@enumiii}
131 \ifx \theenumiii\:tempc
132 \def\:tempc{\a:enumiii\@roman\c@enumiii\b:enumiii}
133 \HLet\theenumiii\:tempc
134 \fi
135 \NewConfigure{enumiii}{2}
136 \append:def\quotation{\a:quotation\par\@totalleftmargin\z@}
137 \NewConfigure{quotation}{1}
138 \NewConfigure{listof}{6}
139
140 \NewConfigure{abstracttitle}{2}
141 \AtBeginEnvironment[tex4ht]{abstract}{\ConfigureEnv{center}{\a:abstracttitle}{\b:abstracttitle}{\@empty}{\@empty}}
142
143
144 \edef\:TOC{%
145 \noexpand\ifx [\noexpand\:temp
146 \noexpand\expandafter\noexpand\:TableOfContents
147 \noexpand\else
148 \noexpand\Auto:ent{\ifnum \c@tocdepth >-2 part,\fi
149 \expandafter\ifx \csname @chapter\endcsname\relax
150 \ifnum \c@tocdepth >\z@ section,\fi
151 \else
152 \ifnum \c@tocdepth >\m@ne chapter,appendix,\fi
153 \ifnum \c@tocdepth>0 section,\fi
154 \fi
155 \ifnum \c@tocdepth>1 subsection,\fi
156 \ifnum \c@tocdepth>2 subsubsection,\fi
157 \ifnum \c@tocdepth>3 paragraph,\fi
158 \ifnum \c@tocdepth>4 subparagraph,\fi
159 UnDFexyz}%
160 \noexpand\fi}
161 \def\:tableofcontents{\futurelet\:temp\:TOC}
162 \def\Auto:ent#1{%
163 \edef\auto:toc{\noexpand\:TableOfContents[\ifx \auto:toc\:UnDef
164 #1\else \auto:toc \fi]} \auto:toc
165 \global\let\auto:toc\:UnDef }
166
167 \def\:tocs{\noexpand\:tableofcontents}
168 \pend:defIII\addcontentsline{%
169 \def\:temp{##1}\def\:tempa{toc}\ifx \:temp\:tempa
170 \gHAdvance\TitleCount 1 \fi }
171 \def\@dottedtocline#1#2#3#4#5{\hbox{\def\numberline##1{\e:listof
172 ##1\f:listof}\c:listof#4\d:listof}\ignorespaces}
173 \def\@starttoc#1{%
174 \begingroup
175 \makeatletter \Configure{cite}{}{}{}{}%
176 \def\:temp{#1}\def\:tempa{toc}%
177 \a:listof\par
178 \@input{\jobname.\ifx \:temp\:tempa 4ct\else #1\fi}%
179 \b:listof
180 \if@filesw
181 \expandafter\expandafter\csname
182 newwrite\endcsname\csname tf@#1\endcsname
183 \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
184 \fi
185 \global\@nobreakfalse
186 \endgroup}
187
188
189
190 \NewConfigure{tableofcontents*}[1]{%
191 \def\:tempa{#1}\ifx\empty\:tempa
192 \ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
193 \else
194 \edef\auto:toc{#1}%
195 \ifx \au:StartSec\:UnDef
196 \let\au:StartSec\:StartSec
197 \def\:StartSec{\:tableofcontents
198 \global\let\auto:toc\:UnDef \global\let\:StartSec\au:StartSec\:StartSec}%
199 \append:def\tableofcontents{\gdef\:StartSec{\au:StartSec}}%
200 \fi \fi
201 }
202
203 \ifx \@openbib@code\:UnDef \else
204 \pend:def\@openbib@code{\labelsep\z@}
205 \fi
206 \ifx \part\:UnDef\else
207 \def\@part[#1]#2{%
208 \ifnum \c@secnumdepth >-2\relax
209 \SkipRefstepAnchor \refstepcounter{part}%
210 \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
211 \else
212 \addcontentsline{toc}{part}{#1}%
213 \fi
214 }
215 \let\:tempb\part
216 \Def:Section\part{\thepart}{#1}
217 \let\:part\part
218 \let\part\:tempb
219 \let\no@part\@part
220 \def\@part[#1]#2{%
221 {\let\addcontentsline\:gobbleIII\no@part[#1]{}}%
222 \HtmlEnv \Toc:Title{#1}\:part{#2}%
223 \csname @endpart\endcsname%
224 }
225 \Def:Section\likepart{}{#1}
226 \let\:likepart\likepart
227 \let\likepart\:UnDef
228 \let\no@spart\@spart
229 \def\@spart#1{%
230 {\let\addcontentsline\:gobbleIII\no@spart{}}%
231 \HtmlEnv \:likepart{#1}}
232
233 \fi
234 \ifx \section\:UnDef\else
235 \let\no@section\section
236 \Def:Section\section{\ifnum \c:secnumdepth>\c@secnumdepth \else
237 \thesection \fi}{#1}
238 \let\no:section\section
239 \def\section{\rdef:sec{section}}
240 \Def:Section\likesection{}{#1}
241 \let\:likesection\likesection
242 \let\likesection\:UnDef
243
244 \fi
245 \let\no@subsection\subsection
246 \Def:Section\subsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
247 \thesubsection \fi}{#1}
248 \let\no:subsection\subsection
249 \def\subsection{\rdef:sec{subsection}}
250 \Def:Section\likesubsection{}{#1}
251 \let\:likesubsection\likesubsection
252 \let\likesubsection\:UnDef
253
254 \let\no@subsubsection\subsubsection
255 \Def:Section\subsubsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
256 \thesubsubsection \fi}{#1}
257 \let\no:subsubsection\subsubsection
258 \def\subsubsection{\rdef:sec{subsubsection}}
259 \Def:Section\likesubsubsection{}{#1}
260 \let\:likesubsubsection\likesubsubsection
261 \let\likesubsubsection\:UnDef
262
263 \let\no@paragraph\paragraph
264 \Def:Section\paragraph{\ifnum \c:secnumdepth>\c@secnumdepth \else
265 \theparagraph \fi}{#1}
266 \let\no:paragraph\paragraph
267 \def\paragraph{\rdef:sec{paragraph}}
268 \Def:Section\likeparagraph{}{#1}
269 \let\:likeparagraph\likeparagraph
270 \let\likeparagraph\:UnDef
271 \let\no@subparagraph\subparagraph
272 \Def:Section\subparagraph{\ifnum \c:secnumdepth>\c@secnumdepth \else
273 \thesubparagraph \fi}{#1}
274 \let\no:subparagraph\subparagraph
275 \def\subparagraph{\rdef:sec{subparagraph}}
276 \Def:Section\likesubparagraph{}{#1}
277 \let\:likesubparagraph\likesubparagraph
278 \let\likesubparagraph\:UnDef
279
280 \let\:tempc\listoffigures
281 \pend:def\:tempc{\begingroup \a:listoffigures
282 \def\@starttoc{\:tableofcontents[lof]\:gobble}}
283 \append:def\:tempc{\b:listoffigures \endgroup}
284 \HLet\listoffigures\:tempc
285 \let\:tempc\listoftables
286 \pend:def\:tempc{\begingroup \a:listoftables
287 \def\@starttoc{\:tableofcontents[lot]\:gobble}}
288 \append:def\:tempc{\b:listoftables \endgroup}
289 \HLet\listoftables\:tempc
290
291 \NewConfigure{listoffigures}{2}
292 \NewConfigure{listoftables}{2}
293
294
295 \def\tableofcontents{%
296 \ifx\contentsname\empty \else
297 \ifx\contentsname\:UnDef \else
298 %
299 \section*{\contentsname}%
300 %
301 %
302 \fi\fi
303 \:tableofcontents}
304
305 \ConfigureToc{likeparagraph} {}{\empty}{}{\newline}
306 \ConfigureToc{likepart} {}{\empty}{}{\newline}
307 \ConfigureToc{likesection} {}{\empty}{}{\newline}
308 \ConfigureToc{likesubparagraph} {}{\empty}{}{\newline}
309 \ConfigureToc{likesubsection} {}{\empty}{}{\newline}
310 \ConfigureToc{likesubsubsection} {}{\empty}{}{\newline}
311 \ConfigureToc{paragraph} {\empty}{\ }{}{\newline}
312 \ConfigureToc{part} {\empty}{\ }{}{\newline}
313 \ConfigureToc{section} {\empty}{\ }{}{\newline}
314 \ConfigureToc{subparagraph} {\empty}{\ }{}{\newline}
315 \ConfigureToc{subsection} {\empty}{\ }{}{\newline}
316 \ConfigureToc{subsubsection} {\empty}{\ }{}{\newline}
317
318 \Hinput{article}
319 \endinput
320