Index: trunk/tutorial/crealp-report.sty
===================================================================
--- trunk/tutorial/crealp-report.sty	(revision 11)
+++ trunk/tutorial/crealp-report.sty	(revision 12)
@@ -26,16 +26,38 @@
 
 \usepackage{listings}
+\usepackage{color}
+
+\definecolor{dkgreen}{rgb}{0,0.6,0}
+\definecolor{gray}{rgb}{0.5,0.5,0.5}
+\definecolor{mauve}{rgb}{0.58,0,0.82}
 
 %% nouvelle commande pour les listings %%
 \newcommand{\crealplisting} [1]{
-\lstset{
-  language=#1,
-  breaklines=true
-  basicstyle=\ttfamily
-  showstringspaces=false,
-  columns=fullflexible,
-  frame=leftline,
-  captionpos=b
-}
+  \lstset{ %
+    backgroundcolor=\color{white},  % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
+    basicstyle=\footnotesize,       % the size of the fonts that are used for the code
+    breakatwhitespace=false,        % sets if automatic breaks should only happen at whitespace
+    breaklines=true,                % sets automatic line breaking
+    captionpos=b,                   % sets the caption-position to bottom
+    commentstyle=\color{dkgreen},   % comment style
+    deletekeywords={...},           % if you want to delete keywords from the given language
+    %escapeinside={\%*}{*)},         % if you want to add LaTeX within your code
+    %extendedchar=true,              % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
+    frame=single,                   % adds a frame around the code
+    keywordstyle=\color{blue},      % keyword style
+    language=#1,                % the language of the code
+    morekeywords={*,...},           % if you want to add more keywords to the set
+    numbers=left,                   % where to put the line-numbers; possible values are (none, left, right)
+    numbersep=5pt,                  % how far the line-numbers are from the code
+    numberstyle=\tiny\color{gray},  % the style that is used for the line-numbers
+    rulecolor=\color{black},        % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
+    showspaces=false,               % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
+    showstringspaces=false,         % underline spaces within strings only
+    showtabs=false,                 % show tabs within strings adding particular underscores
+    stepnumber=1,                   % the step between two line-numbers. If it's 1, each line will be numbered
+    stringstyle=\color{mauve},      % string literal style
+    tabsize=2,                      % sets default tabsize to 2 spaces
+    %title=\lstname                  % show the filename of files included with \lstinputlisting; also try caption instead of title
+  }
 }
 
Index: trunk/tutorial/model_tutorial.tex
===================================================================
--- trunk/tutorial/model_tutorial.tex	(revision 11)
+++ trunk/tutorial/model_tutorial.tex	(revision 12)
@@ -19,5 +19,5 @@
 
 \section{Introduction}
-This tutorial explains how to create a project ToolMap manually. This approach has the following advantages:
+This tutorial explains how to create a ToolMap project manually. This approach has the following advantages:
 \begin{enumerate*}
   \item It ensures the IDs used
@@ -25,5 +25,5 @@
   \item It allows better monitoring of model changes
 \end{enumerate*}
-The main disadvantage of this approach is the lack of user interface as well as the need for the user to have some knowledge of SQL. Finally, this approach has been developed to meet the need for rigor in the management of the geological data model.
+The main disadvantage of this approach is the lack of user interface as well as the need for the user to have some knowledge of SQL. Finally, this approach has been developed to meet the need for rigor in the management of the Swiss geological data model.
 
 
@@ -59,21 +59,95 @@
 
 \subsection{Layers}
-Open user\_content.txt using a spreadsheet and edit the thematic\_layers part. Each of the layers that we want to export should appear here. The structure is as follows (see figure ???):
+Open user\_content.txt using a spreadsheet and edit the thematic\_layers part. Each of the layers that we want to export should appear here. The structure is as follows (see figure~\ref{fig:layers}):
 \begin{description*}
   \item [LAYER\_INDEX] unique identifier of the layer
   \item [TYPE\_CD] layer spatial type as follow
     \begin{description*}
