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

% COULD YOU PLEASE TRANSLATE THE EXPLANATIONS IN YOUR NATIVE LANGUAGE

\section{flexcommentbox}

\subsection{use}

This command creates a box that can be moved around the page.

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

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

\codeline{language=TeX}{\\flexcommentbox\{.5\\paperwidth\}\{.5\\paperheight\}\{.5\\textwidth\}\{\\color\{white\}content here\}}

\codeline{language=TeX}{\\flexcommentbox\{1\}\{2\}\{3\}\{4\}}

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

\begin{itemize}
\item \textbf{1} is the X position
\item \textbf{2} is the Y position
\item \textbf{3} is the width
\item \textbf{4} is what is inside (not outside) the box
\end{itemize}

Height adjusts to the content of the box.

\subsection{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\flexcommentbox[4]
{%
\deffootnote[1.5em]{1.5em}{1em}{\textsuperscript{}}
\footnotetext{
\setlength\fboxsep{10pt}%
         \vspace{#2}
         \makebox[.5\textwidth][l]{
          \hspace{#1}
          \parbox{#3}{
          \vspace{-1\textheight}
\colorbox{black}{%
                {\small
                \parbox{#3}{
                \smallskip
                #4 %
                \smallskip
                }
     }
    }
   }
  }
 }
}
\end{lstlisting}









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

\newpage
\thispagestyle{empty}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HERE THE EXAMPLE IS INCLUDED AS COMMAND %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%               X POSITION    Y POSITION   WIDTH
\flexcommentbox{.1\textwidth}{.3\textheight}{\textwidth}
 {\color{white}\codeinline{language=TeX}{\\flexcommentbox\{.1\\textwidth\}\{.2\\textheight\}\{.5\\textwidth\}\{\}}}

%               X POSITION    Y POSITION   WIDTH
\flexcommentbox{.5\textwidth}{-.2\textheight}{.8\textwidth}
 {\color{white}\codeinline{language=TeX}{\\flexcommentbox\{.5\\textwidth\}\{-.2\\textheight\}\{.5\\textwidth\}\{\}}}


\renewcommand\flexcommentbox[4]
{%
\deffootnote[1.5em]{1.5em}{1em}{\textsuperscript{}}
\footnotetext{
\setlength\fboxsep{10pt}%
         \vspace{#2}
         \makebox[.5\textwidth][l]{
          \hspace{#1}
          \parbox{#3}{
          \vspace{-1\textheight}
\colorbox{black}{%
                {\small
                \parbox{#3}{
                \smallskip
                #4 %
                \smallskip
                }
     }
    }
   }
  }
 }
}


\flexcommentbox{.6\textwidth}{.1\textheight}{.9\textwidth}
 {\color{white}hhaaaaaallllloooooooooooooooooo}

