Debian Codegraph @

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

raw
1 % eplain.4ht (2021-05-23-15:14), generated from tex4ht-4ht.tex
2 % Copyright 2004-2009 Eitan M. Gurari
3 % Copyright 2009-2021 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 2021-05-23-15:14}
21
22 \pend:def\protect:wrtoc{\Configure{ }{ }}
23
24 \pend:def\flushleft{\a:flushleft}
25 \append:def\flushleft{\pend:def\@eoljustifyaction{\c:flushleft}}
26 \pend:def\@endflushleft{\b:flushleft}
27 \NewConfigure{flushleft}{3}
28 \pend:def\flushright{\a:flushright}
29 \append:def\flushright{\pend:def\@eoljustifyaction{\c:flushright}}
30 \pend:def\@endflushright{\b:flushright}
31 \NewConfigure{flushright}{3}
32 \pend:def\center{\a:center}
33 \append:def\center{\pend:def\@eoljustifyaction{\c:center}}
34 \pend:def\@endcenter{\b:center}
35 \NewConfigure{center}{3}
36 \def\:tempc#1#2#3{%
37 \html:addr
38 \o:definexref:{#1}{\Protect
39 \Link{xref\last:haddr}{}#2\Protect\EndLink}{#3}%
40 \Link{}{xref\last:haddr}\EndLink
41 }
42 \HLet\definexref\:tempc
43
44 \def\listing#1{\par \begingroup
45 \a:listing
46 \@setuplisting \setuplistinghook
47 \input #1 \b:listing
48 \endgroup
49 }%
50 \append:def\linenumberedlisting{%
51 \everypar = {\advance\lineno by 1 \HtmlPar \printlistinglineno}}
52 \NewConfigure{listing}{2}
53
54 \def\@citedef#1#2{\expandafter\gdef\csname
55 \@citelabel{#1}\endcsname{\a:cite\Link{#1}{}#2\EndLink\b:cite}}
56 \NewConfigure{cite}{2}
57 \def\biblabelprint#1{%
58 \noindent
59 \hbox to \biblabelwidth{%
60 \biblabelprecontents
61 \a:bibitem
62 \bgroup
63 \def\csname##1##2##3{##2}%
64 \edef\:temp{\noexpand\Link{}{#1}}%
65 \expandafter\egroup \:temp
66 \biblabelcontents{#1}%
67 \EndLink
68 \b:bibitem
69 \biblabelpostcontents
70 }%
71 \kern\biblabelextraspace
72 }%
73 \NewConfigure{bibitem}{2}
74 \def\:tempc{%
75 \let\:bblhook\bblhook
76 \append:def\bblhook{\expandafter\everypar
77 \expandafter{\the\everypar \HtmlPar}}%
78 \a:bibliography \o:@readbblfile: \b:bibliography
79 \let\bblhook\:bblhook}
80 \HLet\@readbblfile=\:tempc
81 \NewConfigure{bibliography}{2}
82
83 \pend:defI\readcontentsfile{\a:contents}
84 \append:defI\readcontentsfile{\b:contents}
85 \NewConfigure{contents}{2}
86 \def\tocchapterentry#1#2{\line{\bf
87 \a:tocchapterentry #1\b:tocchapterentry #2\c:tocchapterentry}}%
88 \def\tocsectionentry#1#2{\line{\sl
89 \a:tocsectionentry #1\b:tocsectionentry #2\c:tocsectionentry}}%
90 \def\tocsubsectionentry#1#2{\line{\rm
91 \a:tocsubsectionentry #1\b:tocsubsectionentry
92 #2\c:tocsubsectionentry}}%
93 \NewConfigure{tocchapterentry}{3}
94 \NewConfigure{tocsectionentry}{3}
95 \NewConfigure{tocsubsectionentry}{3}
96 \HAssign\toc:N=0
97 \def\:tempc#1#2#3#4{%
98 \def\:temp##1{%
99 \o:writenumberedcontentsentry:{#1}{#2}%
100 {\Link{toc-##1}{}#3\EndLink}{#4}}%
101 \expandafter\:temp\expandafter{\toc:N}%
102 \Link{}{toc-\toc:N}\EndLink \gHAdvance\toc:N by 1
103 }
104 \HLet\writenumberedcontentsentry=\:tempc
105
106 \pend:defII\@idxwrite{%
107 \csname if@\@idxprefix indexfileopened\endcsname \else
108 \expandafter\immediate\openout\csname @\@idxprefix indexfile\endcsname =
109 \indexfilebasename.\@idxprefix dx
110 \expandafter\global\csname @\@idxprefix indexfileopenedtrue\endcsname
111 \fi
112 \warn:idx{\jobname}\html:addr
113 \hbox{\Link-{}{x\last:haddr}\EndLink}{}%
114 \edef\:temp{\write\expandafter\noexpand\csname
115 @\@idxprefix indexfile\endcsname{\string \beforeentry{\RefFileNumber
116 \FileNumber}{x\last:haddr}{}}}\:temp
117 }
118 \def\warn:idx#1{%
119 \expandafter\ifx \csname #1warn:idx\endcsname\relax
120 \expandafter\global
121 \expandafter\let \csname #1warn:idx\endcsname\def
122 \writesixteen
123 {---------------------------------------------------------}%
124 \:warning{If not done so, the index is to be processed by
125 ^^J\space\space tex '\string\def\string\filename
126 {{#1}{idx}{4dx}{ind}} \noexpand\input\space idxmake.4ht'
127 ^^J\space\space makeindex -o #1.ind #1.4dx
128 ^^Jinstead of
129 ^^J\space\space makeindex -o #1.ind #1.idx
130 ^^JOn some platforms, the quotation marks ' should be
131 ^^J replaced by double quotation marks " or eliminated.
132 ^^J---------------------------------------------------------
133 }%
134 {\Configure{Needs}{File: #1.4idx}\Needs{}}%
135 \fi}
136 \ifOption{info}{\Log:Note{
137 A script of the form
138 ^^Jtex '\def\string\filename{{\%\%1}{idx}{4dx}{ind}}
139 \string\input\space idxmake.4ht'
140 ^^Jmakeindex -o \%\%1.ind \%\%1.4dx
141 ^^Jin the env file, automatically calls to the revised makeindex
142 ^^Jcommand. An extra compilation of the source LaTeX file is required,
143 ^^Jto get the index correctly into the output.}}{}
144 \def\ind:defs{\let\LNKidx\empty
145 \def\LNK##1##2##3##4{\ifx\NewConfigure\:UnDef\else
146 \def\LNK:number{##4}%
147 \a:LNK[##1]{##2}{}\gHAdvance\:LNKno1
148 \def\:THIrd{##3}\ifx\:THIrd\empty
149 \LNKidx{\ifx\c:LNK\empty\:LNKno\else \c:LNK\fi}\else
150 \LNKidx{##3}\fi
151 \global\let\LNKidx\empty
152 \b:LNK
153 \fi}%
154 \def\:LNKno{0}}
155 \NewConfigure{LNK}{3}
156 \Configure{LNK}{\Link}{\EndLink}{}
157 \def\yhbLNK#1{\expandafter\let\expandafter\LNKidx\csname
158 #1\endcsname\LNK}
159
160 \ind:defs
161
162 \let\:tempc\monthname
163 \pend:def\:tempc{\a:monthname}
164 \append:def\:tempc{\b:monthname}
165 \HLet\monthname\:tempc
166 \let\:tempc\fullmonthname
167 \pend:def\:tempc{\a:monthname}
168 \append:def\:tempc{\b:monthname}
169 \HLet\fullmonthname\:tempc
170 \NewConfigure{monthname}{2}
171 \let\:tempc\timestring
172 \pend:def\:tempc{\a:timestring}
173 \append:def\:tempc{\b:timestring}
174 \HLet\timestring\:tempc
175 \NewConfigure{timestring}{2}
176 \let\:tempc\timestamp
177 \pend:def\:tempc{\a:timestamp}
178 \append:def\:tempc{\b:timestamp}
179 \HLet\timestamp\:tempc
180 \NewConfigure{timestamp}{2}
181 \let\:tempc\today
182 \pend:def\:tempc{\a:today}
183 \append:def\:tempc{\b:today}
184 \HLet\today\:tempc
185 \NewConfigure{today}{2}
186
187 \long\def\vfootnote#1{%
188 \gHAdvance\FNnum 1 \def\:temp{#1}\ifx \:temp\empty
189 \def\:temp##1[##2]##3{##1[##2]{*}}\expandafter\:temp \fi
190 \def\FNmark{#1}%
191 \a:vfootnote\b:vfootnote\bgroup
192 \futurelet\:temp\fnt:body}
193 \def\fnt:body{\ifx \:temp\bgroup \bgroup
194 \aftergroup\end:vfootnote\def\:temp{\let\:temp}%
195 \else \def\:temp##1{##1\end:vfootnote}\fi
196 \:temp}
197 \def\end:vfootnote{\egroup\c:vfootnote}
198 \HAssign\FNnum 0
199 \NewConfigure{vfootnote}{3}
200
201 \NewConfigure{li}{2}
202 \def\@finli{%
203 \a:li
204 \ifnum\itemnumber=1 \else \interitemskip \fi
205 \printitem
206 \b:li
207 \ifx\@optionalarg\empty \else
208 \expandafter\writeitemxref\expandafter{\@optionalarg}%
209 \fi
210 \advance\itemnumber by 1
211 \advance\itemletter by 1
212 \advance\itemromannumeral by 1
213 \ignorespaces
214 }
215 \NewConfigure{numberedlist}{4}
216 \append:def\numberedlist{\a:numberedlist
217 \Configure{li}{\c:numberedlist}{\d:numberedlist}}
218 \pend:def\endnumberedlist{\b:numberedlist}
219 \NewConfigure{orderedlist}{4}
220 \append:def\orderedlist{\a:orderedlist
221 \Configure{li}{\c:orderedlist}{\d:orderedlist}}
222 \pend:def\endorderedlist{\b:orderedlist}
223 \NewConfigure{unorderedlist}{4}
224 \append:def\unorderedlist{\a:unorderedlist
225 \Configure{li}{\c:unorderedlist}{\d:unorderedlist}}
226 \pend:def\endunorderedlist{\b:unorderedlist}
227
228 \catcode`\:=12
229 \def\makecolumns#1/#2: {\par \begingroup
230 \@columndepth = #1
231 \advance\@columndepth by #2
232 \advance\@columndepth by -1
233 \divide \@columndepth by #2
234 \@linestogoincolumn = \@columndepth
235 \@linestogo = #1
236 \currentcolumn = 1
237 \def\@endcolumnactions{%
238 \ifnum \@linestogo<2
239 \the\crtok \egroup
240 \csname b:makecolumns\endcsname \endgroup \par
241 \else
242 \global\advance\@linestogo by -1
243 \ifnum\@linestogoincolumn<2
244 \global\advance\currentcolumn by 1
245 \global\@linestogoincolumn = \@columndepth
246 \expandafter\gdef\csname :makecolumn\endcsname{\csname
247 c:makecolumns\endcsname
248 \expandafter\global\expandafter\let
249 \csname :makecolumn\endcsname\empty}\the\crtok
250 \else
251 &\global\advance\@linestogoincolumn by -1
252 \fi
253 \fi
254 }%
255 \makeactive\^^M
256 \letreturn \@endcolumnactions
257 \@columnwidth = \hsize
258 \advance\@columnwidth by -\parindent
259 \divide\@columnwidth by #2
260 \penalty\abovecolumnspenalty
261 \noindent \csname a:makecolumns\endcsname
262 \valign\bgroup
263 &\hbox to \@columnwidth{\strut \hsize = \@columnwidth
264 \csname d:makecolumns\endcsname
265 ##\csname e:makecolumns\endcsname
266 \csname :makecolumn\endcsname \hfil}\cr
267 }
268 \catcode`\:=11
269 \let\:makecolumn=\empty
270 \NewConfigure{makecolumns}{5}
271 \def\@columns#1{\def\NumColumns{#1}\a:columns\singlecolumn
272 \ifx \@ndcolumns\relax \let\@ndcolumns=\empty \fi
273 \append:def\@ndcolumns{\b:columns}}
274 \NewConfigure{columns}{2}
275
276 \footline={\hfil} \headline={\hfil}
277 \tmp:cnt\time \divide\tmp:cnt 60
278 \edef\:temp{\the\tmp:cnt}
279 \multiply\tmp:cnt -60 \advance\tmp:cnt \time
280 \edef\:today{\the\year-\ifnum \month<10 0\fi
281 \the\month-\ifnum \day<10 0\fi\the\day
282 \space\ifnum \:temp<10 0\fi \:temp
283 :\ifnum \tmp:cnt<10 0\fi\the\tmp:cnt :00}
284
285
286 \Hinput{eplain}
287 \endinput
288