Debian Codegraph @

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

raw
1 % book.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 \Configure{UndefinedSec}{likepart}
23 \Configure{UndefinedSec}{likechapter}
24 \Configure{UndefinedSec}{likesection}
25 \Configure{UndefinedSec}{likesubsection}
26
27 \def\tableofcontents{%
28 \ifx\contentsname\empty \else
29 %
30 \chapter*{\contentsname}%
31 %
32 %
33 \fi
34 \:tableofcontents}
35
36 \let\:tempb\chapter
37 \Def:Section\chapter{\thechapter}{#1}
38 \let\:chapter\chapter
39 \let\chapter\:tempb
40 \def\@makechapterhead#1{}
41 \let\no@chapter\@chapter
42 \def\@chapter[#1]#2{%
43 \gHAdvance\:mpNum by 1
44 \HAssign\minipageNum=\:mpNum \relax
45 %
46 {\SkipRefstepAnchor \let\addcontentsline\:gobbleIII\no@chapter[#1]{}}%
47 \HtmlEnv \Toc:Title{#1}\:chapter{#2}}
48 \Def:Section\likechapter{}{#1}
49 \let\:likechapter\likechapter
50 \let\likechapter\:UnDef
51 \let\no@schapter\@schapter
52 \def\@schapter#1{%
53 \gdef\sch:ttl{#1}%
54 %
55 {\let\addcontentsline\:gobbleIII\no@schapter{}}%
56 \HtmlEnv \:likechapter{#1}}
57 \let\no@appendix\appendix
58 \Def:Section\appendix{\thechapter}{#1}
59 \let\:appendix\appendix
60 \def\appendix{%
61 \def\@chapter[##1]##2{%
62 \gHAdvance\:mpNum by 1
63 \HAssign\minipageNum=\:mpNum \relax
64 %
65 {\def\addcontentsline####1####2####3{}\no@chapter[##1]{}}%
66 \HtmlEnv \Toc:Title{##1}\:appendix{##2}}%
67 \no@appendix}
68
69
70 \edef\:TOC{%
71 \noexpand\ifx [\noexpand\:temp
72 \noexpand\expandafter\noexpand\:TableOfContents
73 \noexpand\else
74 \noexpand\Auto:ent{\ifnum \c@tocdepth >-2 part,\fi
75 \expandafter\ifx \csname @chapter\endcsname\relax
76 \ifnum \c@tocdepth >\z@ section,\fi
77 \else
78 \ifnum \c@tocdepth >\m@ne chapter,appendix,\fi
79 \ifnum \c@tocdepth>0 section,\fi
80 \fi
81 \ifnum \c@tocdepth>1 subsection,\fi
82 \ifnum \c@tocdepth>2 subsubsection,\fi
83 \ifnum \c@tocdepth>3 paragraph,\fi
84 \ifnum \c@tocdepth>4 subparagraph,\fi
85 UnDFexyz}%
86 \noexpand\fi}
87 \def\:tableofcontents{\futurelet\:temp\:TOC}
88 \def\Auto:ent#1{%
89 \edef\auto:toc{\noexpand\:TableOfContents[\ifx \auto:toc\:UnDef
90 #1\else \auto:toc \fi]} \auto:toc
91 \global\let\auto:toc\:UnDef }
92
93 \def\:tocs{\noexpand\:tableofcontents}
94 \pend:defIII\addcontentsline{%
95 \def\:temp{##1}\def\:tempa{toc}\ifx \:temp\:tempa
96 \gHAdvance\TitleCount 1 \fi }
97 \def\@dottedtocline#1#2#3#4#5{\hbox{\def\numberline##1{\e:listof
98 ##1\f:listof}\c:listof#4\d:listof}\ignorespaces}
99 \def\@starttoc#1{%
100 \begingroup
101 \makeatletter \Configure{cite}{}{}{}{}%
102 \def\:temp{#1}\def\:tempa{toc}%
103 \a:listof\par
104 \@input{\jobname.\ifx \:temp\:tempa 4ct\else #1\fi}%
105 \b:listof
106 \if@filesw
107 \expandafter\expandafter\csname
108 newwrite\endcsname\csname tf@#1\endcsname
109 \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
110 \fi
111 \global\@nobreakfalse
112 \endgroup}
113
114
115
116 \NewConfigure{tableofcontents*}[1]{%
117 \def\:tempa{#1}\ifx\empty\:tempa
118 \ifx \au:StartSec\:UnDef \else \gdef\:StartSec{\au:StartSec}\fi
119 \else
120 \edef\auto:toc{#1}%
121 \ifx \au:StartSec\:UnDef
122 \let\au:StartSec\:StartSec
123 \def\:StartSec{\:tableofcontents
124 \global\let\auto:toc\:UnDef \global\let\:StartSec\au:StartSec\:StartSec}%
125 \append:def\tableofcontents{\gdef\:StartSec{\au:StartSec}}%
126 \fi \fi
127 }
128
129 \ifx \@openbib@code\:UnDef \else
130 \pend:def\@openbib@code{\labelsep\z@}
131 \fi
132 \ifx \part\:UnDef\else
133 \def\@part[#1]#2{%
134 \ifnum \c@secnumdepth >-2\relax
135 \SkipRefstepAnchor \refstepcounter{part}%
136 \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
137 \else
138 \addcontentsline{toc}{part}{#1}%
139 \fi
140 }
141 \let\:tempb\part
142 \Def:Section\part{\thepart}{#1}
143 \let\:part\part
144 \let\part\:tempb
145 \let\no@part\@part
146 \def\@part[#1]#2{%
147 {\let\addcontentsline\:gobbleIII\no@part[#1]{}}%
148 \HtmlEnv \Toc:Title{#1}\:part{#2}%
149 \csname @endpart\endcsname%
150 }
151 \Def:Section\likepart{}{#1}
152 \let\:likepart\likepart
153 \let\likepart\:UnDef
154 \let\no@spart\@spart
155 \def\@spart#1{%
156 {\let\addcontentsline\:gobbleIII\no@spart{}}%
157 \HtmlEnv \:likepart{#1}}
158
159 \fi
160 \ifx \section\:UnDef\else
161 \let\no@section\section
162 \Def:Section\section{\ifnum \c:secnumdepth>\c@secnumdepth \else
163 \thesection \fi}{#1}
164 \let\no:section\section
165 \def\section{\rdef:sec{section}}
166 \Def:Section\likesection{}{#1}
167 \let\:likesection\likesection
168 \let\likesection\:UnDef
169
170 \fi
171 \let\no@subsection\subsection
172 \Def:Section\subsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
173 \thesubsection \fi}{#1}
174 \let\no:subsection\subsection
175 \def\subsection{\rdef:sec{subsection}}
176 \Def:Section\likesubsection{}{#1}
177 \let\:likesubsection\likesubsection
178 \let\likesubsection\:UnDef
179
180 \let\no@subsubsection\subsubsection
181 \Def:Section\subsubsection{\ifnum \c:secnumdepth>\c@secnumdepth \else
182 \thesubsubsection \fi}{#1}
183 \let\no:subsubsection\subsubsection
184 \def\subsubsection{\rdef:sec{subsubsection}}
185 \Def:Section\likesubsubsection{}{#1}
186 \let\:likesubsubsection\likesubsubsection
187 \let\likesubsubsection\:UnDef
188
189 \let\no@paragraph\paragraph
190 \Def:Section\paragraph{\ifnum \c:secnumdepth>\c@secnumdepth \else
191 \theparagraph \fi}{#1}
192 \let\no:paragraph\paragraph
193 \def\paragraph{\rdef:sec{paragraph}}
194 \Def:Section\likeparagraph{}{#1}
195 \let\:likeparagraph\likeparagraph
196 \let\likeparagraph\:UnDef
197 \let\no@subparagraph\subparagraph
198 \Def:Section\subparagraph{\ifnum \c:secnumdepth>\c@secnumdepth \else
199 \thesubparagraph \fi}{#1}
200 \let\no:subparagraph\subparagraph
201 \def\subparagraph{\rdef:sec{subparagraph}}
202 \Def:Section\likesubparagraph{}{#1}
203 \let\:likesubparagraph\likesubparagraph
204 \let\likesubparagraph\:UnDef
205
206 \let\:tempc\listoffigures
207 \pend:def\:tempc{\begingroup \a:listoffigures
208 \def\@starttoc{\:tableofcontents[lof]\:gobble}}
209 \append:def\:tempc{\b:listoffigures \endgroup}
210 \HLet\listoffigures\:tempc
211 \let\:tempc\listoftables
212 \pend:def\:tempc{\begingroup \a:listoftables
213 \def\@starttoc{\:tableofcontents[lot]\:gobble}}
214 \append:def\:tempc{\b:listoftables \endgroup}
215 \HLet\listoftables\:tempc
216
217 \NewConfigure{listoffigures}{2}
218 \NewConfigure{listoftables}{2}
219
220
221
222 \append:def\quote{\par\@totalleftmargin\z@}
223 \NewConfigure{caption}[4]{\c:def\cptA:{#1}\c:def\cptB:{#2}%
224 \c:def\cptC:{#3}\c:def\cptD:{#4}}
225 \long\def\@makecaption#1#2{%
226 {\cptA: \cap:ref{#1}%
227 \if :#1:\else\cptB:\fi}{\cptC:{#2}\cptD:}}
228
229
230 \pend:def\caption{\SkipRefstepAnchor}
231 \long\def\c:theindex:#1#2#3#4#5#6#7#8#9{%
232 \def\theindex{\SaveEverypar\ht:everypar{}#1%
233 \def\idx:item{}%
234 \def\endtheindex{\idx:item#2\RecallEverypar}%
235 \def\item{\idx:item\def\idx:item{#4}\let\index\@gobble #3}%
236 \def\subitem{\idx:item\def\idx:item{#6}\let\index\@gobble #5}%
237 \def\subsubitem{\idx:item\def\idx:item{#8}\let\index\@gobble #7}}%
238 \def\indexspace{\idx:item#9\let\idx:item\empty}}
239 \def\warn:idx#1{%
240 \expandafter\ifx \csname #1warn:idx\endcsname\relax
241 \expandafter\global
242 \expandafter\let \csname #1warn:idx\endcsname\def
243 \writesixteen
244 {---------------------------------------------------------}%
245 \:warning{If not done so, the index is to be processed by
246 ^^J\space\space tex '\string\def\string\filename
247 {{#1}{idx}{4dx}{ind}} \noexpand\input\space idxmake.4ht'
248 ^^J\space\space makeindex -o #1.ind #1.4dx
249 ^^Jinstead of
250 ^^J\space\space makeindex -o #1.ind #1.idx
251 ^^JOn some platforms, the quotation marks ' should be
252 ^^J replaced by double quotation marks " or eliminated.
253 ^^J---------------------------------------------------------
254 }%
255 {\Configure{Needs}{File: #1.4idx}\Needs{}}%
256 \fi}
257 \ifOption{info}{\Log:Note{
258 A script of the form
259 ^^Jtex '\def\string\filename{{\%\%1}{idx}{4dx}{ind}}
260 \string\input\space idxmake.4ht'
261 ^^Jmakeindex -o \%\%1.ind \%\%1.4dx
262 ^^Jin the env file, automatically calls to the revised makeindex
263 ^^Jcommand. An extra compilation of the source LaTeX file is required,
264 ^^Jto get the index correctly into the output.}}{}
265 \def\ind:defs{\let\LNKidx\empty
266 \def\LNK##1##2##3##4{\ifx\NewConfigure\:UnDef\else
267 \def\LNK:number{##4}%
268 \a:LNK[##1]{##2}{}\gHAdvance\:LNKno1
269 \def\:THIrd{##3}\ifx\:THIrd\empty
270 \LNKidx{\ifx\c:LNK\empty\:LNKno\else \c:LNK\fi}\else
271 \LNKidx{##3}\fi
272 \global\let\LNKidx\empty
273 \b:LNK
274 \fi}%
275 \def\:LNKno{0}}
276 \NewConfigure{LNK}{3}
277 \Configure{LNK}{\Link}{\EndLink}{}
278 \def\yhbLNK#1{\expandafter\let\expandafter\LNKidx\csname
279 #1\endcsname\LNK}
280
281 \Configure{@begin}{theindex}{\ind:defs}
282
283
284 \let\o:maketitle:\maketitle
285 \def\maketitle{\bgroup
286 \gHAdvance\:mpNum by 1
287 \HAssign\minipageNum=\:mpNum \relax
288 %
289 \ifx \EndPicture\:UnDef
290 \def\sec:typ{title}%
291 \Configure{HtmlPar}{}{}{}{}%
292 \Configure{newpage}{}%
293 \ConfigureEnv{center}{\empty}{}{\empty}{\empty}
294 \let\a:tabular:sv\a:tabular \let\b:tabular:sv\b:tabular
295 \let\c:tabular:sv\c:tabular \let\d:tabular:sv\d:tabular
296 \let\e:tabular:sv\e:tabular \let\f:tabular:sv\f:tabular
297 \let\before:begintabular:sv\before:begintabular
298 %
299 \Configure{HBorder}{}{}{}{}{}{}{}{}{}{}%
300 \Configure{tabular}{}{}{}{\e:mktl}
301 {\bgroup \let\a:tabular\a:tabular:sv \let\b:tabular\b:tabular:sv
302 \let\c:tabular\c:tabular:sv \let\d:tabular\d:tabular:sv
303 \let\e:tabular\e:tabular:sv \let\f:tabular\f:tabular:sv
304 \let\before:begintabular\before:begintabular:sv
305 }{\egroup}
306 \ConfigureEnv{tabular}{\empty}{}{}{}%
307 %
308 \pend:def\@title{\a:ttl}\append:def\@title{\b:ttl}%
309 \pend:def\@date{\a:date}\append:def\@date{\b:date}%
310 \pend:def\@author{\a:author}\append:def\@author{\b:author}%
311 \def\and{\a:and}
312 %
313 \fi
314 \pic:gobble\a:mktl \o:maketitle: \pic:gobble\b:mktl
315 \egroup \let\maketitle\empty}
316 \NewConfigure{maketitle}[4]{\c:def\a:mktl{#1}\c:def\b:mktl{#2}%
317 \c:def\a:ttl{#3}\c:def\b:ttl{#4}}
318 \NewConfigure{thanks author date and}[8]{%
319 \c:def\a:thanks{#1}\c:def\b:thanks{#2}\c:def\a:author{#3}\c:def\b:author{#4}%
320 \c:def\a:date{#5}\c:def\b:date{#6}\c:def\a:and{#7}\c:def\e:mktl{#8}}
321
322 \long\def\:tempc{\@roman \c@enumiii}
323 \ifx \theenumiii\:tempc
324 \def\:tempc{\a:enumiii\@roman\c@enumiii\b:enumiii}
325 \HLet\theenumiii\:tempc
326 \fi
327 \NewConfigure{enumiii}{2}
328 \append:def\quotation{\a:quotation\par\@totalleftmargin\z@}
329 \NewConfigure{quotation}{1}
330 \NewConfigure{listof}{6}
331
332 \ConfigureToc{likeparagraph} {}{\empty}{}{\newline}
333 \ConfigureToc{likepart} {}{\empty}{}{\newline}
334 \ConfigureToc{likesection} {}{\empty}{}{\newline}
335 \ConfigureToc{likesubparagraph} {}{\empty}{}{\newline}
336 \ConfigureToc{likesubsection} {}{\empty}{}{\newline}
337 \ConfigureToc{likesubsubsection} {}{\empty}{}{\newline}
338 \ConfigureToc{paragraph} {\empty}{\ }{}{\newline}
339 \ConfigureToc{part} {\empty}{\ }{}{\newline}
340 \ConfigureToc{section} {\empty}{\ }{}{\newline}
341 \ConfigureToc{subparagraph} {\empty}{\ }{}{\newline}
342 \ConfigureToc{subsection} {\empty}{\ }{}{\newline}
343 \ConfigureToc{subsubsection} {\empty}{\ }{}{\newline}
344
345 \ConfigureToc{appendix} {\empty}{\ }{}{\newline}
346 \ConfigureToc{chapter} {\empty}{\ }{}{\newline}
347 \ConfigureToc{likechapter} {}{\empty}{}{\newline}
348
349 \Hinput{book}
350 \endinput
351