%  !TeX  root  =  user_guide.tex
% % !TEX encoding = utf8
% !TEX TS-program = pdflatex

%%% Start with roman page numbers and change in section foreword
\pagenumbering{roman}

%%% encoding, utf8 should work for any localization
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 

%%% prevent overlapping numbers in toc.tex lists
\usepackage{tocloft}
\addtolength{\cftsecnumwidth}{0.5em}
\addtolength{\cftsubsecnumwidth}{0.7em}
\addtolength{\cftfignumwidth}{0.5em}
\addtolength{\cfttabnumwidth}{0.5em}

%%% Tip     
\usepackage{float}
\floatstyle{ruled}
\newfloat{Tip}{ht}{toa}
\floatname{Tip}{Astuce QGIS} % Change the second string to localize it

%%% build index
%%% see http://web.image.ufl.edu/help/latex/latex_indexes.shtml
\usepackage{makeidx}
\makeindex

%%% 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}{\textcolor{red}{DISCLAIMER: This section of 
the user guide has not yet been updated for consistency with Quantum GIS v\CURRENT. 
Read at your own risk!}}

%%% syllable division for better line breaks within commands
\sloppy

%%% font settings
\usepackage{helvet}
\renewcommand{\sfdefault}{phv}  % switch \sf to Helvetica T1
\renewcommand*{\familydefault}{\sfdefault} 
\usepackage{numprint}

%%% spacing and paragraph style
\renewcommand{\baselinestretch}{1.1}
\parskip1.5ex
\parindent 0pt

%%% hypertext links   
\usepackage[unicode, bookmarks=true, pdftitle={Manuel Utilisateur de QGIS 1.6}, pdfauthor={QGIS}, pdfsubject={Manuel Utilisateur de QGIS}, breaklinks=true, colorlinks=true, linkcolor=blue, urlcolor=red]{hyperref}

%%%   images              
\usepackage{subfig}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{shadows}

% list all the folders containing images. Add a new folder between {} with ./ at the start and / and the end {./new_file/}
\graphicspath{
{./images/}
{./operating_system_icons/}
{./getting_started_screenies/}
{./features_at_a_glance_screenies/}
{./working_with_vector_screenies/}
{./grass_integration_screenies/}
{./plugins_add_wfs_layer_images/}
{./plugins_coordinate_capture_images/}
{./plugins_decorations_images/}
{./plugins_delimited_text_images/}
{./plugins_diagram_overlay_images/}
{./plugins_spit_images/}
{./plugins_dxf2shape_converter_images/}
{./plugins_evis_images/}
{./plugins_ftools_images/}
{./plugins_geoprocessing_images/}
{./plugins_georeferencer_images/}
{./plugins_gps_images/}
{./working_with_raster_screenies/}
{./working_with_ogc_screenies/}
{./working_with_projections_screenies/}
{./plugins_grass_module_images/}
{./grass_integration_screenies/}
{./print_composer_screenies/}
{./plugins_screenies/}
{./plugins_interpolation_images/}
{./plugins_mapserver_export_images/}
{./plugins_ogr_converter_images/}
{./plugins_openstreetmap_images/}
{./plugins_oracle_raster_images/}
{./plugins_raster_terrain_images/}
{./plugins_quick_print_images/}
%{./plugins_table_manager_images/}
%{./plugins_raster_algebra_images/}
{./plugins_labeling_images/}
{./sponsors/}
}

% set the type of images to use without having to change it in the text, it's written by order of priority (latex will use a .jpg only if there is no .png)
\DeclareGraphicsExtensions{.pdf,.png,.jpg}

%deals with the float flood
\usepackage{placeins}

%%%   layout 
\usepackage{enumitem}
\usepackage{xspace}

