%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% mkht.4ht                             2001-04-25-00:01 %
% Copyright (C) 1997--2001      Eitan M. Gurari         %
%                                                       %
% This program can redistributed and/or modified under  %
% the terms of the LaTeX Project Public License         %
% Distributed from CTAN archives in directory           %
% macros/latex/base/lppl.txt; either version 1 of the   %
% License, or (at your option) any later version.       %
%                                                       %
% However, you are allowed to modify this program       %
% without changing its name, if you modify its          %
% signature. Changes to the signature can be introduced %
% with a directive of the form                          %
%            \message{signature}                        %
%                                                       %
%                             gurari@cis.ohio-state.edu %
%                 http://www.cis.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\immediate\write-1{version 2001-04-25-00:01}


\def\exit{\documentclass{article}\begin{document}\end{document}\endinput}
\bgroup
  \def\missing#1{\aftergroup\exit
     \immediate\write16{---------------------------- error
        ----------------------------
        ^^JRequires #1ProTex.sty from
        http://www.cis.ohio-state.edu/\string
       ~gurari/systems.html^^J%
       ---------------------------------------------------------------}}
  \openin15=ProTex.sty \ifeof15 \missing{}\else \closein15 \fi
  \openin15=AlProTex.sty \ifeof15 \missing{Al}\else \closein15 \fi
\egroup

\documentclass{article}

\input tex4ht.sty
\Preamble{xhtml}
\input ProTex.sty
\AlProTex{foo,<<<>>>,|,title,list}

\begin{document}
\EndPreamble

\tableofcontents

\section{LaTeX}


\<htlatex ...\><<<
        |<latex|>
        |<latex|>
        |<latex|>
        |<base|>tex4ht |<dir ch|>|<@|>1  |<III|>
        |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>

>>>


\<latex\><<<
latex |<'|>|<definitions|>|<get parameters|>|empty>>>

\<get parameters\><<<
\HCode |<'|>|<@|>2|<'|>.a.b.c.\input |<'|> |<@|>1>>>


\<definitions\><<<
\makeatletter|<get 2nd arg|>|<2e + 209|>\makeatother>>>

\<get 2nd arg\><<<
\def\HCode{\futurelet\HCode\HChar}\def\HChar{|<double quotes?|>}>>>

\<double quotes?\><<<
\ifx"\HCode|<remove qts|>\expandafter\HCode\else\expandafter\Link\fi>>>

