% \iffalse
%
\ProvidesFile{foilhtml.drv}
%
%
%\ProvidesPackage{foilhtml}
[1998/02/17 v1.2 Sectioning Commands for FoilTeX]
%% Copyright Boris Veytsman 1997
%
% \fi
% \CheckSum{2423}
%%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
% \iffalse
%
%
%
% \section{Documentation driver}
%
% Nothing interesting here\dots
% \begin{macrocode}
%
\documentclass{ltxdoc}
\DoNotIndex{\@Alph,\@alph,\@arabic,\@badmath}
\DoNotIndex{\@centercr}
\DoNotIndex{\@empty,\@ignoretrue}
\DoNotIndex{\@ixpt}
\DoNotIndex{\@M,\@minus,\@ne,\@plus}
\DoNotIndex{\\,\addtolength}
\DoNotIndex{\advance}
\DoNotIndex{\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
\DoNotIndex{\bullet}
\DoNotIndex{\cdot,\cr,\day,\DeclareOption}
\DoNotIndex{\def,\DocInput,\documentclass}
\DoNotIndex{\DoNotIndex,\egroup,\ifx,\else,\fi,\endtrivlist}
\DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
\DoNotIndex{\endlist,\everycr,\ExecuteOptions}
\DoNotIndex{\filedate,\filename,\fileversion}
\DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
\DoNotIndex{\hsize,\hskip,\hspace,\hss,\ifcase,\or,\fi}
\DoNotIndex{\ifvmode,\fi,\ifnum,\fi,\input}
\DoNotIndex{\kern,\leavevmode,\let,\leftmark}
\DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark}
\DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
\DoNotIndex{\NeedsTeXFormat,\newdimen}
\DoNotIndex{\newpage,\nobreak,\noindent,\number}
\DoNotIndex{\p@}
\DoNotIndex{\pagestyle,\par}
\DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
\DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
\DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
\DoNotIndex{\rightmargin,\rlap,\rmfamily}
\DoNotIndex{\setbox,\setcounter,\setlength}
\DoNotIndex{\skip,\slshape,\space}
\DoNotIndex{\trivlist,\typeout,\tw@}
\DoNotIndex{\vskip,\vspace,\year,\z@}
%
\DoNotIndex{\@ptsize,\@sptoken,\addtocounter,\afterassignment}
\DoNotIndex{\AtEndOfPackage,\baselineskip,\boxmaxdepth,\clearpage}
\DoNotIndex{\clubpenalty,\csname,\CurrentOption,\DeclareRobustCommand}
\DoNotIndex{\eject,\endcsname,\evensidemargin,\expandafter}
\DoNotIndex{\footnotesize,\footskip,\fromaddress,\futurelet}
\DoNotIndex{\headheight,\headsep,\hfuzz,\ignorespaces}
\DoNotIndex{\InputIfFileExists,\large,\lineskip,\loop}
\DoNotIndex{\MakeUppercase,\MessageBreak,\mbox,\multiply}
\DoNotIndex{\newcount,\newif,\newlength,\newtoks,\nolinebreak}
\DoNotIndex{\nopagebreak,\normalfont,\normalsize,\null,\newline}
\DoNotIndex{\oddsidemargin,\PackageError,\PackageInfo}
\DoNotIndex{\paperheight,\paperwidth,\parbox,\parindent}
\DoNotIndex{\PassOptionsToPackage,\ProvidesPackage,\RequirePackage}
\DoNotIndex{\rule,\selectfont,\sffamily,\sloppy,\small,\spaceskip}
\DoNotIndex{\stepcounter,\textheight,\textwidth,\the,\topmargin}
\DoNotIndex{\unhbox,\voidb@x,\vsize,\vfuzz,\widowpenalty,\xspaceskip}
\DoNotIndex{\AtBeginDocument,\AtEndDocument}
\DoNotIndex{\n}
\usepackage{enumerate}
\CodelineIndex
\RecordChanges
\EnableCrossrefs
\renewcommand{\partname}{Part}
%
% We want |foilhtml.dtx| to produce the code and interface, but
% |foilhtml.drv| to produce only interface
%
%\OnlyDescription
%\renewcommand{\part}[2][dummy]{}
%
% We generate foilhtml.ins---just in case\ldots
%
\begin{filecontents}{foilhtml.ins}
\def\batchfile{foilhtml.ins}
\input docstrip
\keepsilent
\declarepreamble\cfg
The first part of this file contains default options for your site.
The second part (inside AtEndOfPackage declaration) should contain
customization commands specific to your site.
Good luck
\endpreamble
\Msg{Generating files...}
\generate{%
\file{foilhtml.drv}{\from{foilhtml.dtx}{driver}}%
\file{foilhtml.sty}{\from{foilhtml.dtx}{package}}%
\usepreamble\cfg\file{foilhtml.cfg}{\from{foilhtml.dtx}{cfg}}%
\usepreamble\empty\usepostamble\empty\file{foils.perl}%
{\from{foilhtml.dtx}{foils}}}
\Msg{Generating Perl scripts for obsolete versions of LaTeX2HTML...}
\generate{%
\usepreamble\empty\usepostamble\empty\file{foilhtml-96.perl}%
{\from{foilhtml.dtx}{foilhtml}}
\usepreamble\empty\usepostamble\empty\file{foils-97.perl}%
{\from{foilhtml.dtx}{foils-97}}}
\obeyspaces
\Msg{}
\Msg{**********************************************************}
\Msg{* To finish the installation, put the files foilhtml.sty *}
\Msg{* and foilhtml.cfg to a directory read by LaTeX, and the *}
\Msg{* script foils.perl to the subdirectory styles of the *}
\Msg{* main LaTeX2HTML directory. *}
\Msg{* Happy LaTeXing & good luck! *}
\Msg{**********************************************************}
\Msg{}
\end{filecontents}
\begin{document}
\DocInput{foilhtml.dtx}
\end{document}
%
% \end{macrocode}
% \fi
% \newcommand{\FH}{\textsf{FoilHTML}}
% \newcommand{\Perl}{\textsf{Perl}}
% \newcommand{\latextohtml}{\LaTeX 2\texttt{HTML}}
% \DeclareRobustCommand\FoilTeX{{\normalfont{\sffamily Foil}\kern-.03em{\rmfamily\TeX}}}
%
% \GetFileInfo{foilhtml.drv}
%
% \title{Sectioning commands in \FoilTeX\ and conversion to HTML
% format: \FH\ Package
% \thanks{This file
% has version number \fileversion, last
% revised \filedate.}
% \thanks{\copyright Boris Veytsman, 1998}}
% \author{Boris Veytsman\thanks{E-mail: \texttt{boris@plmsc.psu.edu},
% Home page: \texttt{http://www.plmsc.psu.edu/}\~{}\texttt{boris}}}
% \date{\filedate}
% \maketitle
%
% \begin{abstract}
% The standard \FoilTeX\ system is based on a visual rather than
% logical formatting. Thus automatic conversion of \FoilTeX\
% documents to HTML format is difficult. In particular, the
% well-known \latextohtml\ converter gives unsatisfactory results
% when used on \FoilTeX\ documents.
%
% This package provides integration between \FoilTeX\ and
% \latextohtml. It adds sectioning commands and elements of logical
% formatting to \FoilTeX\ and provides support for \FoilTeX\ commands
% in \latextohtml. It also supports automatic creation of
% \latextohtml\ images with proper font sizes and shapes when
% converting \FoilTeX\ documents.
% \end{abstract}
%
% \tableofcontents
%
% \part{User Interface}
%
% \section{Introduction}
%
% Many people like to put the contents of their talks and lectures on
% the World Wide Web using tools like Nikos Drakos'
% \latextohtml~\cite{LaTeX2HTML}. Unfortunately, when one tries to
% convert the documents prepared in \FoilTeX~\cite{FoilTeX}, several
% problems emerge:
% \begin{enumerate}
% \item \FoilTeX\ does not have proper sectioning commands. Instead it
% has command like |\foilhead| and |\rotatefoilhead|, that are not
% recognized by \latextohtml.
% \item \FoilTeX\ has commands like |\MyLogo| and |\Restriction| that
% have no correspondence in the HTML format.
% \item The equations and pictures processed by \latextohtml\ are too
% large and (for pictures) use Sans Serif fonts. This produces ugly
% |gif| inserts in HTML files.
% \end{enumerate}
%
% This package solves these problems by two methods:
% \begin{enumerate}
% \item It provides a \Perl\ script to teach \latextohtml\ the basic
% constructions of \FoilTeX\ and put the correct headers in the \latextohtml\
% |images.tex| file.
% \item It provides a \LaTeX\ package that implements sectioning
% commands in \FoilTeX.
% \end{enumerate}
%
%
% \section{Installation}
% Since \FH\ is an \emph{add-on} to \FoilTeX\ and \latextohtml, you need both
% these programs installed and working prior to installation of
% \FH. This package is intended for \LaTeXe\ \emph{only}; I don't have
% enough time to port and test it under \LaTeX2.09. It is tested under
% \FoilTeX2.1 and \latextohtml96--\latextohtml98.
%
% The \FH\ distribution consists of the following files:
% \begin{itemize}
% \item |readme.v12|---Read Me file
% \item |foilhtml.dtx|---the fully documented code
% \item |foilhtml.ins|---the \LaTeX\ program extracting
% the code from the |.dtx| file.
% \end{itemize}
% To install the package:
% \begin{enumerate}
% \item Run \LaTeX\ on |foilhtml.ins|. This will
% create the following files:
% \begin{itemize}
% \item |foils.perl|---\Perl{} script for \latextohtml98
% \item |foilhtml.sty| and |foilhtml.cfg|---\LaTeX\ style file and the
% configuration file for user-customization,
% \item |foilhtml.drv|---documentation driver.
% \item |foilhtml-96.perl| and |foils-97.perl|---obsolete versions of
% \Perl{} scripts required \emph{only} if you have an obsolete installation
% of \latextohtml.
% \end{itemize}
% \item Install the script |foils.perl| in the directory where your
% \latextohtml{} scripts reside (usually it is
% |styles| subdirectory of the main \latextohtml{} directory,
% e.~g. |/usr/local/lib/latex2html/styles|).
% \item Tune the configuration file |foilhtml.cfg| according to your
% taste and put it together with the file |foilhtml.sty| to the
% directory read by \LaTeX\footnote{If you use |kpathsea| (e.~g. if
% you have te\TeX\ distribution), you will need to run |texhash| to
% update your search database}.
% \item Run \LaTeX\ on |foilhtml.drv| to produce the
% documentation\footnote{The documentation driver |foilhtml.drv|
% reads the contents of the file |foilhtml.dtx|, so do not delete
% the latter until you produced the documentation.}.
% \item (Optional) to produce the documentation \emph{and} the code run
% \LaTeX\ through the file |foilhtml.dtx|
% \end{enumerate}
%
% \subsection{Obsolete versions}
%
% If you have older versions of \latextohtml, your best options is to upgrade.
% However, if you cannot do this by some reason, you can use the previous
% versions of the perl scripts. Just rename the files |foilhtml-96.perl|
% \emph{or} |foils-97.perl| to |foilhtml.perl| or |foils.perl| correspondingly
% and install them in the |styles| subdirectory.
%
% \section{Basic Usage}
%
% The usage of \FH\ could be very simple. Just add to the preamble of your
% document |\usepackage{foilhtml}|, for example
% \begin{verbatim}
% \documentclass[20pt,dvips]{foils}
% \usepackage{foilhtml,html}
% \end{verbatim}
% and your \FoilTeX\ documents will be correctly parsed by
% \latextohtml\footnote{Actually, if you use \latextohtml97-1 or later, you
% don't need even to load the package |foilhtml|: unlike the old
% versions of \latextohtml, this one parses both \cs{usepackage} and
% \cs{documentclass} commands. However, you will want to load this
% package if you need the new \FoilTeX{} commands described below.}.
% The \FoilTeX-specific commands
% \DescribeMacro{\foilhead}\DescribeMacro{\rotatefoilhead} |\foilhead| and
% |\rotatefoilhead| will be translated by \latextohtml\ as
% starred |\subsection*| commands (this behavior could be changed in your
% |.latex2html-init| file---see Section~\ref{sec:config}).
%
% However, this is not the full story. In addition, you will be able
% to use ``normal'' sectioning
% commands like |\section| and |\chapter| and even
% |\tableofcontents|. By default, commands |\part| and |\chapter|
% produce new foils containing only titles of the corresponding, and
% the command |\section| starts a new foil. The starred forms of these
% commands produce unnumbered sections that are not included in the table of
% contents.
%
% In the ``vanilla'' \FoilTeX\ the commands |\foilhead| and
% |rotatefoilhead| have both logical (they are close to sectioning
% commands) and visual meanings. If you want to convert your documents
% to HTML, you need to adhere to logical formatting. Therefore, their
% usage is discouraged. Most important, you should \emph{not} use the
% commands |\foilhead{}| and |\rotatefoilhead{}| without arguments to
% produce blank pages: they will be treated by \latextohtml\ as
% |\subsection*{}| commands with blank subsection name. Instead, use
% |\clearpage| and the commands |\portraitfoils| and |\landscapefoils|,
% described below.
%
% While the sectioning commands take care of the logical formatting,
% it is impossible to get rid of visual formatting of foils
% altogether. \FH\ package provides some new commands for visual
% formatting.
%
% \DescribeMacro{\portraitfoils}\DescribeMacro{\landscapefoils}
% \DescribeMacro{\portraitfoils*}\DescribeMacro{\landscapefoils*}
% The commands |\portraitfoils| and |\landscapefoils| start a new foil
% with the selected orientation. Their starred forms do not eject the
% page, and the selected orientation begins only from the next
% sectioning command at the level of |section| or greater. Note that the
% explicit commands |\foilhead| and |\rotatefoilhead| might change the
% orientation of the produced pages. However, the default orientation
% will be restored by the next sectioning command on the level of
% |section| or greater.
%
% \section{Customization}
% \label{sec:config}
% \FH\ should work ``right out of the box''. However, there some ways
% to customize its behavior for picky users.
%
% \subsection{Configuring the \latextohtml{} behavior}
% There are three \Perl\ variables that control translation that could
% be set in your
% |.latex2html-init| file
%
% \DescribeMacro{$FOILHEADLEVEL}
% The value of |$FOILHEADLEVEL| describes the level of sectioning for
% explicit |foilhead| and |rotatefoilhead| commands. By default it is
% 4 (subsection). Other values are 1 (part), 2 (chapter), etc.\ up to 7
% (subparagraph).
%
% \DescribeMacro{$FOILCLASS}\DescribeMacro{$FOILOPTIONS}
% The header of the |images.tex| is
% \begin{verbatim}
% \documentclass[$FOILOPTIONS]{$FOILCLASS}
% \end{verbatim}
% The defaults are |10pt| and |article|. The variables can be set to any
% valid \LaTeX\ values.
%
% For example, the following lines in your |.latex2html-init| file:
% \begin{verbatim}
% $FOILHEADLEVEL = 2;
% $FOILOPTIONS = '12pt';
% $FOILCLASS = 'book';
% \end{verbatim}
% produce HTML file with |foilhead| commands translated as
% Chapters, and the images created as for a 12pt book.
%
% \subsection{\LaTeX\ variables and options}
% There are several ways to change the look of the \LaTeX\
% document.
%
% \DescribeMacro{\contentsname}
% By default, the Table of Contents is titled ``Outline'' in the
% printed document. This could be changed by changing the macro
% |\contentsname| like this:
% \begin{verbatim}
% \renewcommand{\contentsname}{The Outline of Today's Talk}
% \end{verbatim}
% Note that the in the HTML version Table of Contents is still called
% ``Contents''. This could be changed separately in your
% |.latex2html-init| file.
%
% \DescribeMacro{[pagesintoc]}\DescribeMacro{[nopagesintoc]}
% By default, the Table of Contents does not include the page numbers
% of the corresponding sections (they have little sense for a
% lecture). However, if you wish to include them in the Table of
% Contents, use package option |pagesintoc|. The package option
% |nopagesintoc| (default) suppresses the page numbers.
%
% By default, |foilhtml| does \emph{not} number even the non-starred
% sections, subsections, etc. This behavior is determined by the variable
% |secnumdepth| (by default 0). This variable has the same meaning
% here, as in the standard \LaTeX\ classes. All
% sectioning units of the level larger than |secnumdepth| are
% numbered, and the others are not.
%
% \subsection{\LaTeX\ configuration file}
% If the file |foilhtml.cfg| exists, it is loaded by the style
% |foilhtml.sty|. If you use some customization code often, you can
% put it there. A sample configuration file is provided in the
% distribution; feel free to hack it.
%
% \section{New versions and bug reports}
%
% Feel free to send bug reports to |boris@plmsc.psu.edu|. You can find
% new versions of the package on my home page
% (|http://www.plmsc.psu.edu/|\~{}|boris| or on CTAN.
%
% \section{Legalese}
%
% The package \FH\ is provided ``as is'' and comes with absolutely no
% warranty of any kind, either expressed or implied, including, but not
% limited to, the implied warranties of merchantability and fitness for
% a particular purpose. The entire risk as to the quality and
% performance of the program is with you. Should the program prove
% defective, you assume the cost of all necessary servicing, repair or
% correction.
%
% In no event unless required by applicable law will the author of the
% program be liable to you for damages, including any general, special,
% incidental or consequential damages arising out of any use of the
% program or out of inability to use the program (including but not
% limited to loss of data or data being rendered inaccurate or losses
% sustained by you or by third parties as a result of a failure of the
% program to operate with any other programs), even if such holder or
% other party has been advised of the possibility of such damages.
%
% \FH\ package is covered by the same license as the current \LaTeXe\
% package (see the files |legal.txt| and |modguide.tex| in the \LaTeXe\
% distribution).
%
% The program \FoilTeX\ is copyrighted by IBM Corporation and covered
% by a separate license.
%
% The program \latextohtml\ is copyrighted by Nikos Drakos and covered by a
% separate license.
%
%
% \StopEventually{%
% \clearpage
% \begin{thebibliography}{1}
%
% \bibitem{LaTeX2HTML}
% Nikos Drakos, Jens Lippmann, and Ross Moore
% \newblock The {\latextohtml{}} translator.
% \newblock CTAN, 1996, 1997.
%
% \bibitem{FoilTeX}
% Jim Hafner.
% \newblock The {\FoilTeX{}} class package.
% \newblock CTAN, 1997.
%
% \bibitem{classes}
% Leslie Lamport, Frank Mittelbach, and Johannes Braams.
% \newblock Standard document classes for {\LaTeX{}} version 2e.
% \newblock CTAN, 1997.
%
% \bibitem{ltdefns}
% Johannes Braams, David Carlisle, Alan Jeffrey, Leslie Lamport, Frank
% Mittelbach, Chris Rowley, and Rainer Sch{\"o}pf.
% \newblock ltdefns.dtx.
% \newblock CTAN, 1997.
%
% \end{thebibliography}
% }
%
% \clearpage
% \part{Implementation}
% \section{\Perl\ code}
% \changes{v1.1}{1997/08/11}{Added support for \latextohtml97-1}
% \changes{v1.2}{1998/02/17}{Added support for \latextohtml98-1}
% \changes{v1.2}{1998/02/17}{Old perl scripts now have distinct names}
% \begin{macrocode}
%
% \end{macrocode}
% First, the header:
% \begin{macrocode}
######################################################
#
%# This is file `foilhtml.perl',
%# This is file `foils.perl',
# generated with the docstrip utility.
#
# Copyright Boris Veytsman 1998
#
# You are *not* allowed to modify this file.
#
# You are *not* allowed to distribute this file.
# For distribution of the original source see
# the terms for copying and modification in the file
# foilhtml.dtx
#
% \end{macrocode}
%
% \DescribeMacro{$FOILHEADLEVEL}
% Now we define |\foilhead| and |\rotatefoihead| as sectioning
% commands. By default their level is ``section'', but this can be used
% by setting |$FOILHEADLEVEL| to 1 (part), 2 (chapter), 3 (section),
% etc. up to 7 (subparagraph). Note that this will affect only \latextohtml\
% sectioning commands. The typesetting will the same: |