% headers and footnotes with koma-script
\usepackage{scrpage2}
\clearscrheadings
\automark[subsection]{section}
\ihead[]{}
\chead[]{}
\ohead{\headmark}
\ifoot[]{\vspace{-10pt} \qg \CURRENT Manuel Utilisateur} % Change the string to localize it
\cfoot[]{}
\ofoot[\pagemark]{\vspace{-10pt}\pagemark}
\setheadsepline{1pt}
\setfootsepline{1pt}
\setheadwidth[0pt]{text}
\setfootwidth[0pt]{text}

\setkomafont{captionlabel}{\sffamily\bfseries} 
%\KOMAoptions{toc=flat,listof=flat}

%%% Bibliography     
%\usepackage{csquotes}
%\usepackage[style=authoryear]{biblatex}
\bibliographystyle{acm}
\renewcommand*{\bibname}{Literature and Web References} % Change the string to localize it

%%% Tip     
\usepackage{float}
\floatstyle{ruled}
\newfloat{Tip}{ht}{toa}
\floatname{Tip}{Astuce QGIS} % Change the second string to localize it

% math
\usepackage{amssymb}
\usepackage{pifont}
% tabular
\usepackage{array}
\usepackage{longtable}
\usepackage{colortbl}
\newcolumntype{r}{>{\columncolor{gray!20}}l}

