% \iffalse meta-comment
% mycv-examples : some examples about the usage of the class
% 'mycv' (a curriculum vitae class allowing TikZ decorations).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version
% 1.3c, available at 'http://www.latex-project.org/lppl'.
%
% The examples consist of the main source file 'mycv-examples.dtx'
% and the derived files:
%
%     mycv-examples.ins,
%     contents_part[A|B|C].tex,
%     header_[contacts|title].tex,
%     model-[common|layouts].tex,
%     mycv-example-[common|main].tex,
%     footer_sign.tex,
%     mycv-example[dpl|dl2].pdf,
%     mycv-example[spl|sl2].pdf
%
% Unpacking the examples:
%
%     (pdf)latex mycv-examples.dtx
%
% Producing the examples:
%
% see the file 'Examples/Notes.txt'.
%
% ----------------------------------------------------------
% ** This file was automatically generated by <DoPackage.sh>
% ** with option(s) 'ctan'.
% ** Date: Sun May 20 21:31:37 CEST 2012::1337542297
% ----------------------------------------------------------
% \fi
%<*install>
\input docstrip.tex

\preamble
-----------------------------------------------------------
 Author: Andrea Ghersi
 Copyright 2012 Ghersi Andrea (ghanhawk@gmail.com).

 This work may be distributed and/or modified under the
 conditions of the LaTeX Project Public License version
 1.3c, available at 'http://www.latex-project.org/lppl'.
-----------------------------------------------------------
\endpreamble

\keepsilent
\askforoverwritefalse
\usedir{tex/latex/mycv/examples}

\generate{%
   \file{mycv-examples.ins}{\nopreamble\nopostamble\from{mycv-examples.dtx}{install}}%
   \file{mycv-example-common.tex}{\nopreamble\nopostamble\from{mycv-examples.dtx}{mycv-example-common.tex}}%
   \file{mycv-example-main.tex}{\nopreamble\nopostamble\from{mycv-examples.dtx}{mycv-example-main.tex}}%
   \file{contents_partA.tex}{\nopreamble\nopostamble\from{mycv-examples.dtx}{contents-partA.tex}}%
   \file{contents_partB.tex}{\nopreamble\nopostamble\from{mycv-examples.dtx}{contents-partB.tex}}%
   \file{contents_partC.tex}{\nopreamble\nopostamble\from{mycv-examples.dtx}{contents-partC.tex}}%
   \file{footer_sign.tex}{\nopreamble\nopostamble\from{mycv-examples.dtx}{footer-sign.tex}}%
   \file{header_contacts.tex}{\nopreamble\nopostamble\from{mycv-examples.dtx}{header-contacts.tex}}%
   \file{header_title.tex}{\nopreamble\nopostamble\from{mycv-examples.dtx}{header-title.tex}}%
   \file{model-common.tex}{\nopreamble\nopostamble\from{mycv-examples.dtx}{model-common.tex}}%
   \file{model-layouts.tex}{\nopreamble\nopostamble\from{mycv-examples.dtx}{model-layouts.tex}}%
}

\obeyspaces
\Msg{**************************************************************}
\Msg{*                                                            *}
\Msg{* See the file 'Notes.txt' for information on how to produce *}
\Msg{* pdf files with examples.                                   *}
\Msg{*                                                            *}
\Msg{* Happy (La)TeXing!                                          *}
\Msg{*                                                            *}
\Msg{**************************************************************}

\endbatchfile
%</install>
%
%
% \iffalse
%<*mycv-example-common.tex>
% \fi
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{tikz}

\ifoption{withDec}{%
   \newcommand{\cvdec}{
      \mydecorationsSetLineWidth[0.3mm]%
      \mydecorationsPathmorphing*{coil}<radial><lightgray>
   }%
   \ifmodel{verSPL2}{
      \renewcommand{\cvdec}{
         \mydecorationsSetPosXTL[-4cm]
         \mydecorationsSetPosYTL[1.5cm]
         \mydecorationsSetPosYBR[-2cm]
         \mydecorationsSetPosXBR[4cm]
         \mydecorationsPathmorphing*[0]{shape}[black]<ball><black>
      }%
   }
}{\newcommand{\cvdec}{}}

