\definecolor{reddebian}{rgb}{0.84314,0.03922,0.32549}
\definecolor{bluedane}{rgb}{0.09020,0.56863,1}
\definecolor{greendane}{rgb}{0.43137,0.60784,0.14510}
\def\purpledane{violet}


\renewcommand{\thechapter}{\arabic{chapter}}
\renewcommand{\thesection}{\Roman{section}}
\renewcommand{\thesubsection}{\alph{subsection}}



\hypersetup{%
  pdftitle={Xia},
  pdfauthor={Geoffrey Gekiere, Anne Lamer, Michaël Nourry, Louis-Maurice de Sousa},
  pdfsubject={Xia},
  pdfkeywords={Xia, free software, html5, Inkscape},
  colorlinks= true,
  linkcolor = greendane,
  urlcolor = bluedane
  }

% margin size
\geometry{hscale=0.7,vscale=0.85}

\newcommand{\softmenu}[1]{\texttt{\textcolor{reddebian}{#1}}}

% alert environment
\newsavebox{\draftBox}
\newcommand{\curveDanger}{\textdbend}

\newlength{\WidthAlertBall}
\settowidth{\WidthAlertBall}{
  \begin{tikzpicture}
  \node{\curveDanger};
  \end{tikzpicture}
  }


% Style for alert box
\tikzstyle{alertbox}=[draw=red,rounded corners,inner xsep=1em,inner ysep=1ex]

% Style for alert ball
\tikzstyle{alertball}=[circle,ball color=red,text=white] 

\newenvironment{alert}{%
  \begin{lrbox}{\draftBox}% save content in \draftBox
    \begin{minipage}{.8\linewidth}%  
      \color{red}%
      \setlength{\parskip}{1ex plus 0.2ex minus 0.2ex}%
}{%
    \end{minipage}%
  \end{lrbox}% lrbox can only be used on separate lines (no paragraph)
  % use \usebox{\draftBox} instead
  \vspace{1.5ex}%

  \begin{tikzpicture}%
    \node [alertbox] (frame) {%
      \hspace{0.5\WidthAlertBall}%
      \usebox{\draftBox}%
    };%
    \node [alertball] (alert) at (frame.west) {\curveDanger};%
  \end{tikzpicture}%
  \vspace{1.5ex}%
}        

% tip environment
\newcommand{\thumbOK}{\large\leftthumbsup}

\newlength{\WidthTipBall}
\settowidth{\WidthTipBall}{%
  \begin{tikzpicture}%
    \node{\thumbOK};%
  \end{tikzpicture}%
}

\tikzstyle{tipball}=[circle,ball color=teal,text=white]

\tikzstyle{tipbox}=[draw=teal,rounded corners,inner xsep=1em,inner ysep=1ex]
                        
\newenvironment{tip}{%
  \begin{lrbox}{\draftBox}% saving content in \draftBox
    \begin{minipage}{.8\linewidth}%
      \color{teal}%
      \setlength{\parskip}{1ex plus 0.2ex minus 0.2ex}%
}{%
    \end{minipage}%
  \end{lrbox}% lrbox can only be used on separate lines (no paragraph)
  % use \usebox{\draftBox} instead
  \vspace{1.5ex}%
  \begin{tikzpicture}%
    \node [tipbox] (frame) {%
      \hspace{0.5\WidthTipBall}%
      \usebox{\draftBox}%
    };%
    \node [tipball] (tip) at (frame.west) {\thumbOK};%
  \end{tikzpicture}%
  \vspace{1.5ex}%
}    

% links environment
\newcommand{\rightHand}{\large\leftpointright}

\newlength{\WidthBallLinks}
\settowidth{\WidthBallLinks}{%
  \begin{tikzpicture}%
    \node{\rightHand};%
  \end{tikzpicture}%
}

\tikzstyle{linksball}=[circle,ball color=\purpledane,text=white]

\tikzstyle{linksbox}=[draw=\purpledane,rounded corners,inner xsep=1em,inner ysep=1ex]
                        
\newenvironment{links}{%
  \begin{lrbox}{\draftBox}% saving content in \draftBox
    \begin{minipage}{.8\linewidth}%
      \color{\purpledane}%
      \setlength{\parskip}{1ex plus 0.2ex minus 0.2ex}%
}{%
    \end{minipage}%
  \end{lrbox}% lrbox can only be used on separate lines (no paragraph)
  % use \usebox{\draftBox} instead
  \vspace{1.5ex}%
  \begin{tikzpicture}%
    \node [linksbox] (frame) {%
      \hspace{0.5\WidthBallLinks}%
      \usebox{\draftBox}%
    };%
    \node [linksball] (links) at (frame.west) {\rightHand};%
  \end{tikzpicture}%
  \vspace{1.5ex}%
}    
