Debian Codegraph @

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

raw
1 % mkht.4ht (2023-09-10-08:49), generated from tex4ht-mkht.tex
2 % Copyright 2009-2023 TeX Users Group
3 % Copyright 1997-2009 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.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 <https://tug.org/tex4ht>.
17 %
18 % If you modify this program, changing the
19 % version identification would be appreciated.
20 %
21 \immediate\write-1{version \ifx \JOBNAME\UnDefined 2023-09-10-08:49\else |version\fi}
22
23 \immediate\write-1{version 2023-09-10-08:49}
24
25 \def\exit{\documentclass{article}\begin{document}\end{document}\endinput}
26 \bgroup
27 \def\missing#1{\aftergroup\exit
28 \immediate\write16{---------------------------- error
29 ----------------------------
30 ^^JRequires #1ProTex.sty from
31 https://tug.org/tex4ht^^J%
32 ---------------------------------------------------------------}}
33 \openin15=ProTex.sty \ifeof15 \missing{}\else \closein15 \fi
34 \openin15=AlProTex.sty \ifeof15 \missing{Al}\else \closein15 \fi
35 \egroup
36
37 \let\ScriptFileName\relax
38 \let\AddExtn\relax
39
40 \documentclass{article}
41
42 \ifx \HCode\UnDef
43 \input tex4ht.sty
44 \Preamble{xhtml}
45 \input ProTex.sty
46 \AlProTex{foo,<<<>>>,|,title,list}
47 \begin{document}
48 \EndPreamble
49 \else
50 \Configure{ProTex}{foo,<<<>>>,|,title,list,[[]]}
51 \begin{document}
52 \fi
53
54 \catcode`\:=11
55 \def\OutputCodE\<#1.#2\>{{\xdef\ScriptFileName{#1}
56 \:DoName\def{#1}{\<#1.#2\>}
57 \OutputCode[#2]\<#1\>}}
58 \def\winextn{bat}
59 \def\AddExtn{\ifx\ext\winextn .bat\fi}
60
61 \tableofcontents
62
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 \section{LaTeX}
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66
67
68 \<htlatex ...\><<<
69 |<unix line|>|<windows line|>
70 |<latex|>
71 |<latex|>
72 |<latex|>
73 |<base|>tex4ht |<dir ch|>|<@|>1 |<III|>
74 |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>
75
76 >>>
77
78
79 \<latex\><<<
80 latex |<@|>5 |<'|>|<definitions|>|<get parameters|>|empty>>>
81
82 \<get parameters\><<<
83 \HCode |<'|>|<@|>2|<'|>.a.b.c.\input |<'|> |<@|>1>>>
84
85
86 \<definitions\><<<
87 \makeatletter|<get 2nd arg|>|<2e + 209|>\makeatother>>>
88
89 \<get 2nd arg\><<<
90 \def\HCode{\futurelet\HCode\HChar}\def\HChar{|<double quotes?|>}>>>
91
92 \<double quotes?\><<<
93 \ifx"\HCode|<remove qts|>\expandafter\HCode\else\expandafter\Link\fi>>>
94
95 \<remove qts\><<<
96 \def\HCode"##1"{\Link##1}>>>
97
98
99 \<2e + 209\><<<
100 \def\Link#1.a.b.c.{|<2e|>|<209|>}>>>
101
102 \<2e\><<<
103 \g@addto@macro\@documentclasshook{|<require package|>}>>>
104
105 \<209\><<<
106 |<save|>\def\documentstyle{|<recall|>|<options|>|<209+tex4ht|>}>>>
107
108 \<require package\><<<
109 \RequirePackage[#1|<II|>|<,html|>]{tex4ht}>>>
110
111
112 \<options\><<<
113 |<def tex4ht|>{#1|<II|>|<,html|>}>>>
114
115
116 \<209+tex4ht\><<<
117 |<209+tex4ht+...|>\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}>>>
118
119 \<209+tex4ht+...\><<<
120 \def\HCode####1{\documentstyle[tex4ht,}>>>
121
122
123 \<save\><<<
124 \let\HCode\documentstyle>>>
125
126 \<recall\><<<
127 \let\documentstyle\HCode>>>
128
129
130
131 \<htlatex 2e...\><<<
132 |<unix line|>|<windows line|>|<latex2e|>
133 |<latex2e|>
134 |<latex2e|>
135 |<base|>tex4ht |<dir ch|>|<@|>1 |<III|>
136 |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>
137
138 >>>
139
140
141
142
143 \<latex2e\><<<
144 latex |<@|>5 |<'|>|<definitions2e|>|<get parameters|>|empty>>>
145
146 \<definitions2e\><<<
147 \makeatletter|<get 2nd arg|>|<2e only|>\makeatother>>>
148
149
150 \<2e only\><<<
151 \def\Link#1.a.b.c.{|<2e|>}>>>
152
153
154
155
156
157 \<htlatex 209...\><<<
158 |<unix line|>|<windows line|>|<latex209|>
159 |<latex209|>
160 |<latex209|>
161 |<base|>tex4ht |<dir ch|>|<@|>1 |<III|>
162 |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>
163
164 >>>
165
166
167
168
169 \<latex209\><<<
170 latex |<@|>5 |<'|>|<definitions209|>|<get parameters|>|empty>>>
171
172 \<definitions209\><<<
173 \makeatletter|<get 2nd arg|>|<209 only|>\makeatother>>>
174
175
176 \<209 only\><<<
177 \def\Link#1.a.b.c.{|<209|>}>>>
178
179
180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
181 \section{TeX}
182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
183
184
185 \<httex...\><<<
186 |<unix line|>|<windows line|>|<tex|>
187 |<tex|>
188 |<tex|>
189 |<base|>tex4ht |<dir ch|>|<@|>1 |<III|>
190 |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>
191
192 >>>
193
194 \<tex\><<<
195 etex |<@|>5 |<'|>|<tex definitions|>|<get parameters|>|empty>>>
196
197
198 \<tex definitions\><<<
199 |<set hook|>|<get 2nd arg|>|empty>>>
200
201 \<set hook\><<<
202 \def\Link#1.a.b.c.{|<def tex4ht|>{|<options|>\input tex4ht.sty }}>>>
203
204
205 \<def tex4ht\><<<
206 \expandafter\def\csname tex4ht\endcsname>>>
207
208 %%%%%%%%%%%%%%%%%%%%
209 \section{Texinfo}
210 %%%%%%%%%%%%%%%%%%%%
211
212 The loading of tex4ht takes place at the @rm command at the end of the
213 texinfo.tex file.
214
215 \<httexi...\><<<
216 |<unix line|>|<windows line|>|<texinfo|>
217 |<texinfo|>
218 |<texinfo|>
219 |<base|>tex4ht |<dir ch|>|<@|>1 |<III|>
220 |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>
221 |<Rem|> texindex ?
222
223 >>>
224
225 \<texinfo\><<<
226 etex |<@|>5 |<'|>|<texinfo definitions|>|<get parameters|>|empty>>>
227
228
229 \<texinfo definitions\><<<
230 |<tex definitions|>\let\svrm=\rm\def\rm{\svrm|<tex4ht into texinfo|>}>>>
231
232 \<tex4ht into texinfo\><<<
233 \ifx\c\comment\def\rm{\let\rm=\svrm|<load into texinfo|>}\expandafter\rm\fi>>>
234
235 \<load into texinfo\><<<
236 |<change cats|>\csname tex4ht\endcsname|<restore cats|>|empty>>>
237
238 \<change cats\><<<
239 \catcode`\@=12\catcode`\\=0 >>>
240
241 \<restore cats\><<<
242 \catcode`\@=0\catcode`\\=13 >>>
243
244 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
245 \section{XeTeX}
246 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
247
248
249 \<htxetex...\><<<
250 |<unix line|>|<windows line|>|<xetex|>
251 |<xetex|>
252 |<xetex|>
253 |<base|>tex4ht -.xdv |<dir ch|>|<@|>1 |<III|>
254 |<base|>t4ht -.xdv |<dir ch|>|<@|>1 |<IV|>
255
256 >>>
257
258 \<xetex\><<<
259 xetex -no-pdf |<@|>5 |<'|>|<tex definitions|>|<get parameters|>|empty>>>
260 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261 \section{XeLaTeX}
262 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
263
264
265 \<htxelatex...\><<<
266 |<unix line|>|<windows line|>|<xelatex|>
267 |<xelatex|>
268 |<xelatex|>
269 |<base|>tex4ht -.xdv |<dir ch|>|<@|>1 |<III|>
270 |<base|>t4ht -.xdv |<dir ch|>|<@|>1 |<IV|>
271
272 >>>
273
274
275 \<xelatex\><<<
276 xelatex -no-pdf |<@|>5 |<'|>|<definitions|>|<get parameters|>|empty>>>
277
278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
279 \section{MeX}
280 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
281
282 \<htmex...\><<<
283 |<unix line|>|<windows line|>|<mex|>
284 |<mex|>
285 |<mex|>
286 |<base|>tex4ht |<dir ch|>|<@|>1 |<III|>
287 |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>
288
289 >>>
290
291 \<mex\><<<
292 mex |<@|>5 |<'|>|<tex definitions|>|<get parameters|>|empty>>>
293
294
295
296 %%%%%%%%%%%%%%%%%%%%%%
297 \section{Script Components}
298 %%%%%%%%%%%%%%%%%%%%%%
299
300 \def\setcats{\catcode`\\=12 \catcode`\%=12 \catcode`\~=12
301 \catcode`\_=12
302 }
303
304 \def\Remark{\bgroup \catcode`\#=12 \setcats \Rema} \def\Rema#1{\egroup\def\Rem{#1}}
305 \def\Ii{\def\II}
306 \def\Iii{\bgroup \setcats \Iiicont} \def\Iiicont#1{\egroup\def\III.##1.{#1}}
307 \def\Iv{\bgroup \setcats \Ivcont} \def\Ivcont#1{\egroup\def\IV.##1.{#1}}
308 \def\Quote{\bgroup \setcats \Qcont} \def\Qcont#1{\egroup\def\quote{#1}}
309 \def\Argchar{\bgroup \setcats \Acont}\def\Acont#1{\egroup\def\argchar{#1}}
310 \def\Dirchar{\bgroup \setcats \Dicont}\def\Dicont#1{\egroup\def\dirchar{#1}}
311 \def\Echooff{\bgroup \setcats \Dcont}\def\Dcont#1{\egroup\def\echoOff{#1}}
312 \def\Ext{\bgroup \setcats \Econt} \def\Econt#1{\egroup\def\ext{#1}%
313 \def\firstln{unix}\ifx \firstln\ext
314 \def\firstln##1endfirstln{##1}%
315 \else \def\firstln##1endfirstln{}\fi
316 }
317 \def\Base{\bgroup \setcats \Bcont} \def\Bcont#1{\egroup\def\base{#1}}
318 \def\Script{\def\script##1##2} % #1 -- file #2 -- extension
319 \def\Options#1{\ifx \OPTIONS\UnDef \def\OPTIONS{#1}\fi}
320 \def\Latex#1{\ifx \latex\UnDef \def\latex{#1}\fi}
321
322 \let\Rem=\relax
323 \let\II=\relax
324 \let\III=\relax
325 \let\IV=\relax
326 \let\quote=\relax
327 \let\argchar=\relax
328 \let\dirchar=\relax
329 \let\echoOff=\relax
330 \let\ext=\relax
331 \ifx \script\UnDef \let\script=\relax \fi
332 \let\base=\relax
333 \let\firstln=\relax
334
335 \<Rem\><<<
336 |Rem>>>
337
338 \<II\><<<
339 |II>>>
340
341 \<III\><<<
342 |III.|<@|>3.>>>
343
344 \<IV\><<<
345 |IV.|<@|>4.>>>
346
347 \<'\><<<
348 |quote>>>
349
350 \<@\><<<
351 |argchar>>>
352
353 \<dir ch\><<<
354 |dirchar>>>
355
356 \<base\><<<
357 |base>>>
358
359 \<echo off\><<<
360 |echoOff>>>
361
362 \<unix line\><<<
363 |firstln#!/bin/sh
364 # stop at first error
365 set -e
366
367 # No interaction on the TeX runs is desirable.
368 # Simpler to do that here than on the individual commands;
369 # let's hope exec redirections are portable enough.
370 exec </dev/null
371 endfirstln
372 >>>
373
374 Despite the name, this macro is not for Windows. It is unconditionally
375 included in all the scripts. It should only be the copyright notice,
376 which somehow gets transformed for Unix. Thus we go to lots of trouble
377 to insert the at-echo off only for Windows.
378
379 \<windows line\><<<
380 |<echo off|>
381 |Rem |ScriptFileName|AddExtn (2023-09-10-08:49), generated from tex4ht-mkht.tex
382 |Rem Copyright 2009-2020 TeX Users Group
383 |Rem Copyright 2003-2009 Eitan M. Gurari
384 |Rem
385 |Rem This work may be distributed and/or modified under the
386 |Rem conditions of the LaTeX Project Public License, either
387 |Rem version 1.3 of this license or (at your option) any
388 |Rem later version. The latest version of this license is in
389 |Rem http://www.latex-project.org/lppl.txt
390 |Rem and version 1.3 or later is part of all distributions
391 |Rem of LaTeX version 2003/12/01 or later.
392 |Rem
393 |Rem This work has the LPPL maintenance status "maintained".
394 |Rem
395 |Rem The Current Maintainer of this work
396 |Rem is the TeX4ht Project <https://tug.org/tex4ht>.
397 |Rem
398 |Rem If you modify this file, changing the
399 |Rem version identification be appreciated.
400
401 >>>
402
403
404 \def\IfExt#1,#2//{\def\next{#1}%
405 \ifx \next\ext \def\next{\csname iftrue\endcsname}%
406 \else \ifx \next\empty \def\next{\csname iffalse\endcsname}%
407 \else \def\next{\IfExt#2,,//}\fi\fi \next}
408
409 \begingroup
410 \catcode`\:=11 \catcode`\^=7 \catcode`\^^M=13%
411 %
412 \gdef\make#1{%
413 \expandafter\IfExt\OPTIONS,,//%
414 %
415 \subsection{#1}%
416 \def\temp##1{\par{\tt\string##1: \meaning##1}}%
417 \temp\quote
418 \temp\argchar
419 \temp\dirchar
420 \temp\echoOff
421 \temp\ext
422 \temp\script
423 \temp\base
424 \temp\firstln
425 \temp\latex
426 \temp\Rem
427 \temp\II
428 \temp\III
429 \temp\IV
430 \def\pref{#1} %
431 \<\pref latex\latex.\ext\><<<
432 \<htlatex \latex...\>
433 >>> %
434 \OutputCodE\<\pref latex\latex.\ext\> \script{\pref latex}{\ext} %
435 \expandafter\let\csname\pref latex\latex\endcsname=\UnDef
436 %
437 \<\pref tex.\ext\><<<
438 \<httex...\>
439 >>> %
440 %
441 \OutputCodE\<\pref tex.\ext\> \script{\pref tex}{\ext} %
442 %
443 \<\pref texi.\ext\><<<
444 \<httexi...\>
445 >>> %
446 %
447 \OutputCodE\<\pref texi.\ext\> \script{\pref texi}{\ext} %
448 %
449 \<\pref xetex.\ext\><<<
450 \<htxetex...\>
451 >>> %
452 %
453 \OutputCodE\<\pref xetex.\ext\> \script{\pref xetex}{\ext} %
454 %
455 \<\pref xelatex.\ext\><<<
456 \<htxelatex...\>
457 >>> %
458 %
459 \OutputCodE\<\pref xelatex.\ext\> \script{\pref xelatex}{\ext} %
460 %
461 \<\pref mex.\ext\><<<
462 \<htmex...\>
463 >>> %
464 %
465 \OutputCodE\<\pref mex.\ext\> \script{\pref mex}{\ext} %
466 %
467 %
468 \fi
469 } %
470 \endgroup
471
472 \ifx \JOBNAME\UnDefined
473 \def\one{\Ii}
474 \def\two{\Iii}
475 \def\three{\Iv}
476 \Latex{} % {}, {2e}, {209}
477 \def\temp{unix}\ifx\script\temp
478 \Options{unix} % {unix,bat}, {unix}, {bat}
479 %%%%%%%%%%
480 \Ext{unix}
481 %%%%%%%%%%
482 \Base{}
483 \Quote{'}
484 \Argchar{$}
485 \Dirchar{-f/}
486 \Echooff{}
487 \Remark{#}
488
489 \else
490 \def\temp{bat}\ifx\script\temp
491 \Options{bat}
492 %%%%%%%%%%%%%%%%%%
493 \Options{bat}
494 %%%%%%%%%%%%%%%%%%
495 %%%%%%%%%
496 \Ext{bat}
497 %%%%%%%%%
498 \Base{}
499 \Quote{}
500 \Argchar{%}
501 \Dirchar{}
502 \Echooff{@echo off}
503 \Remark{Rem }
504
505 \else
506 \bgroup
507 \def\1{\space\space\space}
508 \def\2{\space\space\space\space\space\space}
509 \catcode`\%=12
510 \catcode`\#=12
511 \catcode`\~=12
512 \catcode`\@=0
513 \catcode`\\=12
514 @immediate@write16{|-------------------------------------------------------------}
515 @immediate@write16{|@2@1 A sample of a scripts generator file }
516 @immediate@write16{|}
517 @immediate@write16{|@1 Creates a foolatex script for commands}
518 @immediate@write16{|}
519 @immediate@write16{|@2 foolatex file}
520 @immediate@write16{|}
521 @immediate@write16{|@1 similar to htlatex for commands}
522 @immediate@write16{|}
523 @immediate@write16{|@2 htlatex file "html,...1..." " ...2..." "...3..."}
524 @immediate@write16{|}
525 @immediate@write16{|@1 with the arguments ...1..., ...2..., and ...3... }
526 @immediate@write16{|@1 embedded in the new script. General usage}
527 @immediate@write16{|}
528 @immediate@write16{|@2 foolatex file "..." "..." "..."}
529 @immediate@write16{|}
530 @immediate@write16{|----------------- sample.tex --------------------------------}
531 @immediate@write16{|% latex sample}
532 @immediate@write16{|}
533 @immediate@write16{| \def\script{bat} }
534 @immediate@write16{| % \def\script{unix} }
535 @immediate@write16{|}
536 @immediate@write16{| \input ./mkht.4ht }
537 @immediate@write16{|}
538 @immediate@write16{| \one{,html,...1...}}
539 @immediate@write16{| \two{-i/tex4ht/ht-fonts/#1 ...2...} % bat }
540 @immediate@write16{| % \two{-i~/tex4ht/texmf/tex4ht/ht-fonts/#1 ...2...} % unix }
541 @immediate@write16{| \three{#1 ...3...}}
542 @immediate@write16{| \make{foo}}
543 @immediate@write16{|}
544 @immediate@write16{| \end{document} }
545 @immediate@write16{-------------------------------------------------------------}
546 @egroup
547 \def\next{\csname fi\endcsname
548 \csname fi\endcsname
549 \csname fi\endcsname\end{document}}
550 \fi \fi
551
552 \expandafter\endinput
553 \fi
554
555 \input \JOBNAME
556
557 \end{document}
558 \endinput
559