%
%
% Valentin Tablan 13/02/2002
%
% $Id: preamble.tex,v 1.4 2003/01/10 15:42:23 valyt Exp $

% This file is designed to be included at the begining of any latex document
% and handles things like pdf detection, notes command, paragraph spacing and
% indenting.
%

%PDF detection
\newif\ifpdf
\ifx\pdfoutput\undefined
  \pdffalse          % we are not running PDFLaTeX
\else
  \pdfoutput=1       % we are running PDFLaTeX
  \pdftrue
\fi

%packages

\ifpdf
  %PDF specific stuff
  \usepackage[
    pdftex,
    colorlinks=false,
    pdfborder=0,                %comment to get boxes around links
%   colorlinks=true,            %uncomment to get coloured links
    urlcolor=rltblue,               % \href{...}{...}
    anchorcolor=rltbrightblue,
    filecolor=rltgreen,             % \href*{...}
    linkcolor=rltdarkred,               % \ref{...} and \pageref{...}
    menucolor=webdarkblue,
    citecolor=webbrightgreen,
    pdftitle={Portable Information Extraction},
    pdfauthor={Valentin Tablan},
    pdfsubject={Information Extraction},
    pdfkeywords={IE GATE ANNIE},
%    pagebackref=true, 					%uncomment for back references
    pdfpagemode=None,
    bookmarksopen=true
    ]{hyperref}
  \usepackage[pdftex]{graphicx}
  \usepackage[pdftex]{color}
  \usepackage{thumbpdf}
\else
  %Latex specific stuff
  \usepackage[
      colorlinks=false,
%      colorlinks=true,
      urlcolor=rltblue,               % \href{...}{...}
      anchorcolor=rltbrightblue,
      filecolor=rltgreen,             % \href*{...}
      linkcolor=rltred,               % \ref{...} and \pageref{...}
      menucolor=webdarkblue,
      citecolor=webbrightgreen
      ]{hyperref}
  \usepackage[dvips]{graphicx}
  \usepackage[dvips]{color}
\fi


\definecolor{rltbrightred}{rgb}{1,0,0}
\definecolor{rltred}{rgb}{0.75,0,0}
\definecolor{rltdarkred}{rgb}{0.5,0,0}
%
\definecolor{rltbrightgreen}{rgb}{0,0.75,0}
\definecolor{rltgreen}{rgb}{0,0.5,0}
\definecolor{rltdarkgreen}{rgb}{0,0,0.25}
%
\definecolor{rltbrightblue}{rgb}{0,0,1}
\definecolor{rltblue}{rgb}{0,0,0.75}
\definecolor{rltdarkblue}{rgb}{0,0,0.5}
%
\definecolor{webred}{rgb}{0.5,.25,0}
\definecolor{webblue}{rgb}{0,0,0.75}
\definecolor{webgreen}{rgb}{0,0.5,0}
%
\definecolor{darkgrey}{rgb}{0.5,0.5,0.5}

% Use UTF-8 as encoding
%\usepackage[utf-8]{inputenc}
%\usepackage[T2A,T1]{fontenc}

%no paragraph indents
\setlength{\parindent}{0pt}

%extra spacing between paragraphs
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}

%
% notes - uncomment empty version for final
%
%\newcommand{\notes}[1]
%{
%  \colorbox{darkgrey}{
%    \begin{minipage}{\textwidth}
%    \color{white}
%    #1
%    \color{black}
%    \end{minipage}
%  }
%}

\newcommand{\notes}[1]
{
\setlength{\unitlength}{1mm}
\begin{picture}(0,0)(15, 0)
%\put(0,0){\rule{100\unitlength}{0.5\unitlength}}
\put(0,0) {\framebox{{\scriptsize {\sf {\bf note:}}}}}
\end{picture}%
  {\color{blue}
    \sf{
    \scriptsize{
    #1
    }
    }
  }
\begin{picture}(0,0)
\put(0,0){\rule{.5\baselineskip}{.5\baselineskip}}
\end{picture}%
}

\newcommand{\q}
{
\setlength{\unitlength}{1mm}
\begin{picture}(0,0)(20, 0)
\put(0,0) {\framebox{{\large {\sf {\bf ?}}}}}
\end{picture}
}

\newcommand{\ans}
{
\setlength{\unitlength}{1mm}
\begin{picture}(0,0)(20, 0)
\put(0,0) {\framebox{{\large {\sf {\bf !}}}}}
\end{picture}
}

\newcommand{\eg}
{
\setlength{\unitlength}{1mm}
\begin{picture}(0,0)(20, 0)
\put(0,0) {\framebox{{\large {\sf {\bf e.g.}}}}}
\end{picture}
}

\newcommand{\HBar}
{
\setlength{\unitlength}{1mm}
\begin{picture}(0,0)(0, 0)
\put(0,0){\rule{1in}{.5mm}}
\end{picture}
}


%\newcommand{\notes}[1]
%{
%  \tt{\scriptsize{
%
%  \begin{tabular}{l l}
%  {#1}
%  \end{tabular}
%
%  }}
%}


\renewcommand{\notes}[1]{}

%IF pdf mode is enabled it will create a PDF note (non printable)
\newcommand{\pdfnote}[1]{
  \ifpdf
    \pdfannot               % generic annotation
                        %
      width 10cm          % the dimension of the annotation can be controlled
      height 0cm          % via <rule spec>; if some of dimensions in
      depth  4cm          % <rule spec> is not given, the corresponding
                        % value of the parent box will be used.
    {                       %
      /Subtype /Text      % text annotation
      %/Open true        % if given then the text annotation will be opened
                        % by default
      /Contents           % text contents
        (#1)
    }
  \else
  \notes{#1}
  \fi
}

\newcommand{\delete}[1]{}
\newcommand{\omitted}[1]{{\small \sf =OMITTED=}}


\usepackage[english]{babel}
