%% Style definitions
%% [$Id$]
%% nothing to change below

% creating an Index using package makeidx
% see http://web.image.ufl.edu/help/latex/latex_indexes.shtml
\usepackage{makeidx}
\makeindex

% important for nice acroread-visualization as pdf.
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}

% To make all GRASS commands appear smooth
% found here: http://www.open4me.de/pdfprobleme.html
\usepackage{ae,aecompl}

% Change of Caption font and size
\usepackage[bf]{caption}
\renewcommand{\captionfont}{\small}

% Include HTML package for latex2html
% http://irb.cs.tu-berlin.de/leitfaden/manuale/latex-local/html/node20.html
\usepackage{html}

% change serif to helvetica
\usepackage{helvet}
\renewcommand{\sfdefault}{phv}  % switch \sf to Helvetica T1
\renewcommand*{\familydefault}{\sfdefault} 

% new command to suppress appendix captions
\def\afterfi#1\fi{\fi#1}
\let\ORIGaddtocontents\addtocontents
\newcommand*\dontaddtolof[2]{\edef\temp{#1}%
  \ifx\temp\ext@figure\else\afterfi\ORIGaddtocontents{#1}{#2}\fi}
\newcommand*\ignorelof{\let\addtocontents\dontaddtolof}
\newcommand*\obeylof{\let\addtocontents\ORIGaddtocontents}

% /usr/share/doc/texmf/latex/graphics/grfguide.ps.gz gibt als manual auskunft, wie 
% graficx-package for dvips and dvipdf and includegraphics 
\usepackage[dvips,dvipdf]{graphicx}
	\graphicspath{{./finalpix/}{../finalpix/}{images}}

% color package for dvips
\usepackage[dvips]{color}

% author-year-citation paket natbib (for cited literature)
\usepackage[numbers,square]{natbib}		
%  \bibpunct{(}{)}{,}{a}{}{;}

% A4:
\usepackage{typearea}                    
   \areaset[12mm]{17cm}{22cm}
\topmargin-0.2cm % A4

% For floating texts around images and tables
\usepackage{floatflt}

% to allow hyphenation for re-projection (composita)
\usepackage{hyphenat}

% header and footer package
\usepackage{fancyhdr}
% \setlength{\unitlength}{1mm}
\pagestyle{fancy}
\fancyhead{} %clear all fields
\fancyfoot{} %clear all fields

\fancyhead[RO]{\rightmark}  % print section right on odd
\fancyhead[LE]{\leftmark}   % print chapter left on even page
\fancyhead[CE,RE]{}         % empty
\fancyhead[LO,CO]{}         % empty
%Footer two-sided:
%\fancyfoot[LE,RO]{\thepage}
%\fancyfoot[RE,LO]{QGIS Installation and Coding Guide}
%Footer one-sided:
\fancyfoot[RE,RO]{\thepage} % pages in footer, single sided
\fancyfoot[LE,LO]{QGIS \CURRENT Installation and Coding Guide}

\renewcommand{\headrulewidth}{0.3pt}  %  ruler at top
\renewcommand{\footrulewidth}{0.3pt}  %  ruler at bottom

%define plain for chapter's first page:
\fancypagestyle{plain}{%
\fancyhf{}                 %clear all fields
\fancyfoot[C]{\thepage}    %put page into center footer
\renewcommand{\headrulewidth}{0pt}  % no ruler at top
\renewcommand{\footrulewidth}{0pt}} % no ruler at bottom

\pagenumbering{roman}
 
% for extra long tables
\usepackage{supertabular}

% create an automatic index
\usepackage{makeidx}

% for page-width tables
\usepackage{tabularx}


% rotate tables
\usepackage{rotating}

% table rows and cols with grey background color
\usepackage{colortbl}

% don't cover column lines
\usepackage{hhline}

% footer formating
\usepackage[bottom]{footmisc}

% row distance
\renewcommand{\baselinestretch}{1.1}             
\small\normalsize

% syllable division
\sloppy

% paragraph distance
\parskip1.5ex              

% indentation -> here 0
\parindent0ex

% also in article-style 5 structure level!
% 3 are enough... to keep it clear
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
% new definition for paragraph und subparagraph 
% paragraph
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
				{-3.25ex\@plus -1ex \@minus -.2ex}%
				{1ex \@plus .2ex}%
			{\normalfont\normalsize\bfseries}}
% subparagraph
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}%
				{-3.25ex\@plus -1ex \@minus -.2ex}%
				{1ex \@plus .2ex}%
			{\normalfont\normalsize\bfseries}}

% several graphics next to eachother counting  
\usepackage[normal]{subfigure}

% new command for subfigure to optimize distance between figures
\newcommand{\goodgap}{%
 \hspace{\subfigtopskip}%
 \hspace{\subfigbottomskip}}

% keep float-grafics in a section
\usepackage[below]{placeins}

