%
% === General definitions and packages to use
%
\documentclass[11pt,twoside,a4paper,fleqn]{book} 
%\documentclass[11pt,twoside,a4paper,fleqn,draft]{book} 
%\includeonly{development,matrix_vector,interpolation,agendas,app_groups}
%\includeonly{development,agendas,app_groups}
%\includeonly{introduction,concept,fm_definitions}
%\includeonly{scattering,fm_definitions,ppath}
%\includeonly{polarization}
%\includeonly{integration}
%\includeonly{scattering}
%\includeonly{absorption}
%
%
% allow us to use if-then-else in TeX macros
\usepackage{ifthen}

% Detect if we're running PDFLaTeX or good 'ol vanilla LaTeX
\newif\ifpdf
  \ifx\pdfoutput\undefined
  \pdffalse
\else
  \pdfoutput=1
  \pdftrue
\fi

%
% === General definitions and packages to use
%
\usepackage[]{fancyhdr}   
\usepackage[]{natbib}
\usepackage{alltt}
\usepackage{times}
\usepackage{verbatim}
\usepackage{lscape}      % landscape mode of a single page
\usepackage[]{longtable} % allow tables longer than one page
\usepackage{makeidx}     % index of terms
\usepackage{tabularx}    % allows line breaking in table columns
\usepackage{algorithm}   % for describing algorithms with pseudo-code
\usepackage{algorithmic}

% To avoid hyperref error:
\newcommand{\theHalgorithm}{\theHchapter.\arabic{algorithm}}

%
% === Some layout commands
%
\sloppy
\raggedbottom
\graphicspath{{Figs/}}
\makeindex
%
% with of the caption in longtable:
\setlength{\LTcapwidth}{0.9\textwidth} 
%
% Change brace type for comments in algorithmic
\renewcommand{\algorithmiccomment}[1]{(#1)}



%
% === Margins
%
\voffset-2.0cm
\headheight16pt
\headsep1.1cm
\textheight22cm
\hoffset-1.3cm
\oddsidemargin2.2cm
\textwidth14.0cm


%
% === Headings
%
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[LE,RO]{\small{\sc\thepage}}
\fancyhead[LO]{\small{\scshape\rightmark}}
\fancyhead[RE]{\small{\scshape\leftmark}}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{plain}{%
  \fancyhead{}
  \renewcommand{\headrulewidth}{0pt}
}  


%
% === Page layout definitions
%
% Chapters and sections.
\newcommand{\levela}[1]    {\chapter{#1}}
\newcommand{\levelb}[1]    {\section{#1}}
\newcommand{\levelc}[1]    {\subsection{#1}}
\newcommand{\leveld}[1]    {\subsubsection{#1}}
\newcommand{\levele}[1]    {\paragraph{#1}}
%
% Document history
\newcommand{\starthistory} {\begin{table}[b]  \begin{tabular}{l p{11cm}} 
                             \hline {\bf History} & \\ }
\newcommand{\stophistory}  {\end{tabular} \end{table} }
%
% Symbol table
\newcommand{\startsymbols} {\begin{table}[!t] \begin{center} 
                            \begin{tabular}{l l l}
                            {\bf Here} & {\bf In ARTS} & {\bf Description} 
                            \\ \hline \\ } 
\newcommand{\stopsymbols}  {\\ \hline \end{tabular} 
                            \caption{Examples of symbols used in this chapter,
                            the corresponding notation in the ARTS source code
                            and a short description of the quantity. }
                            \end{center} \end{table}}      
\newcommand{\startsymbolswithunits} 
                            {\begin{table}[!t] \begin{center} 
                            \begin{tabular}{l l l l}
                            {\bf Here} & {\bf Unit} & {\bf In ARTS} & {\bf Description} 
                            \\ \hline \\ } 
\newcommand{\stopsymbolswithunits} {\stopsymbols}

%
% === Symbol definitions
%
\input{symbol_defs.tex}



%
% === Command to write a ARTS variable or function with special style
%
\newcommand{\artsstyle}[1]      {\texttt{#1}}



%
% === Commands for easy indexing of term
%
% Index command to use when text and index reference are equal. Otherwise
% the normal \index command must be used.
\newcommand{\textindex}[1]   {#1\index{#1}}  
%
% Index command to make index for a workspace method. It writes out the
% function name in verbatim style and makes an index reference.
\newcommand{\wsmindex}[1]    {\artsstyle{#1}\index{workspace methods!#1}}  
%
% Index command to make index for workspace variable. Works as \wsmindex.
\newcommand{\wsvindex}[1]    {\artsstyle{#1}\index{workspace variables!#1}}
%
% Index command to make index for workspace agenda. Works as \wsmindex.
\newcommand{\wsaindex}[1]    {\artsstyle{#1}\index{workspace agendas!#1}}  
%
% Index command to make index for a ARTS file. Works as \wsmindex.
\newcommand{\fileindex}[1]   {\artsstyle{#1}\index{ARTS files!#1}}
%
% Index command to make index for an internal function. Works as \wsmindex.
\newcommand{\funcindex}[1]   {\artsstyle{#1}\index{internal ARTS functions!#1}}
%
% Index command to make index for a ARTS data structure. Works as \wsmindex.
\newcommand{\typeindex}[1] {\artsstyle{#1}\index{data types!#1}}


% For FIXMEs:
\newcommand{\FIXME}[1]{{\bfseries FIXME: #1}}


%%% BEGIN PDF/LaTeX specific options
\ifpdf
%%% PDFLaTeX -- options for PDF generation
  \usepackage[pdftex]{graphicx}    % includegraphics
  \DeclareGraphicsExtensions{.pdf}

  \usepackage{color}

  \usepackage
    [pdftex,                         % or dvips
     colorlinks=true,
     pdftitle={ARTS User Guide},
     pdfauthor={xyz},
     pdfsubject={},
     pdfkeywords={},
     bookmarks=true,
     bookmarksopen=false,
     pdfpagemode=None,
     plainpages=false,
     pdfpagelabels]
  {hyperref}

  \setcounter{tocdepth}{3}

\else
%%% BEGIN LaTeX-specific options

  \usepackage[dvips]{graphicx}    % includegraphics
  \DeclareGraphicsExtensions{.eps}

  \setcounter{tocdepth}{1}

%%% END of PDF/LaTeX specific options
\fi



\input{main}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: t
%%% End: 
