Debian Codegraph @

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

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