% Colors for links
\def\visited@color{\#0d46a3}
\def\link@color{\#4286f4}
\def\hover@color{\@getstylecolor{subsection}}
\newstyle{a:link}{color:\link@color;text-decoration:underline;}
\newstyle{a:visited}{color:\visited@color;text-decoration:underline;}
\newstyle{a:hover}{color:black;text-decoration:underline;background-color:\hover@color}


\newstyle{@media all}{@font-face \{
/* fira-sans-regular - latin */
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 400;
  src: url('fonts/fira-sans-v8-latin-regular.eot'); /* IE9 Compat Modes */
  src: local('Fira Sans Regular'), local('FiraSans-Regular'),
       url('fonts/fira-sans-v8-latin-regular.eot?\#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('fonts/fira-sans-v8-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
       url('fonts/fira-sans-v8-latin-regular.woff') format('woff'), /* Modern Browsers */
       url('fonts/fira-sans-v8-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
       url('fonts/fira-sans-v8-latin-regular.svg\#FiraSans') format('svg'); /* Legacy iOS */
\}}

% Compact layout
\newstyle{body}{
  max-width:750px;
  width: 85\%;
  margin: auto;
  background: \#f7f7f7;
  margin-top: 80px;
  font-size: 1rem;
}

% selects the index's title
\newstyle{.maintitle}{
  font-family: "Fira Sans", sans-serif;
  text-align: center;
}

\newstyle{h1, h2, h3}{
  font-family: "Fira Sans", sans-serif;
  font-weight: normal;
  border-bottom: 1px solid black;
}

\newstyle{pre}{
  font-size: 1rem;
  background: beige;
  border: 1px solid grey;
  padding: 10px;
  overflow-y:auto;
  white-space: pre-wrap;
}

% More spacing between lines and inside tables
\newstyle{p,ul}{line-height:1.3em}
\newstyle{.cellpadding1 tr td}{padding:1px 4px}

%Styles for caml-example and friends
\newstyle{div.caml-output}{color:maroon;}
\newstyle{div.caml-example pre}{margin:2ex 0px;}
% Styles for toplevel mode only
\newstyle{div.caml-example.toplevel div.caml-input::before}
         {content:"\#"; color:black;}
\newstyle{div.caml-example.toplevel div.caml-input}{color:\#006000;}
%%%
\newcommand{\input@color}{\htmlcolor{006000}}
\newcommand{\output@color}{\maroon}
\newcommand{\machine}{\tt}
\newenvironment{machineenv}{\begin{alltt}}{\end{alltt}}
\newcommand{\firstline}{\ }
\newcommand{\examplespace}{\ }
\newcommand{\nextline}{\examplespace\ }
\newcommand{\@zyva}{\firstline\renewcommand{\?}{\nextline}}
\let\?=\@zyva
\newenvironment{camlunder}{\@style{U}}{}
\newcommand{\caml}{\begin{alltt}\renewcommand{\;}{}\renewcommand{\\}{\char92}\def\<{\begin{camlunder}}\def\>{\end{camlunder}}\activebracefalse}
\newcommand{\endcaml}{\activebracetrue\end{alltt}
}
\renewcommand{\:}{\renewcommand{\?}{\@zyva}}
\newcommand{\var}[1]{\textit{#1}}

% Caml-example environment
\newcommand{\camlexample}[1]{
  \ifthenelse{\equal{#1}{toplevel}}
    {\renewcommand{\examplespace}{\ }}
    {\renewcommand{\examplespace}{}}
  \fi
  \@open{div}{class="caml-example #1"}
}
\newcommand{\endcamlexample}{
  \@close{div}
  \renewcommand{\examplespace}{\ }
}

\newcommand{\camlinput}{\@open{div}{class="caml-input"}}
\newcommand{\endcamlinput}{\@close{div}}
\newcommand{\camloutput}{\@open{div}{class="caml-output ok"}}
\newcommand{\endcamloutput}{\@close{div}}
\newcommand{\camlerror}{\@open{div}{class="caml-output error"}}
\newcommand{\endcamlerror}{\@close{div}}
\newcommand{\camlwarn}{\@open{div}{class="caml-output warn"}}
\newcommand{\endcamlwarn}{\@close{div}}

\newenvironment{library}{}{}
\newcounter{page}
\newenvironment{comment}{\begin{quote}}{\end{quote}}
\newcommand{\nth}[2]{\({#1}_{#2}\)}
\newenvironment{options}{\begin{description}}{\end{description}}


%%venant de macros.tex

\def\versionspecific#1{\begin{quote}\textsf{#1:}\quad}
\def\unix{\versionspecific{Unix}}
\def\endunix{\end{quote}}
\def\macos{\versionspecific{MacOS~9}}
\def\endmacos{\end{quote}}
\def\windows{\versionspecific{Windows}}
\def\endwindows{\end{quote}}

\def\requirements{\trivlist \item[\hskip\labelsep {\bf Requirements.}]}
\def\endrequirements{\endtrivlist}
\def\installation{\trivlist \item[\hskip\labelsep {\bf Installation.}]}
\def\endinstallation{\endtrivlist}
\def\troubleshooting{\trivlist \item[\hskip\labelsep {\bf Troubleshooting.}]}
\def\endtroubleshooting{\endtrivlist}

\newtheorem{gcrule}{Rule}

% Pour les tables de priorites et autres tableaux a deux colonnes, encadres

\def\entree#1#2{#1 & #2 \\}
\def\tableau#1#2#3{%
\par
\@open{div}{class="tableau"}
\begin{center}%
\begin{tabular*}{.8\linewidth}{#1}%
\multicolumn{1}{c}{\textbf{#2}} &
\multicolumn{1}{c}{\textbf{#3}} \\
%%#2 & #3 \\%
}%
\def\endtableau{\end{tabular*}\end{center}\@close{div}\par}

\newstyle{.tableau, .syntax, .syntaxleft}{
  /* same width as body */
  max-width: 750px;
  overflow-y: auto;
}

% L'environnement library (pour composer les descriptions des modules
% de bibliotheque).


\def\restoreindent{\begingroup\let\@listI=\@savedlistI}
\def\endrestoreindent{\endgroup}


% PDF stuff

\def\pdfchapterfold#1#2{}
\def\pdfsection#1{}
\def\pdfchapter{\pdfchapterfold{0}}

%%% Pour camlidl

\def\transl#1{$[\![\mbox{#1}]\!]$}

% Pour l'index
\usepackage{multind}
\let\indexentry=\index
\renewcommand{\index}[1]{\indexentry{\jobname}{#1}}
\def\ikwd#1{\indexentry{\jobname.kwd}{#1}}
% nth

\def\th{^{\mbox{\scriptsize th}}}
\renewcommand{\hbox}[1]{\mbox{#1}}

% Notations pour les metavariables
\def\nmth#1#2#3{\({#1}_{#2}^{#3}\)}
\def\optvar#1{[\var{#1}\/]}
\def\event{§§}
\def\fromoneto#1#2{$#1 = 1,\ldots{} , #2$}

\newcommand{\vfill}{}
\def\number{}
\def\year{2013}

% Pour alltt
\def\rminalltt#1{{\rm #1}}
\def\goodbreak{\ \\}
\def\@savedlistI{}

%List of links with no space around items
\newstyle{.li-links}{margin:0ex 0ex;}
\newenvironment{links}
{\setenvclass{itemize}{ftoc2}\setenvclass{li-itemize}{li-links}\itemize}
{\enditemize}

\newenvironment{maintitle}{\@open{div}{class="maintitle"}}{\@close{div}}

%%% References to modules in the standard library
\newcommand{\stdmoduleref}[1]{\ahref{libref/#1.html}{\texttt{#1}}}