
% ZMLTeX definitions

\newcommand{\zapo}{\textsf{\textbf{Z}\emph{apo}}\TeX}

%% COLORS
\definecolor{ZMLTeXkeyword}{rgb}{0,0.,0.}
%\definecolor{ZMLTeXquanti}{rgb}{0.2,0,0}
\definecolor{ZMLTeXlident}{rgb}{0.2,0,0}
\definecolor{ZMLTeXuident}{rgb}{0,0.15,0}
\definecolor{ZMLTeXint}{rgb}{0,0,.3}
\definecolor{ZMLTeXfloat}{rgb}{.3,0,0.3}

\definecolor{ZMLTeXsymbol}{rgb}{0,0,0}
\definecolor{ZMLTeXtype}{rgb}{0,0.2,0.3}

\definecolor{ZMLTeXcodecommentA}{rgb}{.3,0.6,0.3}
\definecolor{ZMLTeXcodecommentB}{rgb}{.6,0.3,0.3}
\definecolor{ZMLTeXcodecommentC}{rgb}{.3,0.3,0.3}
\definecolor{ZMLTeXcodecommentDoc}{rgb}{.2,0.2,0.6}

\definecolor{ZMLTeXstring}{rgb}{0,0.4,0}
\definecolor{ZMLTeXchar}{rgb}{0.2,0.4,0}
\definecolor{ZMLTeXcomment}{rgb}{0,0,0}
\definecolor{ZMLTeXlinenb}{rgb}{0,0,0}

%% MISC
\newcommand\ZMLTeXtilde{\hbox{$\small\mathtt{\sim}$}}

% counting lines
\newcounter{ZMLTeXlines} % in the LaTeX document

% print line number; ignores the program's given line number,
% which reflects the order in which lines are processed
% but not that in which they appear in the document.
\newcommand\ZMLTeXlineNB[1]{\hspace*{-0.95cm}\tiny\addtocounter{ZMLTeXlines}{1}%
  \makebox[0.5cm][r]{\textcolor{ZMLTeXlinenb}{\arabic{ZMLTeXlines}}}\qquad}

% restore line number to 0
\newcommand\resetCode{\setcounter{ZMLTeXlines}{0}}