% map index
\usepackage{float}
% generate new index for maps 
\newfloat{karte}{H}{maps}
 \floatstyle{plain}
 \floatname{karte}{Karte}

% command for subscript and superscript in formulars.
\newfont{\tensy}{cmsy10}
\newcommand{\hoch}[1]{{$\fontdimen16\tensy=3.0pt
                     \fontdimen17\tensy=3.0pt \mathrm{#1}$}}

% For 2 separated bib indices (lit and web)
\usepackage{bibtopic}

%Fonts for all QGIS/Unix commands
\newcommand{\qgis}{\texttt}

% using xspace
\usepackage{xspace}

%Macros QGIS Versions
\def\CURRENT{1.5\xspace}
\def\OLD{1.4\xspace}
\def\VERYOLD{1.0\xspace}

% add disclaimer about the revision status of a section
% usage: 
% when the revision of a section has been finalized, 
% comment out the following line:
% \updatedisclaimer
\newcommand{\updatedisclaimer}{DISCLAIMER: the Coding and Compilation Guide
has not yet been updated for consistency with Quantum GIS v\CURRENT. Read at
your own risk!}

\usepackage[bookmarks=true, pdftitle={QGIS Coding and Compilation Guide}, pdfauthor={QGIS Project}, pdfsubject={QGIS Coding and Compilation Guide}, breaklinks=true, colorlinks=true, linkcolor=blue,dvips]{hyperref}
% if colorlinks=false then add pdfborder={0 0 0} (no link boxes)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% using fancybox: for macros defined in conventions.tex
% options for boxes provided by fancybox package are:
% \fbox, \shadowbox, \doublebox, \ovalbox and \Ovalbox
\usepackage{fancybox}

% using xcolor: for macros defined in conventions.tex
\usepackage{xcolor}

% using amsmath: for macros defined in conventions.tex
\usepackage{amsmath}

% using amssymb: for macros defined in conventions.tex
\usepackage{amssymb}

% using stmaryrd: for macros defined in conventions.tex
\usepackage{stmaryrd}

\renewcommand{\@pnumwidth}{1.75em}
\renewcommand{\@tocrmarg}{2em} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Here are some styles for use only when discussing Python coding
% classname
% usage: \classname{NewLayer}
\newcommand{\classname}[1]{\textsf{\textbf{#1}}}
%
% object
% usage
\newcommand{\object}[1]{\textsf{\textit{#1}}}
%
% method
% usage: \method{classFactory}
\newcommand{\method}[1]{\textsf{\textit{#1}}}
\newcommand{\usertext}[1]{\texttt{#1}}
%
% filename
% usage: \filename{lakes.shp}
\newcommand{\filename}[1]{\texttt{#1}}
%
% server
% usage: \server{myhost.de}
\newcommand{\server}[1]{\textit{#1}}
% keystroke
% style for user input by individual keystrokes
% usage: \keystroke{p}, \keystroke{Ctrl+B}
\newcommand{\keystroke}[1]{\cornersize{.6}\ovalbox{\textsf{#1}}}
%
% add operation system figure in text
\newcommand{\nix}[1]{\includegraphics[height=5mm]{nix.eps} #1}
\newcommand{\win}[1]{\includegraphics[height=5mm]{win.eps} #1}
\newcommand{\osx}[1]{\includegraphics[height=5mm]{osx.eps} #1}
%
% add operation system icons to figure \caption
% usage: \caption{Text \wincaption}
\newcommand{\nixcaption}{\protect\includegraphics[height=4mm]{nix.eps}}
\newcommand{\wincaption}{\protect\includegraphics[height=4mm]{win.eps}}
\newcommand{\osxcaption}{\protect\includegraphics[height=4mm]{osx.eps}}
% OTHER STYLES
% some styles for the Qt GUI- these are placeholders at present
\newcommand{\qtmainmenuopt}[1]{\textsf{#1}}
\newcommand{\qtdropmenuopt}[1]{\textsf{#1}}
\newcommand{\qtdialog}[1]{\textsf{#1}}
% button: for any button that only has text, no icon
% usage: \button{Save as Default}
\newcommand{\button}[1]{%
\raisebox{-6pt}{%
\shadowbox{\guilabel{#1}}
}}
% dropmenuopttwo: for dropdown menu items with icons
% usage: \mainmenuopt{Layer} > 
% \dropmenuopttwo{mActionAddRasterLayer}{Add a Raster Layer}
\newcommand{\dropmenuopttwo}[2]{%
\raisebox{-6pt}{%
{%
\setlength{\fboxsep}{0pt}%
\shadowbox{\setlength{\fboxsep}{2pt}%
\fcolorbox[rgb]{.95,.95,0.8}[rgb]{.95,.95,0.8}%
{\includegraphics[width=3mm]{#1} \guilabel{#2}}}%
}}}
% guilabel
% generic style for text that appears in the GUI
% usage
\newcommand{\guilabel}[1]{\textsf{#1}}