% command to display degree sign
\newcommand\degrees[1]{\ensuremath{#1^\circ}}

%%% Localization, if you're not making the en_US' manual then you have to change this part to get a better visual product

\usepackage[frenchb]{babel} 
% used to get better list in french
\frenchbsetup{StandardLists=true}


%%% Macros QGIS Versions  

\def\CURRENT{1.6.0\xspace}
\def\OLD{1.5.0\xspace}
\def\VERYOLD{1.0\xspace}

%%% Shortcuts (don't use it within \url strings)
\newcommand{\qg}{QGIS\xspace}
\newcommand{\QG}{Quantum GIS\xspace}
\newcommand{\pg}{PostGIS\xspace}
\newcommand{\psq}{PostgreSQL\xspace}
\newcommand{\ppg}{PostgreSQL/PostGIS\xspace}
\newcommand{\map}{MapInfo\xspace}
\newcommand{\tux}{GNU/Linux\xspace}
\newcommand{\mac}{Mac OS X\xspace}
\newcommand{\mswin}{MS Windows\xspace}
\newcommand{\grass}{GRASS\xspace}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% guilabel
\newcommand{\guilabel}[1]{\textsf{#1}}

% filename
% usage: \filename{lakes.shp}
\newcommand{\filename}[1]{\texttt{#1}}

% usertext generic style for text that the user should type in from the keyboard
% % Note: for user input into a labelled text field in the GUI, see \inputtext
% usage: \usertext{qgis ---help}
\newcommand{\usertext}[1]{\texttt{#1}}
% 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:
\newcommand{\method}[1]{\textsf{\textit{#1}}}

% server	
%%% 	usage:  \server{myhost.de}
\newcommand{\server}[1]{\textit{#1}}

% dialog	
%%% 	usage:  \dialog{Layer Properties}	
\newcommand{\dialog}[1]{
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt] 
\draw (0,0) node[draw=black,rectangle,fill=gray!50]{\textbf{#1}};
\end{tikzpicture}
}

% guiheading			
%%% style for section heading that appear in dialog boxes such as Vector Layer Properties > metadata	
\newcommand{\guiheading}[1]{\textsf{#1}}

% keystroke
%%% 	usage:  \keystroke{Ctrl + P}		
\newcommand{\keystroke}[1]{%
\begin{tikzpicture}[line width=1pt,rounded corners=3pt,baseline=-3pt] 
\draw (0,0) node[fill=gray!50, inner ysep=4pt, inner xsep=7pt]{#1};
\end{tikzpicture}
}

% tab: for tabs in dialog boxes
% usage: \tab{General}
\newcommand{\tab}[1]{%
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt] 
\draw (0,0) node[draw=black,rectangle,top  color=gray!60,bottom  color=white]{#1};
\end{tikzpicture}
}

% checkbox
% usage:  \checkbox{Render}		
\newcommand{\checkbox}[1]{%
\begin{tikzpicture}[line width=1pt,baseline=-3pt] 
\draw (0,0) node[rectangle,fill=gray!30]{
\begin{tikzpicture}[line width=1pt,baseline=0pt] \draw[fill=white,draw=gray!70,drop  shadow] (0,0) rectangle (0.3,0.3);
\end{tikzpicture}
#1};
\end{tikzpicture}
}

% selecttext			
% usage: \selectstring{Outline style}{---Solid Line}
\newcommand{\selectstring}[2]{%
\begin{tikzpicture}[line width=1pt,baseline=-3pt] 
\draw (0,0) node[rectangle,fill=gray!20,inner ysep=2pt,inner xsep=3pt]{\guilabel#1\hspace{.2cm}
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt,rounded corners=2pt] 
\draw (0,0) node[draw=gray,rectangle,top  color=gray!60,bottom  color=white,drop  shadow]{#2
\begin{tikzpicture}[line width=1pt,baseline=4pt] 
\draw[draw=gray] (0,0) -- (0,0.5);
\end{tikzpicture}
\begin{tikzpicture}[scale=0.15,baseline=1pt]
\fill (0,2)--(2,2)--(1,0)--cycle;
\end{tikzpicture}
};
\end{tikzpicture}
};
\end{tikzpicture}
}

% input text:					
%%% 	a labelled field in a dialog box where the user types in text
%%% 	usage: \inputtext{Display Name}{lakes.shp}
\newcommand{\inputtext}[2]{%
\begin{tikzpicture}[line width=1pt,baseline=-3pt] 
\draw (0,0) node[rectangle,fill=gray!20,inner ysep=2pt,inner xsep=3pt]{\guilabel#1\hspace{.5cm}
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt,rounded corners=2pt] 
\draw (0,0) node[draw=gray,rectangle,fill=white,drop  shadow]{#2};
\end{tikzpicture}
};
\end{tikzpicture}
}

% selectcolor: a selection field for colors
% usage: \selectcolor{Outline color}{yellow}
\newcommand{\selectcolor}[2]{%
\begin{tikzpicture}[line width=1pt,baseline=-3pt] 
\draw (0,0) node[rectangle,fill=gray!20,inner ysep=2pt,inner xsep=3pt,baseline=3pt]{\guilabel#1\hspace{.2cm}
\begin{tikzpicture}[line width=0.5pt,rounded corners=2pt] 
\draw[draw=gray,rectangle,fill=#2,drop  shadow] (0,0) rectangle (1,0.5);
\end{tikzpicture}
};
\end{tikzpicture}
}

% \selectnumber			
%%%  selectnumber: a selection field with numerical values
% usage: \selectnumber{Hue}{60}	
\newcommand{\selectnumber}[2]{%
\begin{tikzpicture}[line width=1pt,baseline=-3pt] 
\draw (0,0) node[rectangle,fill=gray!20,drop  shadow]{\guilabel#1
\begin{tikzpicture}[line width=1pt,baseline=-3pt] 
\draw (0,0) node[fill=white]  {#2};
\end{tikzpicture}
\begin{tikzpicture}[scale=0.3]
\draw[draw=black,line width=2pt,line join=round,line cap=round] (0,0.3) -- (0.5,0.6) -- (1,0.3);
\draw[draw=black,line width=2pt,line join=round,line cap=round] (0,-0.3) -- (0.5,-0.6) -- (1,-0.3);
\end{tikzpicture}};
\end{tikzpicture}
}

% mainmenuopt	
%%% 	usage: \mainmenuopt{Layer}
\newcommand{\mainmenuopt}[1]{%
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt] 
\draw (0,0) node[draw=black,rectangle,top  color=gray!60,bottom  color=white,drop  shadow]{#1};
\end{tikzpicture}
}


% button		
%%% 	usage: \button{Save as Default}	
\newcommand{\button}[1]{%
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt,rounded corners=2pt] 
\draw (0,0) node[draw=black,rectangle,top  color=gray!60,bottom  color=white,drop  shadow]{#1};
\end{tikzpicture}
}

% clicklistitem
%%% 	 clickable list item in a dialog box the actual text in the list item will 	 	
%%% 	usage: \clicklistitem{Canadian Land}
\newcommand{\clicklistitem}[1]{%
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt,rounded corners=2pt] 
\draw (0,0) node[draw=black,rectangle,top  color=gray!60,bottom  color=white,drop  shadow]{#1};
\end{tikzpicture}
}

% browsebutton	
%%% 	 a button with 3 dots, used to browse for files
%%% 		usage: \browsebutton
\newcommand{\browsebutton}{%
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt,rounded corners=2pt] 
\draw (0,0) node[draw=black,rectangle,top  color=gray!60,bottom  color=white,drop  shadow,inner ysep=7pt]{\dots};
\end{tikzpicture}
}

% radiobuttonoff
%%% 	 pour les boutons radio non sélectionnés
%%% 	usage: \radiobuttonoff{EPSG ID}	
\newcommand{\radiobuttonoff}[1]{%
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt] 
\draw (0,0) node[fill=gray!20]{
\begin{tikzpicture}[baseline=-3pt,inner ysep=1pt,inner xsep=3pt] 
\draw[fill=gray!20,line width=1pt,draw=gray!70,drop  shadow] (0,0) circle (6pt);
\draw (0.5,0) node[anchor=west]{\guilabel#1};
\end{tikzpicture}};
\end{tikzpicture}
}

% radiobuttonoff
%%% 	 pour les boutons radio sélectionnés	
%%% 	usage: \radiobuttonon{Postgis SRID}
\newcommand{\radiobuttonon}[1]{%
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt] 
\draw (0,0) node[fill=gray!20]{
\begin{tikzpicture}[baseline=-3pt,inner ysep=1pt,inner xsep=3pt] 
\fill[black] (0,0) circle (3pt);
\draw[line width=1pt,gray!70] (0,0) circle (6pt);
\draw (0.5,0) node[anchor=west]{\guilabel#1};
\end{tikzpicture}};
\end{tikzpicture}
}

% slider		
%%% 	 these appear in several dialog boxes	
%%% 	usage: \slider{Transparency}
\newcommand{\slider}[1]{
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt] 
\draw (0,0) node[fill=gray!20,anchor=west]{#1 10\% %
\begin{tikzpicture}[baseline=-3pt,inner ysep=1pt,inner xsep=3pt] 
\draw[gray!50] (0,0) rectangle (2,0.1);
\draw [draw=gray,fill=gray!50,drop  shadow,rounded corners=0.5pt] (0.5,0.25) -- (0.5,-0.05)--(0.6,-0.15)--(0.7,-0.05)--(0.7,0.25)--cycle;
\end{tikzpicture}};
\end{tikzpicture}
}

% dropmenuopt
%%% 	 sous menu sans icône avec 2ème choix
%%% 	usage: \dropmenuopt{Toolbar Visibility}
\newcommand{\dropmenuopt}[1]{%
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt] 
\draw (0,0) node[draw=black,rectangle,top  color=gray!60,bottom  color=white,drop  shadow]{\guilabel{#1}\hspace{0.2cm}$\blacktriangleright$};
\end{tikzpicture}
}

% dropmenuopttwo
%%% 	usage: \dropmenuopt{Toolbar Visibility}
% dropmenuopttwo: for dropdown menu items with icons
% usage: \mainmenuopt{Layer} > 
% \dropmenuopttwo{mActionAddRasterLayer}{Add a Raster Layer}
\newcommand{\dropmenuopttwo}[2]{%
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt] 
\draw (0,0) node[draw=black,rectangle,top  color=gray!60,bottom  color=white,drop  shadow]{\includegraphics[width=3mm]{#1} \guilabel{#2}};
\end{tikzpicture}
}

% dropmenuoptthree		
% usage: \dropmenuopttree{image}{Toolbar Visibility}
\newcommand{\dropmenuoptthree}[2]{%
\begin{tikzpicture}[line width=0.5pt,baseline=-3pt] 
\draw (0,0) node[draw=black,rectangle,top  color=gray!60,bottom  color=white,drop  shadow]{\includegraphics[width=3mm]{#1} \guilabel{#2}\hspace{1cm}$\blacktriangleright$};
\end{tikzpicture}
}

%%%	toolbar

% dropmenucheck: for dropdown menu checkboxes
% usage: \mainmenuopt{View} > \dropmenucheck{Legend}
\newcommand{\dropmenucheck}[1]{%
\begin{tikzpicture}[line width=1pt,baseline=-3pt] 
\draw (0,0) node[rectangle,fill=gray!30]{
\begin{tikzpicture}[line width=1pt,baseline=2pt] 
\draw[fill=white,draw=gray!70,drop  shadow] (0,0) rectangle (0.4,0.4);
\draw (0.2,0.2) node{\ding{51}};
\end{tikzpicture}
#1};
\end{tikzpicture}
}


%% arrow
\newcommand{\arrow}{%
\begin{tikzpicture}[line width=1.5pt,,baseline=0pt] 
\draw[->] (0,0.3) |- (0.5,0);
\end{tikzpicture}
}


% toolbtntwo
% usage: \toolbtntwo{image}{Add a Raster Layer}
\newcommand{\toolbtntwo}[2]{%
\begin{tikzpicture}[line width=1pt,baseline=-3pt] 
\draw (0,0) node[draw,inner sep=3pt,rounded corners=3pt,drop  shadow,fill=white]{\includegraphics[width=5mm]{#1}};
\draw (0.6,0)node[draw=black,rectangle,fill=yellow!10,anchor=west]{\guilabel{#2}};
\end{tikzpicture}
}

%\toolbox
%Used only for menu items (modules) in the GRASS toolbox. 
%These icons may use 1 or more 
%images, and so require different numbers of arguments.
% \toolboxtwo takes two arguments: one image name and a text label, and so on.
%The images have names like nviz.1.eps.
%This naming convention, or something like it, is required because some modules
%require a set of images to represent them, indicating for example, the
%starting format and the ending format of a conversion module. When
%referring to these images in the latex source, it is necessary to
%include the .eps extension, otherwise the \includegraphics macro looks
%for nviz.1 and can't find it. 
% toolboxtwo
% usage: \toolboxtwo{nviz}{nviz - Open 3D-View in NVIZ}
\newcommand{\toolboxtwo}[2]{%
\begin{tikzpicture}[line width=1pt,baseline=-3pt,inner ysep=4pt,inner xsep=3pt] 
\draw (0,0) node[rectangle,fill=gray!20,baseline=3pt]{
\begin{tikzpicture}[baseline=5pt] 
\includegraphics[width=5mm]{#1}
\end{tikzpicture}
  \hspace{0.5cm}\guilabel#2};
\end{tikzpicture}
}

%OS icons
\newcommand{\nix}[1]{\includegraphics[height=5mm]{nix} #1}
\newcommand{\win}[1]{\includegraphics[height=5mm]{win} #1}
\newcommand{\osx}[1]{\includegraphics[height=5mm]{osx} #1}
% add operation system icons to figure \caption
% usage: \caption{Text \wincaption}
\newcommand{\nixcaption}{\protect\includegraphics[height=4mm]{nix}}
\newcommand{\wincaption}{\protect\includegraphics[height=4mm]{win}}
\newcommand{\osxcaption}{\protect\includegraphics[height=4mm]{osx}}