%% Output Aliases Mode
\newenvironment{ZMLTeXoutAllAliases}
  {\mbox{}\\\indent \begin{small}\ttfamily}
  {\end{small}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%% STYLES FOR CAML %%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\ZMLTeXkeyword[1]{\textcolor{ZMLTeXkeyword}{\textbf{#1}}}
\newcommand\ZMLTeXflow[1]{\textcolor{ZMLTeXkeyword}{\textbf{\textit{#1}}}}
\newcommand\ZMLTeXlident[1]{\textcolor{ZMLTeXlident}{#1}}
\newcommand\ZMLTeXlidentB[2]{#1${}_{\text{#2}}$}
\newcommand\ZMLTeXalias[1]{\textcolor{ZMLTeXlident}{#1}}
\newcommand\ZMLTeXaliasU[1]{\textcolor{ZMLTeXuident}{#1}}
\newcommand\ZMLTeXaliasSymb[1]{#1}
\newcommand\ZMLTeXuident[1]{\textcolor{ZMLTeXuident}{\emph{#1}}}
\newcommand\ZMLTeXint[1]{\textcolor{ZMLTeXint}{#1}}
\newcommand\ZMLTeXfloat[1]{\textcolor{ZMLTeXfloat}{#1}}
\newcommand\ZMLTeXsymbol[1]{\textcolor{ZMLTeXsymbol}{#1}}
\newcommand\ZMLTeXtype[1]{{\boldmath\textcolor{ZMLTeXtype}{{\textit{\textsf{#1}}}}}}
\newcommand\ZMLTeXcodecommentA[1]{\textcolor{ZMLTeXcodecommentA}{\itshape\footnotesize {(*#1*)}}}
\newcommand\ZMLTeXcodecommentB[1]{\textcolor{ZMLTeXcodecommentB}{\itshape\footnotesize {(*#1*)}}}
\newcommand\ZMLTeXcodecommentC[1]{\textcolor{ZMLTeXcodecommentC}{\itshape\footnotesize {(*#1*)}}}
\newcommand\ZMLTeXcodecommentDoc[1]{\textcolor{ZMLTeXcodecommentDoc}{\itshape\footnotesize {(**#1*)}}}
\newcommand\ZMLTeXstring[1]{\textcolor{ZMLTeXstring}{"#1"}}
\newcommand\ZMLTeXchar[1]{\textcolor{ZMLTeXchar}{'#1'}}
\newenvironment{ZMLTeXcommenttex}
  {\normalsize\rmfamily\color{ZMLTeXcomment}\unboldmath\begin{minipage}[b]{14cm}$\llparenthesis$}
  {\noindent$\rrparenthesis$\end{minipage}}
\newenvironment{ZMLTeXml}
  {\,\begin{small}\ttfamily\mbox{}}
  {\,\end{small}}
\newenvironment{ZMLTeXmlDisplay}
  {\small\ttfamily\renewcommand\ZMLTeXlineNB[1]{}\mbox{}\smallskip\par\centering}
  {\mbox{}\smallskip\\}
%% LOAD A CAML TEX SOURCE FILE
\def\loadCAML#1{\noindent\mbox{}\\{\begin{ZMLTeXml}\noindent\input{#1}\end{ZMLTeXml}}\noindent}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%% STYLES FOR PROLOG %%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand\ZPLTeXkeyword[1]{\textcolor{ZMLTeXkeyword}{\textbf{#1}}}
\newcommand\ZPLTeXflow[1]{\textcolor{ZMLTeXkeyword}{\textbf{\textit{#1}}}}
\newcommand\ZPLTeXlident[1]{\textcolor{ZMLTeXlident}{#1}}
\newcommand\ZPLTeXlidentB[2]{#1${}_{\text{#2}}$}
\newcommand\ZPLTeXalias[1]{\textcolor{ZMLTeXlident}{#1}}
\newcommand\ZPLTeXaliasU[1]{\textcolor{ZMLTeXuident}{#1}}
\newcommand\ZPLTeXaliasSymb[1]{#1}
\newcommand\ZPLTeXuident[1]{\textcolor{ZMLTeXuident}{\emph{#1}}}
\newcommand\ZPLTeXint[1]{\textcolor{ZMLTeXint}{#1}}
\newcommand\ZPLTeXfloat[1]{\textcolor{ZMLTeXfloat}{#1}}
\newcommand\ZPLTeXsymbol[1]{\textcolor{ZMLTeXsymbol}{#1}}
\newcommand\ZPLTeXtype[1]{{\boldmath\textcolor{ZMLTeXtype}{{\textit{\textsf{#1}}}}}}
\newcommand\ZPLTeXcodecommentA[1]{\textcolor{ZMLTeXcodecommentA}{\itshape\footnotesize {/*#1*/}}}
\newcommand\ZPLTeXcodecommentB[1]{\textcolor{ZMLTeXcodecommentB}{\itshape\footnotesize {/*#1*/}}}
\newcommand\ZPLTeXcodecommentC[1]{\textcolor{ZMLTeXcodecommentC}{\itshape\footnotesize {/*#1*/}}}
\newcommand\ZPLTeXcodecommentDoc[1]{\textcolor{ZMLTeXcodecommentDoc}{\itshape\footnotesize {/**#1*/}}}
\newcommand\ZPLTeXcodecommentLine[1]{\textcolor{ZMLTeXcodecommentA}{\itshape\footnotesize {\%#1}}}
\newcommand\ZPLTeXstring[1]{\textcolor{ZMLTeXstring}{"#1"}}
\newcommand\ZPLTeXchar[1]{\textcolor{ZMLTeXchar}{'#1'}}
\newenvironment{ZPLTeXcommenttex}
  {\normalsize\rmfamily\color{ZMLTeXcomment}\unboldmath\begin{minipage}[b]{14cm}$\llparenthesis$}
  {\noindent$\rrparenthesis$\end{minipage}}
\newenvironment{ZPLTeXpl}
  {\,\begin{small}\ttfamily\mbox{}}
  {\,\end{small}}
\newenvironment{ZPLTeXplDisplay}
  {\small\ttfamily\renewcommand\ZMLTeXlineNB[1]{}\mbox{}\smallskip\par\centering}
  {\mbox{}\smallskip\\}
%% LOAD A PROLOG TEX SOURCE FILE
\def\loadPROLOG#1{\noindent\mbox{}\\{\begin{ZPLTeXpl}\noindent\input{#1}\end{ZPLTeXpl}}\noindent}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%% STYLES FOR B Meth %%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \definecolor{Bkeyword}{rgb}{0.3,0,0}
% \definecolor{Blident}{rgb}{0.1,0,0.1}
% \definecolor{Buident}{rgb}{0,0.1,0.1}

\newcommand\ZBTeXkeyword[1]{\textcolor{ZMLTeXkeyword}{\textbf{#1}}}
\newcommand\ZBTeXflow[1]{\textcolor{ZMLTeXkeyword}{\textbf{\textit{#1}}}}
\newcommand\ZBTeXlident[1]{\textcolor{ZMLTeXlident}{#1}}
\newcommand\ZBTeXlidentB[2]{#1${}_{\text{#2}}$}
\newcommand\ZBTeXalias[1]{\textcolor{ZMLTeXlident}{#1}}
\newcommand\ZBTeXaliasU[1]{\textcolor{ZMLTeXuident}{#1}}
\newcommand\ZBTeXaliasSymb[1]{#1}
\newcommand\ZBTeXuident[1]{\textcolor{ZMLTeXuident}{\emph{#1}}}
\newcommand\ZBTeXint[1]{\textcolor{ZMLTeXint}{#1}}
\newcommand\ZBTeXfloat[1]{\textcolor{ZMLTeXfloat}{#1}}
\newcommand\ZBTeXsymbol[1]{\textcolor{ZMLTeXsymbol}{\texttt{#1}}}
\newcommand\ZBTeXtype[1]{{\boldmath\textcolor{ZMLTeXtype}{{\textit{\textsf{#1}}}}}}
\newcommand\ZBTeXcodecommentA[1]{\textcolor{ZMLTeXcodecommentA}{\itshape\footnotesize {/*#1*/}}}
\newcommand\ZBTeXcodecommentB[1]{\textcolor{ZMLTeXcodecommentB}{\itshape\footnotesize {/*#1*/}}}
\newcommand\ZBTeXcodecommentC[1]{\textcolor{ZMLTeXcodecommentC}{\itshape\footnotesize {/*#1*/}}}
\newcommand\ZBTeXcodecommentDoc[1]{\textcolor{ZMLTeXcodecommentDoc}{\itshape\footnotesize {/**#1*/}}}
\newcommand\ZBTeXcodecommentLine[1]{\textcolor{ZMLTeXcodecommentA}{\itshape\footnotesize {\%#1}}}
\newcommand\ZBTeXstring[1]{\textcolor{ZMLTeXstring}{"#1"}}
\newcommand\ZBTeXchar[1]{\textcolor{ZMLTeXchar}{'#1'}}
\newenvironment{ZBTeXcommenttex}
  {\normalsize\rmfamily\color{ZMLTeXcomment}\unboldmath\begin{minipage}[b]{14cm}$\llparenthesis$}
  {\noindent$\rrparenthesis$\end{minipage}}
\newenvironment{ZBTeXb}
  {\,\begin{small}\sffamily\mbox{}}
  {\,\end{small}}
\newenvironment{ZBTeXbDisplay}
  {\small\sffamily\renewcommand\ZMLTeXlineNB[1]{}\mbox{}\smallskip\par\centering}
  {\mbox{}\smallskip\\}
%% LOAD A PROLOG TEX SOURCE FILE
\def\loadB#1{\noindent\mbox{}\\{\begin{ZBTeXb}\noindent\input{#1}\end{ZBTeXb}}\noindent}


%% VERBATIM/COMMENT ALIASES

% % Caml | Display Caml | Command Caml
% \let\Zml=\verb
% \newenvironment{ZML}{\verbatim}{\endverbatim} 
% \newenvironment{ZZml}{\comment}{\endcomment}
% % Prolog | Display Prolog | Command Prolog
% \let\Zpl=\verb
% \newenvironment{ZPL}{\verbatim}{\endverbatim} 
% \newenvironment{ZZpl}{\comment}{\endcomment}
% % B | Display B | Command B
% \let\Zb=\verb
% \newenvironment{ZB}{\verbatim}{\endverbatim} 
% \newenvironment{ZZb}{\comment}{\endcomment}
