% EXPLANATION AND EXAMPLES OF NEWCOMMANDS
% CREATED FOR THE NMM WORKSHOP AT PZI

% COULD YOU PLEASE TRANSLATE THE EXPLANATIONS IN YOUR NATIVE LANGUAGE

\sectiontitle{graphic}

\section{use}

This command lets you include a graphic. It takes 5 parametres.

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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CODE BLOCK USING THE PACKAGE LSTLISTING %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% THIS IS THE CODE FOR THE COMMAND AND    %
% INCLUDED AS EXAMPLE                     %
% SPECIAL CHARACTERS ESCAPED              %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\codeline{language=TeX}{\\graphic\{0\}\{0\}\{400\}\{400\}\{path/to/graphic\}\{1pt\}}

\codeline{language=TeX}{\\graphic\{1\}\{2\}\{3\}\{4\}\{6\}}

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

\begin{itemize}
\item \textbf{1} is x start for the crop box
\item \textbf{2} is y start for the crop box
\item \textbf{3} is x end for the crop box
\item \textbf{4} is y end for the crop box
\item \textbf{5} is the path to the graphic
\item \textbf{6} is weight for the border around the image
\end{itemize}

\section{macro code}

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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CODE BLOCK USING THE PACKAGE LSTLISTING %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% THIS IS THE CODE FOR THE COMMAND AND    %
% INCLUDED AS EXAMPLE                     %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\lstset{language=TeX}
\begin{lstlisting}
\newcommand{\graphic}[7]{
\setlength\fboxsep{0pt}
\setlength\fboxrule{#7}
\fbox{
\includegraphics[viewport=#2 #3 #4 #5,clip,width=#6]{#1}
 }
}
\end{lstlisting}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{examples}
\newpage

\graphic{i/a/workshop/bag/i/non-free/p/font_preparation/2010-01-28--1264675408_1024x768_scrot.png}
        {0}{0}{989}{746}{\linewidth}
        {0pt}
\newpage
\graphic{i/a/workshop/bag/i/non-free/p/font_preparation/2010-01-28--1264675408_1024x768_scrot.png}
        {200}{200}{400}{400}{\linewidth}
        {0pt}
\newpage
\graphic{i/a/workshop/bag/i/non-free/p/font_preparation/2010-01-28--1264675408_1024x768_scrot.png}
        {-200}{-200}{1000}{1000}{\linewidth}
        {40pt}


