% -*- tex -*-
%
% This file contains macros which are used when translating
% to HTML using Hevea. By Luc Maranget and Eric Marsden.

\newif\ifhmode\hmodefalse
\newcommand{\xspace}{}
\let\hbox\mbox
\def\hfil{}
\def\hfill{}
\newcommand{\parbox}[3][]{\mbox{#3}}
\newcommand{\lengthtest}[1]{true}
\newenvironment{minipage}[2][]{}{}
\newcommand{\layout}[4][]
  {\@open{DIV}{align=left}
   [#4] \\
   \fcnname{#1}\fcnname{#2} #3 \@print{&nbsp;&nbsp;&nbsp;}
   \@close{DIV}}

% \newcommand{\layout}[4][]
%   {\begin{tabular}
%    {llp{10cm}@{\hspace{10cm}}r}\fcnname{#1} &
%    \fcnname{#2} &
%    \begin{flushleft}#3\end{flushleft} &
%    [#4]
%    \end{tabular}}


\newcommand{\fcntype}[1]{\@open{TT}{class=function-type}#1\@close{TT}}
\newcommand{\argtype}[1]{\@open{TT}{class=argument-type}#1\@close{TT}}
\newcommand{\fcnname}[1]{\@open{TT}{class=function-name}#1\@close{TT}}
\newcommand{\var}[1]{\@open{TT}{class=variable}#1\@close{TT}}
\newcommand{\code}[1]{\@open{TT}{class=code}#1\@close{TT}}
\newcommand{\file}[1]{\@open{TT}{class=filename}#1\@close{TT}}


%% Define a new type
%%
%% \begin{deftp}{typeclass}{typename}{args}
%%    some description
%% \end{deftp}
\newenvironment{deftp}[3]
  {\par\bigskip\index[types]{#2|textbf}%
   \layout{#2}{\var{#3}}{#1}
   \begin{quote}}
  {\end{quote}}

%% Define a function
%%
%% \begin{defun}{pkg}{name}{params}
%%   \defunx[pkg]{name}{params}
%%   description of function
%% \end{defun}
\newenvironment{defun}[3]
  {\par\defunvspace\fnindexbold{#2}\label{FN:#2}%
  \layout[#1]{#2}{#3}{Function}
  \begin{quote}}
  {\end{quote}}
\newcommand{\defunx}[3][\mbox{}]{%
  \par\fnindexbold{#2}\label{FN:#2}%
  \layout[#1]{#2}{#3}{Function}}

%% Define a macro
%%
%% \begin{defmac}{pkg}{name}{params}
%%   \defmacx[pkg]{name}{params}
%%   description of macro
%% \end{defmac}
\newenvironment{defmac}[3]{%
  \par\defunvspace\fnindexbold{#2}\label{FN:#2}%
  \layout[#1]{#2}{#3}{Macro}
  \begin{quote}}
  {\end{quote}}
\newcommand{\defmacx}[3][\mbox{}]{%
  \par\fnindexbold{#2}\label{FN:#2}%
  \layout[#1]{#2}{#3}{Function}}

%% Define a variable
%%
%% \begin{defvar}{pkg}{name}
%%   \defvarx[pkg]{name}
%%   description of defvar
%% \end{defvar}
\newenvironment{defvar}[2]{%
  \par\defunvspace\vrindexbold{#2}\label{VR:#2}
  \layout[#1]{*#2*}{}{Variable}
  \begin{quote}}
  {\end{quote}}
\newcommand{\defvarx}[2][\mbox{}]{%
  \par\vrindexbold{#2}\label{VR:#2}
  \layout[#1]{*#2*}{}{Variable}}

%% Define a constant
%%
%% \begin{defconst}{pkg}{name}
%%   \defconstx[pkg]{name}
%%   description of defconst
%% \end{defconst}
\newenvironment{defconst}[2]{%
  \defunvspace\defconstx[#1]{#2}
  \begin{quote}}
  {\end{quote}}
\newcommand{\defconstx}[2][\mbox{}]{%
  \layout[#1]{#2}{}{Constant}}



% \@hr[NOSHADE]{.8\linewidth}{}
\newenvironment{example}
  {\@open{BLOCKQUOTE}{class=example}\begin{alltt}}
  {\end{alltt}\@close{BLOCKQUOTE}}
\newenvironment{lisp}
  {\@open{BLOCKQUOTE}{CLASS=lisp} \begin{alltt}}
  {\end{alltt}\@close{BLOCKQUOTE}}
\newcommand{\cmucl}{CMUCL}
  

% there are no page numbers in HTML, so we need to override certain
% cross-referencing macros
\newcommand{\pxlref}[1]{see section~\ref{#1}}
\newcommand{\xlref}[1]{See section~\ref{#1}}
\newcommand{\funref}[1]{\findexed{#1}}
\newcommand{\specref}[1]{\findexed{#1}}
\newcommand{\macref}[1]{\findexed{#1}}
\newcommand{\varref}[1]{\vindexed{#1}}
\newcommand{\conref}[1]{\conindexed{#1}}
\newcommand{\ctrl}[1]{\code{Ctrl-#1}}
\newcommand{\result}{==>}
\newcommand{\myequiv}{<==>}
\newcommand{\mopt}[1]{\code{\{#1\}}}
\newcommand{\mstar}[1]{\code{\{#1\}}$^*$}
\newcommand{\mplus}[1]{\code{\{#1\}}$^+$}
\newcommand{\mgroup}[1]{\code{\{#1\}}}


% disable ``this document generated by'' footer
\setcounter{footer}{0}

% \htmlhead{\@print{
% <a href="../../">CMUCL</a> -&gt
% <a href="../">Documentation</a> <br>}
% \@hr[NOSHADE]{.8\linewidth}{}\@print{<br>}}
% \htmlfoot{\@hr[NOSHADE]{.99\linewidth}{}
% \copyright{} 1995-2003 CMUCL Project}


\let\orig@meta=\@meta
\renewcommand{\@meta}{%
\orig@meta
\begin{rawhtml}
<link rel="stylesheet" href="cmucl.css" type="text/css">
<meta http-equiv="Content-Language" content="en">
\end{rawhtml}}


% when generating HTML, produce file names based on the chapter name
% instead of machine-generated numbers
\let\orig@input\input
\renewcommand{\input}[1]{\orig@input{#1}\cutname{#1.html}}
\htmlprefix{CMUCL User's Manual: }


% generate HTML with section headers on a blue background

\setcounter{cuttingdepth}{10}

\input{report.hva}
\input{fancysection.hva}
\definecolor{chapter}{rgb}{1, 1, 0.74}
\definecolor{part}{rgb}{1, 1, 0.81}
\definecolor{section}{rgb}{1, 1, 0.83}
\definecolor{subsection}{rgb}{1, 1, 0.89}
\definecolor{subsubsection}{rgb}{1, 1, 0.93}
\renewcommand{\@bodyargs}{}

% EOF
