This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/man/html.sty
2011-06-12 22:26:04 +01:00

175 lines
4.7 KiB
TeX

% HTML.sty
%
% Provide LaTeX definitions for the latex2html translator.
% Requires LaTeX2e or later
%
% Author: Jan Wielemaker, SWI, University of Amsterdam
% \onefile
%
% Do not section the output (i.e. put all output in the same HTML file).
\newcommand{\onefile}{}
% \bodycolor{Color}
%
% Define colour for running text body (<BODY BGCOLOR=Color>).
\newcommand{\bodycolor}[1]{}
% \linkimage{Id}{ImagePath}
%
% Define image to use for specified link id
\newcommand{\linkimage}[2]{}
% \htmlmainfile{File}
% \htmloutput{Directory}
%
% Define the main output file and directory
\newcommand{\htmlmainfile}[1]{}
\newcommand{\htmloutput}[1]{}
% htmlfiledepth{Depth}
%
% Defines the depth at which sections are split into separate files
% Default is 2 (each subsection produces a file). See also \onefile
\newcommand{\htmlfiledepth}[1]{}
% \email[TextToShow]{URL}
% \url[TextToShow]{URL}
%
% References to E-mail addresses and general URL's. If the optional
% argument is provided, this is the text printed for the label. Otherwise
% the address itself is printed.
\def\url{\@ifnextchar[{\@url}{\@plainurl}}
\def\@url[#1]#2{#1}
\def\@plainurl#1{{\tt #1}}
\let\email=\url
% \begin{shortlist} ... \end{shortlist}
%
% As itemize environment, but do not include extra space between the
% items.
\newenvironment{shortlist}{%
\begin{itemize}\setlength{\itemsep}{0pt}}{%
\end{itemize}}
% \begin{dlist} ... \end{dlist}
%
% As description environment, but start a newline after the item
\let\latexitem=\item
\newenvironment{dlist}{%
\begin{description}%
\def\item[##1]{\latexitem[##1]\hfill\\}}{%
\end{description}}
\newenvironment{itemlist}
{\itemize
\renewcommand\makelabel[1]{%
\hspace\labelwidth
\llap{\@itemlabel}%
\hspace\labelsep
\makebox[\linewidth][l]{\it ##1}%
\hspace{-\labelsep}}%
}%
{\enditemize}
% \var{Var}
%
% Indicate Var is a variable or argument.
\def\var#1{{\it #1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Comment.sty version 2.0, 19 June 1992
% selectively in/exclude pieces of text: the user can define new
% comment versions, and each is controlled separately.
% This style can be used with plain TeX or LaTeX, and probably
% most other packages too.
%
% Examples of use in LaTeX and TeX follow \endinput
%
% Author
% Victor Eijkhout
% Department of Computer Science
% University Tennessee at Knoxville
% 104 Ayres Hall
% Knoxville, TN 37996
% USA
%
% eijkhout@cs.utk.edu
%
% Usage: all text included in between
% \comment ... \endcomment
% or \begin{comment} ... \end{comment}
% is discarded. The closing command should appear on a line
% of its own. No starting spaces, nothing after it.
% This environment should work with arbitrary amounts
% of comment.
%
% Other 'comment' environments are defined by
% and are selected/deselected with
% \includecomment{versiona}
% \excludecoment{versionb}
%
% These environments are used as
% \versiona ... \endversiona
% or \begin{versiona} ... \end{versiona}
% with the closing command again on a line of its own.
%
% Basic approach:
% to comment something out, scoop up every line in verbatim mode
% as macro argument, then throw it away.
% For inclusions, both the opening and closing comands
% are defined as noop
%
% Changed \next to \html@next to prevent clashes with other sty files
% (mike@emn.fr)
% Changed \html@next to \htmlnext so the \makeatletter and
% \makeatother commands could be removed (they were causing other
% style files - changebar.sty - to crash) (nikos@cbl.leeds.ac.uk)
% Changed \htmlnext back to \html@next...
\makeatletter
\def\makeinnocent#1{\catcode`#1=12 }
\def\csarg#1#2{\expandafter#1\csname#2\endcsname}
\def\ThrowAwayComment#1{\begingroup
\def\CurrentComment{#1}%
\let\do\makeinnocent \dospecials
\makeinnocent\^^L% and whatever other special cases
\endlinechar`\^^M \catcode`\^^M=12 \xComment}
{\catcode`\^^M=12 \endlinechar=-1 %
\gdef\xComment#1^^M{\def\test{#1}
\csarg\ifx{PlainEnd\CurrentComment Test}\test
\let\html@next\endgroup
\else \csarg\ifx{LaLaEnd\CurrentComment Test}\test
\edef\html@next{\endgroup\noexpand\end{\CurrentComment}}
\else \let\html@next\xComment
\fi \fi \html@next}
}
\makeatother
\def\includecomment
#1{\expandafter\def\csname#1\endcsname{}%
\expandafter\def\csname end#1\endcsname{}}
\def\excludecomment
#1{\expandafter\def\csname#1\endcsname{\ThrowAwayComment{#1}}%
{\escapechar=-1\relax
\csarg\xdef{PlainEnd#1Test}{\string\\end#1}%
\csarg\xdef{LaLaEnd#1Test}{\string\\end\string\{#1\string\}}%
}}
\excludecomment{comment}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\excludecomment{htmlonly}
\newenvironment{latexonly}{}{}