\<remove qts\><<<
\def\HCode"##1"{\Link##1}>>>


\<2e + 209\><<<
\def\Link#1.a.b.c.{|<2e|>|<209|>}>>>

\<2e\><<<
\g@addto@macro\@documentclasshook{|<require package|>}>>>

\<209\><<<
|<save|>\def\documentstyle{|<recall|>|<options|>|<209+tex4ht|>}>>>

\<require package\><<<
\RequirePackage[#1|<II|>|<,html|>]{tex4ht}>>>


\<options\><<<
|<def tex4ht|>{#1|<II|>|<,html|>}>>>


\<209+tex4ht\><<<
|<209+tex4ht+...|>\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}>>>

\<209+tex4ht+...\><<<
\def\HCode####1{\documentstyle[tex4ht,}>>>


\<save\><<<
\let\HCode\documentstyle>>>

\<recall\><<<
\let\documentstyle\HCode>>>



\<htlatex 2e...\><<<
        |<latex2e|>
        |<latex2e|>
        |<latex2e|>
        |<base|>tex4ht |<dir ch|>|<@|>1  |<III|>
        |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>

>>>




\<latex2e\><<<
latex |<'|>|<definitions2e|>|<get parameters|>|empty>>>

\<definitions2e\><<<
\makeatletter|<get 2nd arg|>|<2e only|>\makeatother>>>


\<2e only\><<<
\def\Link#1.a.b.c.{|<2e|>}>>>





\<htlatex 209...\><<<
        |<latex209|>
        |<latex209|>
        |<latex209|>
        |<base|>tex4ht |<dir ch|>|<@|>1  |<III|>
        |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>

>>>




\<latex209\><<<
latex |<'|>|<definitions209|>|<get parameters|>|empty>>>

\<definitions209\><<<
\makeatletter|<get 2nd arg|>|<209 only|>\makeatother>>>


\<209 only\><<<
\def\Link#1.a.b.c.{|<209|>}>>>












\section{TeX}

\<httex...\><<<
        |<tex|>
        |<tex|>
        |<tex|>
        |<base|>tex4ht |<dir ch|>|<@|>1 |<III|>
        |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>

>>>

\<tex\><<<
tex |<'|>|<tex definitions|>|<get parameters|>|empty>>>


\<tex definitions\><<<
|<set hook|>|<get 2nd arg|>|empty>>>

\<set hook\><<<
\def\Link#1.a.b.c.{|<def tex4ht|>{|<options|>\input tex4ht.sty }}>>>


\<def tex4ht\><<<
\expandafter\def\csname tex4ht\endcsname>>>


\section{TeXinfo}

We automatically load tex4ht  at the @rm command at the end of  the
texinfo.tex file.

\<httexi...\><<<
        |<texinfo|>
        |<texinfo|>
        |<texinfo|>
        |<base|>tex4ht |<dir ch|>|<@|>1 |<III|>
        |<base|>t4ht |<dir ch|>|<@|>1 |<IV|>
#        texindex ?

>>>

\<texinfo\><<<
tex |<'|>|<texinfo definitions|>|<get parameters|>|empty>>>


\<texinfo definitions\><<<
|<tex definitions|>\let\svrm=\rm\def\rm{\svrm|<tex4ht into texinfo|>}>>>

\<tex4ht into texinfo\><<<
\ifx\c\comment\def\rm{\let\rm=\svrm|<load into texinfo|>}\expandafter\rm\fi>>>

\<load into texinfo\><<<
|<change cats|>\csname tex4ht\endcsname|<restore cats|>|empty>>>

\<change cats\><<<
\catcode`\@=12\catcode`\\=0 >>>

\<restore cats\><<<
\catcode`\@=0\catcode`\\=13 >>>



\section{The Scripts}

\def\setcats{\catcode`\\=12 \catcode`\%=12 \catcode`\~=12
 \catcode`\_=12
}

\def\Ii{\def\II}
\def\Iii{\bgroup \setcats \Iiicont}  \def\Iiicont#1{\egroup\def\III.##1.{#1}}
\def\Iv{\bgroup \setcats \Ivcont}    \def\Ivcont#1{\egroup\def\IV.##1.{#1}}
\def\Quote{\bgroup \setcats \Qcont}  \def\Qcont#1{\egroup\def\quote{#1}}
\def\Argchar{\bgroup \setcats \Acont}\def\Acont#1{\egroup\def\argchar{#1}}
\def\Dirchar{\bgroup \setcats \Dcont}\def\Dcont#1{\egroup\def\dirchar{#1}}
\def\Ext{\bgroup \setcats \Econt}    \def\Econt#1{\egroup\def\ext{#1}}
\def\Base{\bgroup \setcats \Bcont}   \def\Bcont#1{\egroup\def\base{#1}}
\def\Script{\def\script##1##2}  % #1 -- file    #2 -- extension
\def\Options#1{\ifx \OPTIONS\UnDef \def\OPTIONS{#1}\fi}
\def\Latex#1{\ifx \latex\UnDef \def\latex{#1}\fi}

\let\II=\relax
\let\III=\relax
\let\IV=\relax
\let\quote=\relax
\let\argchar=\relax
\let\dirchar=\relax
\let\ext=\relax
\ifx \script\UnDef \let\script=\relax \fi
\let\base=\relax

\<II\><<<
|II>>>

\<III\><<<
|III.|<@|>3.>>>

\<IV\><<<
|IV.|<@|>4.>>>

\<'\><<<
|quote>>>

\<@\><<<
|argchar>>>

\<dir ch\><<<
|dirchar>>>

\<base\><<<
|base>>>


\def\IfExt#1,#2//{\def\next{#1}%
   \ifx \next\ext \def\next{\csname iftrue\endcsname}%
   \else \ifx \next\empty \def\next{\csname iffalse\endcsname}%
   \else \def\next{\IfExt#2,,//}\fi\fi \next}

\begingroup
\catcode`\:=11 \catcode`\^=7    \catcode`\^^M=13%
%
\gdef\make#1{%
  \expandafter\IfExt\OPTIONS,,//%
  %
   \subsection{#1}%
   \def\temp##1{\par{\tt\string##1: \meaning##1}}%
   \temp\quote
   \temp\argchar
   \temp\dirchar
   \temp\ext
   \temp\script
   \temp\base
   \temp\latex
   \temp\II
   \temp\III
   \temp\IV
   \def\pref{#1} %
   \<\pref latex\latex.\ext\><<<
   \<htlatex \latex...\>
   >>> %
   \OutputCodE\<\pref latex\latex.\ext\>   \script{\pref latex}{\ext}  %
   \expandafter\let\csname\pref latex\latex\endcsname=\UnDef
%
   \<\pref tex.\ext\><<<
   \<httex...\>
   >>> %
   \OutputCodE\<\pref tex.\ext\>    \script{\pref tex}{\ext}  %
%
   \<\pref texi.\ext\><<<
   \<httexi...\>
   >>> %
   \OutputCodE\<\pref texi.\ext\>   \script{\pref texi}{\ext}  %
  %
  \fi
}                                      %
\endgroup


\input \JOBNAME

\end{document}
\endinput