-      \item [0] Line
-      \item [1] Point
-      \item [2] Polygon
+      \item [0] = Line
+      \item [1] = Point
+      \item [2] = Polygon
     \end{description*}
   \item [LAYER\_NAME] the layer name. This name will be given to the SHP file when exporting
 \end{description*}
 
+\begin{figure} [hbp]
+	\centering
+    \includegraphics[width=.6\textwidth]{img/layers.png}
+    \caption{List of layers as shown in user\_content.txt}
+    \label{fig:layers}
+\end{figure}
+
 \subsection{Objects}
 
+Edit the file user\_content.txt to add objects. They must have the following structure (See figure:~\ref{fig:objects}):
+\begin{description*}
+  \item [OBJECT\_ID] object unique ID.
+  \item [OBJECT\_CD] object code, should not necessarily be unique
+  \item [OBJECT\_TYPE\_CD] object spatial type, uses same values as those described above for TYPE\_CD in thematic\_layers
+  \item [THEMATIC\_LAYERS\_LAYER\_INDEX] the index of the layer that the object refers to. The value 1 shown in the example (Figure 2) therefore relates to the theme Boreholes\_PT.
+  \item [OBJECT\_DESC\_0,1,2,3,4,5] object description in up to 5 languages.
+  \item [OBJECT\_ISFREQ] Set to 1 for frequent objects and 0 otherwise. This parameter is only taken into account for line type objects. Set to 0 for all point or polygon objects.
+  \item [SYMBOL\_CD] leave empty
+  \item [RANK] leave empty
+  \item [REMARK] leave empty
+\end{description*}
+
+\begin{figure} [hbp]
+	\centering
+    \includegraphics[height=.9\textheight]{img/objects.png}
+    \caption{Objects structure as described in user\_content.txt}
+    \label{fig:objects}
+\end{figure}
+
+
 \subsection{Attributes structure}
+Edit the file user\_structure.sql with Notepad (or even better with Notepad + +). For each topic containing attributes, there must be a SQL code of the type:
+
+\crealplisting{SQL}
+\begin{lstlisting}
+-- layer_at1 --
+CREATE TABLE `layer_at1` (
+  `OBJECT_ID` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`OBJECT_ID`),
+  KEY `LAYER_ATX_FKIndex1` (`OBJECT_ID`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+\end{lstlisting}
+This code is the basic template for creating an attribute table. The number after layer\_at (see line 2) indicates the layer index and refers to the LAYER\_INDEX column in user\_content.txt. In our example layer\_at1 describe the attributes for the layer Boreholes\_PT.
+Below are described the five attributes that can be used as well as the corresponding SQL code
+\begin{description*}
+  \item [Enumeration] \hfill \\
+    \crealplisting{SQL}
+    \begin{lstlisting}
+    `D_C_UNDERG` int(11) DEFAULT NULL COMMENT 'ENUMERATION',
+    \end{lstlisting}
+    If you add such fields, then you must also fill the list of supported values (see section~\ref{sec:attribute-values}).
+  \item [Text] \hfill \\
+    \begin{lstlisting}
+    `DESCRIPT` varchar(255) DEFAULT NULL,
+    \end{lstlisting}
+    The number next to the keyword varchar indicates the maximum text length. 
+  \item [Integer] \hfill \\
+    \begin{lstlisting}
+    `NUM_REF` int(11) DEFAULT NULL,       
+    \end{lstlisting}
+    There is no special option for integer fields
+  \item [Float]  \hfill \\
+
+    \begin{lstlisting}
+    `TEMP` decimal(5,2) DEFAULT NULL,
+    \end{lstlisting}
+    The two digits next to the keyword decimal indicate the field precision and scale. In this example, 5 is the precision and 2 is the scale. The precision represents the number of significant digits that are stored for values, and the scale represents the number of digits that can be stored following the decimal point. In this case, values that can be stored range from -999.99 to 999.99.
+  \item [Date] \hfill \\
+
+    \begin{lstlisting}
+    `REF_DATE` date DEFAULT NULL,
+    \end{lstlisting}
+    There is no special option for date fields
+\end{description*}
+
 
 \subsection{Value domain of the attributes}
+\label{sec:attribute-values}
+
 
 