\input{model-layouts}

\ifmodel{verSPL} {\mypdftitle{Simple CV example: SPL}} {\relax}
\ifmodel{verSPL2}{\mypdftitle{Simple CV example: SPL2}}{\relax}
\ifmodel{verDPL} {\mypdftitle{Simple CV example: DPL}} {\relax}
\ifmodel{verDPL2}{\mypdftitle{Simple CV example: DPL2}}{\relax}

\newcommand{\sectionnumber}[1]{\section{Section #1}}
\mypdfauthor{Andrea Ghersi}
% \iffalse
%</mycv-example-common.tex>
% \fi
%
%
% \iffalse
%<*mycv-example-main.tex>
% \fi
\def\cvmodel{verDPL} % default model
\ifdefined\model\def\cvmodel{\model}\fi

\documentclass[10pt,mdlname=\cvmodel,cntdir=.,withDec,language=english]{mycv}
\input{mycv-example-common}

\begin{document}
\cvdec\myrenderlayout\mycfoot{Last update: \today}
\end{document}
% \iffalse
%</mycv-example-main.tex>
% \fi
%
%
% \iffalse
%<*contents-partA.tex>
% \fi

\begin{mychangemargin}{0.1in}{0.1in}
  \lipsum[73]
\end{mychangemargin}
% \iffalse
%</contents-partA.tex>
% \fi
%
%
% \iffalse
%<*contents-partB.tex>
% \fi

\begin{mychangemargin}{0.1in}{0.1in}
  \lipsum[74]
\end{mychangemargin}
% \iffalse
%</contents-partB.tex>
% \fi
%
%
% \iffalse
%<*contents-partC.tex>
% \fi

\begin{mychangemargin}{0.1in}{0.1in}
  A list:
 \begin{myitemize}
    \item this is item 1;
    \item this is item 2;
    \item .....
  \end{myitemize}
\end{mychangemargin}
% \iffalse
%</contents-partC.tex>
% \fi
%
%
% \iffalse
%<*footer-sign.tex>
% \fi

\bigskip\bigskip
\ifmodel{verSPL}{\flushleft}{\relax}
{\Large\calligra{Adam Smith}}
% \iffalse
%</footer-sign.tex>
% \fi
%
%
% \iffalse
%<*header-contacts.tex>
% \fi
\def\cvcontactsep{\\}
\vspace{0pt} %trick for alignment

\tikzstyle{mybox} = [%
   draw=red, fill=blue!20, very thick,
   rectangle, rounded corners,
   inner sep=10pt, inner ysep=20pt]

\tikzstyle{fancytitle} = [
   fill=red, text=white]

\begin{tikzpicture}
   \node (box)[fill=myshadecolor,rounded corners=10pt, minimum size= 2.5cm]{%
   {\color{black}
   \begin{tabular*}{6cm}{l|l}
                                   &Unknown address XYZXYZXYZ\cvcontactsep
      \raisebox{-3pt}{\Mobilefone} &+39\,0123\,456789\cvcontactsep
      \raisebox{-3pt}{\Telefon}    &Telephone\cvcontactsep
      \raisebox{-3pt}{\Email}      &\href{mailto:unknown@gmail.com}
                                    {unknown@gmail.com}\cvcontactsep
   \end{tabular*}
   }};
   \node[fancytitle, text width=0.5423\textwidth, text centered,
      rounded corners] at (box.north){Contacts};
\end{tikzpicture}
\bigskip
% \iffalse
%</header-contacts.tex>
% \fi
%
%
% \iffalse
%<*header-title.tex>
% \fi
\bigskip
{\sffamily\Huge{}Dr. Adam Smith}\\[3pt]%
\ifmodel{verSPL2}
   {{\color{red}\huge\calligra{CurriculumVitae}\\[25pt]}}
   {{\color{myheadingscolor}\huge\calligra{CurriculumVitae}\\[25pt]}}
% \iffalse
%</header-title.tex>
% \fi
%
%
% \iffalse
%<*model-common.tex>
% \fi
\def\headerlayoutlist{%
   MainHeaderPageBegin:<postcmd:vspace=10pt>,
      SubHeaderPageBegin:<precmd:hfill>,
         header_title@,    % header file one
      SubHeaderPageEnd:<postcmd:hfill>,
      SubHeaderPageBegin,
         header_contacts@, % header file two
      SubHeaderPageEnd,
   MainHeaderPageEnd%
}

\def\footerlayoutlist{footer_sign@} % footer file
% \iffalse
%</model-common.tex>
% \fi
%
%
% \iffalse
%<*model-layouts.tex>
% \fi
\input{model-common}

\ifmodel{verSPL}{%
   \def\bodylayoutlist{%
      contents_partA@:<precmd:vspace=10pt:sectionnumber=1>,
      contents_partB@:<precmd:vspace=10pt:sectionnumber=2>,
      contents_partC@:<precmd:vspace=10pt:sectionnumber=3>,
      contents_partA@:<precmd:vspace=10pt:sectionnumber=4>,
      contents_partB@:<precmd:vspace=10pt:sectionnumber=5>
   }%
}{\relax}

\ifmodel{verSPL2}{%
   \mysectionTitleFormat[red][red]
   \color{white}

   \def\bodylayoutlist{%
      contents_partA@:<precmd:vspace=10pt:sectionnumber=1>,%
      contents_partB@:<precmd:vspace=10pt:sectionnumber=2>,%
      contents_partA@:<precmd:vspace=10pt:sectionnumber=3>,%
      contents_partC@:<precmd:vspace=10pt:sectionnumber=4>,%
      contents_partA@:<precmd:vspace=10pt:sectionnumber=5>,%
      contents_partB@:<precmd:vspace=10pt:sectionnumber=6>
   }%
}{\relax}

\ifmodel{verDPL}{%
   \def\bodylayoutlist{%
      MainBodyPageBegin:<0.96>,
         SubBodyPageBegin,
         SubBodyPageEnd,
         SubBodyPageBegin:<0.48>,
            contents_partA@:<precmd:vspace=10pt:sectionnumber=1>,
            contents_partB@:<precmd:vspace=10pt:sectionnumber=2>,
            contents_partC@:<precmd:vspace=10pt:sectionnumber=3>,
         SubBodyPageEnd:<postcmd:hfill>,
         SubBodyPageBegin:<0.48>,
            contents_partA@:<precmd:vspace=10pt:sectionnumber=4>,
            contents_partB@:<precmd:vspace=10pt:sectionnumber=5>,
         SubBodyPageEnd,
      MainBodyPageEnd%
   }%
}{\relax}

\ifmodel{verDPL2}{%
   \usepackage{multicol}
   \setlength{\columnsep}{2.0pc}
   \setlength\columnseprule{.4pt}
   \newcommand{\mcbegin}{\begin{multicols}{2}}
   \newcommand{\mcend}{\end{multicols}}

   \def\bodylayoutlist{%
      contents_partA@:<precmd:vspace=10pt:mcbegin:sectionnumber=1>,%
      contents_partB@:<precmd:vspace=10pt:sectionnumber=2>,%
      contents_partA@:<precmd:vspace=10pt:sectionnumber=3>,%
      contents_partC@:<precmd:vspace=10pt:sectionnumber=4>,%
      contents_partA@:<precmd:vspace=10pt:sectionnumber=5>,%
      contents_partB@:<precmd:vspace=10pt:sectionnumber=6>:<postcmd:mcend>%
   }%
}{\relax}
% \iffalse
%</model-layouts.tex>
% \fi
%
% \Finale
\endinput
