% \iffalse meta-comment % mycv : a curriculum vitae class allowing TikZ decorations % (v1.5.6 - Sun May 20 21:31:37 CEST 2012) % % 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'. % % This work consists of the main source file 'mycv.dtx' % and the derived files: % % mycv.ins, % mycv.cls, % mycv_base.def, mycv_misc.def, mycv_version.def % mycv_style.sty, mycv_dec.sty, % mycv_split_contents.pl % mycv.pdf % % Moreover, it also consists of the files 'README', % 'CHANGELOG', 'checksum.pl' and folders % and . % % Unpacking the class files: % % (pdf)latex mycv.dtx % % Generating the documentation: % % the documentation has to be produced separately as it % uses the package 'arsclassica', that seems to be not % fully compatible with the 'doc' package (that should % be used in the driver file for producing the document). % To produce the documentation, move to the folder 'Doc' % and type: % % pdflatex mycv.tex % % Generating the examples: % % see the file 'Exampes/Notes.txt'. % % ---------------------------------------------------------- % ** This file was automatically generated by % ** 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'. This work has the LPPL maintenance status "maintained". The Current Maintainer of this work is Andrea Ghersi. This work consists of the files listed in the README file. -------------------------------------------------------- \endpreamble \keepsilent \askforoverwritefalse \usedir{tex/latex/mycv} \generate{% \file{mycv.ins}{\from{mycv.dtx}{install}}% \file{mycv.cls}{\from{mycv.dtx}{mycv.cls}}% \file{mycv_base.def}{\from{mycv.dtx}{mycv-base.def}}% \file{mycv_misc.def}{\from{mycv.dtx}{mycv-misc.def}}% \file{mycv_dec.sty}{\from{mycv.dtx}{mycv-dec.sty}}% \file{mycv_style.sty}{\from{mycv.dtx}{mycv-style.sty}}% \file{mycv_version.def}{\from{mycv.dtx}{mycv-version.def}}% } \generate{% \file{mycv_split_contents.pl}% {\nopreamble\nopostamble\from{mycv.dtx}{mycv-split-contents.pl}}% } \obeyspaces \Msg{**************************************************************} \Msg{* *} \Msg{* To finish the installation you have to move the following *} \Msg{* files into a directory searched by (La)TeX: *} \Msg{* *} \Msg{* mycv.cls, mycv*.def, mycv*.sty *} \Msg{* *} \Msg{* and copy the script 'mycv-split-contents.pl' into a folder *} \Msg{* that is in your PATH environment variable. *} \Msg{* On Unix-like operating systems, make the script executable *} \Msg{* (i.e. chmod +x mycv-split-contents.pl). *} \Msg{* *} \Msg{* To produce the documentation, move to the folder and *} \Msg{* run the file 'mycv.tex' twice through LaTeX. *} \Msg{* *} \Msg{* See the file 'Exampes/Notes.txt' for information on how to *} \Msg{* produce pdf files with examples. *} \Msg{* *} \Msg{* If you want to verify the integrity of the main files, you *} \Msg{* can run the script 'checksum.pl' (on Unix-like operating *} \Msg{* systems, make it executable -- i.e. chmod +x checksum.pl). *} \Msg{* *} \Msg{* Happy (La)TeXing! *} \Msg{* *} \Msg{**************************************************************} \endbatchfile % % \StopEventually{} % % % \iffalse %<*mycv-base.def> % \fi \ProvidesFileSVN {$Id: mycv_base.def 87 2012-05-17 00:40:11Z ghangenit $} [v\@versionstr][Base system core] %% for lists and other useful tools \RequirePackage{etextools} %%%%%%%%%%%%%%%%%%% %% % %% Default values % %% % %%%%%%%%%%%%%%%%%%% \def\@mainbodypagesize{1.00} \def\@subbodypagesize{0.45} \def\@mainheaderpagesize{1.00} \def\@subheaderpagesize{0.44} \def\@mainfooterpagesize{1.00} \def\@subfooterpagesize{0.44} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% % %% Layout components (parser) % %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\@cmdsListSep{:} \def\@argsListSep{=} \expandaftercmds{\DeclareCmdListParser\MyParserCmds}{\@cmdsListSep} \expandaftercmds{\DeclareCmdListParser\MyParserArgs}{\@argsListSep} %% ----------------------------------- %% setup file components: header pages %% ----------------------------------- \def\@MainHeaderPageBegin{MainHeaderPageBegin} \def\@SubHeaderPageBegin{SubHeaderPageBegin} \def\@MainHeaderPageEnd{MainHeaderPageEnd} \def\@SubHeaderPageEnd{SubHeaderPageEnd} %% --------------------------------- %% setup file components: body pages %% --------------------------------- \def\@MainBodyPageBegin{MainBodyPageBegin} \def\@MainBodyPageEnd{MainBodyPageEnd} \def\@SubBodyPageBegin{SubBodyPageBegin} \def\@SubBodyPageEnd{SubBodyPageEnd} \def\@MainFooterPageBegin{MainFooterPageBegin} \def\@SubFooterPageBegin{SubFooterPageBegin} \def\@MainFooterPageEnd{MainFooterPageEnd} \def\@SubFooterPageEnd{SubFooterPageEnd} %% ------------------- %% regular expressions %% ------------------- \def\@regexPreCmd{} \def\@regexPostCmd{} \def\@regexArgsList{\@argsListSep([-!*@.0-9A-Za-z \@argsListSep]+)} \def\@regexMarginLB{/ml([0-9.-]+.{2})} \def\@regexMarginRB{/mr([0-9.-]+.{2})} \def\@regexPageSizeAbs{/pagesize([0-9.]+.{2})/} \def\@regexPagebreak{/pagebreak/} \def\@regexPageSize{<([0-9.]+)>} \def\@regexMarginLE{/endml/} \def\@regexMarginRE{/endmr/} \def\@regexFileName{^([_\-a-zA-Z0-9]+)@} \def\@regexCmdName{([a-zA-Z]+)} \def\@regexFileVar{^.{1}([A-Za-z]+)} \def\@regexParamTypeA{^[@]} \def\@regexParamTypeB{^[!]} \def\@regexParamTypeC{^[*]} %% ================== %% Auxiliary commands %% ================== \newcommand{\@concatCommandArg}[1]{% \ifnum\pdfmatch{\@regexParamTypeA}{#1}=1 \StrGobbleLeft{#1}{1}[\arg] \expandafter\g@addto@macro\expandafter\args% \expandafter{\expandafter[\arg]} \else \ifnum\pdfmatch{\@regexParamTypeB}{#1}=1 \StrGobbleLeft{#1}{1}[\arg] \expandafter\g@addto@macro\expandafter\args% \expandafter{\expandafter<\arg>} \else \ifnum\pdfmatch{\@regexParamTypeC}{#1}=1 \g@addto@macro\args{*} \else \g@addto@macro\args{{#1}} \fi \fi \fi% } \newcommand{\@execCommand}[1]{% \let\args\@empty \ifnum\pdfmatch{\@regexArgsList}{#1}=1 \@getRegexResult{\argslist} \ifnum\pdfmatch{\@regexCmdName}{#1}=1 \@getRegexResult{\cmd} \fi \MyParserArgs[\@concatCommandArg]\argslist \expandaftercmds{\csuse\cmd}{\args} \else \csuse{#1} \fi% } \newcommand{\@getRegexResult}[1]{% \StrPosition{\pdflastmatch 1}{>}[\n] \StrGobbleLeft{\pdflastmatch 1}{\n}[#1]% } \newcommand{\@executeCommandList}[2]{% \ifnum\pdfmatch{#2}{#1}=1% \StrPosition{\pdflastmatch 1}{>}[\n] \StrGobbleLeft{\pdflastmatch 1}{\n}[\cmdlist] \MyParserCmds[\@execCommand]\cmdlist \fi% } \newcommand{\@parsePageBegin}[2]{% \let\pagewidth#2 \ifnum\pdfmatch{\@regexPageSize}{#1}=1 \@getRegexResult{\pagewidth} \fi \@executeCommandList{#1}{\@regexPreCmd} \ifnum\pdfmatch{\@regexPageSizeAbs}{#1}=1 \@getRegexResult{\pagewidth} \noindent\begin{minipage}[t]{\pagewidth} \else \noindent\begin{minipage}[t]{\pagewidth\textwidth} \fi \@executeCommandList{#1}{\@regexPostCmd} \ifnum\pdfmatch{\@regexMarginLB}{#1}=1 \@getRegexResult{\marginsize} \begin{mychangemarginLeft}{\marginsize} \fi \ifnum\pdfmatch{\@regexMarginRB}{#1}=1 \@getRegexResult{\marginsize} \begin{mychangemarginRight}{\marginsize} \fi% } \newcommand{\@parsePageEnd}[1]{% \ifnum\pdfmatch{\@regexMarginRE}{#1}=1 \end{mychangemarginRight} \fi \ifnum\pdfmatch{\@regexMarginLE}{#1}=1 \end{mychangemarginLeft} \fi \@executeCommandList{#1}{\@regexPreCmd} \ifnum\pdfmatch{\@regexPagebreak}{#1}=1 \end{minipage} \else \end{minipage} \fi \@executeCommandList{#1}{\@regexPostCmd} } \newcommand{\@parseFileName}[1]{% \let\marginsizeleft\relax \let\marginsizeright\relax \@executeCommandList{#1}{\@regexPreCmd} \ifnum\pdfmatch{\@regexMarginLB}{#1}=1 \@getRegexResult{\marginsizeleft} \begin{mychangemarginLeft}{\marginsizeleft} \fi \ifnum\pdfmatch{\@regexMarginRB}{#1}=1 \@getRegexResult{\marginsizeright} \begin{mychangemarginRight}{\marginsizeright} \fi \IfBeginWith{#1}{*}{% \ifnum\pdfmatch{\@regexFileVar}{\noexpand#1}=1 \@getRegexResult{\filename} \fi \input\cvcontentsdir/\csuse{\filename} }% {% \ifnum\pdfmatch{\@regexFileName}{#1}=1 \@getRegexResult{\filename} \fi \input\cvcontentsdir/\filename } \@executeCommandList{#1}{\@regexPostCmd} \ifx\marginsizeright\relax \relax \else \end{mychangemarginRight} \fi \ifx\marginsizeleft\relax \relax \else \end{mychangemarginLeft} \fi } %% ============= %% Main commands %% ============= \newcommand{\@bodylayoutlistentry}[1]{% \ifstrmatch{\@SubBodyPageBegin}{#1}{% \@parsePageBegin{#1}{\@subbodypagesize}% }% {% \ifstrmatch{\@SubBodyPageEnd}{#1}{% \@parsePageEnd{#1}% }% {%else \ifstrmatch{\@MainBodyPageBegin}{#1}{% \@parsePageBegin{#1}{\@mainbodypagesize}% }% {%else \ifstrmatch{\@MainBodyPageEnd}{#1}{% \@parsePageEnd{#1}% }% {%else \@parseFileName{#1}% }% }% }% }% } \newcommand{\@headerlayoutlistentry}[1]{% \ifstrmatch{\@MainHeaderPageBegin}{#1}{% \@parsePageBegin{#1}{\@mainheaderpagesize}% }% {%else \ifstrmatch{\@SubHeaderPageBegin}{#1}{% \@parsePageBegin{#1}{\@subheaderpagesize}% }% {%else \ifstrmatch{\@MainHeaderPageEnd}{#1}% {\@parsePageEnd{#1}}% {%else \ifstrmatch{\@SubHeaderPageEnd}{#1}{% \@parsePageEnd{#1}% }% {%else \@parseFileName{#1}% }% }% }% }% } \newcommand{\@footerlayoutlistentry}[1]{% \ifstrmatch{\@MainFooterPageBegin}{#1}{% \@parsePageBegin{#1}{\@mainfooterpagesize}% }% {%else \ifstrmatch{\@SubFooterPageBegin}{#1}{% \@parsePageBegin{#1}{\@subfooterpagesize}% }% {%else \ifstrmatch{\@MainFooterPageEnd}{#1}% { \@parsePageEnd{#1}% }% {%else \ifstrmatch{\@SubFooterPageEnd}{#1}{% \@parsePageEnd{#1}% }% {%else \@parseFileName{#1}% }% }% }% }% } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% % %% Layout components (render) % %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\@raisewarning}[1]{% \ClassWarning{mycv}{% WARNING! The list <#1> used by 'mycv' class is undefined. % Please, define it before using '\myrenderlayout' command. % }% } \DeclareRobustCommand{\myrenderlayout}[1][a]{% \begingroup \ifsinglechar{b}{#1}{% \@ifundefined{bodylayoutlist}% {\@raisewarning{bodylayoutlist}}% else {\csvloop[\@bodylayoutlistentry]{\bodylayoutlist}}% }% {%else \ifsinglechar{h}{#1}{% %% -------- %% HEADINGS %% -------- \@ifundefined{headerlayoutlist}% {\@raisewarning{headerlayoutlist}}% else {\csvloop[\@headerlayoutlistentry]\headerlayoutlist}% }% {%else %% ------------------------------------------------ %% FOOTINGS: sign and treatment of personal details %% ------------------------------------------------ \ifsinglechar{f}{#1}{% \@ifundefined{footerlayoutlist}% {\@raisewarning{footerlayoutlist}}% else {\csvloop[\@footerlayoutlistentry]\footerlayoutlist}% }% {%\else %% -------------- %% ALL COMPONENTS %% -------------- \@ifundefined{headerlayoutlist}% {\@raisewarning{headerlayoutlist}}% else {\csvloop[\@headerlayoutlistentry]\headerlayoutlist}% \@ifundefined{bodylayoutlist}% {\@raisewarning{bodylayoutlist}}% else {\csvloop[\@bodylayoutlistentry]\bodylayoutlist} \@ifundefined{footerlayoutlist}% {\@raisewarning{footerlayoutlist}}% else {\csvloop[\@footerlayoutlistentry]\footerlayoutlist}% }% }% }% \endgroup } % \iffalse % % \fi % % % \iffalse %<*mycv-misc.def> % \fi %% ------------------------------------------------------- %% 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'. %% ------------------------------------------------------- \ProvidesFileSVN {$Id: mycv_misc.def 66 2012-04-28 14:38:41Z ghangenit $} [v\@versionstr][Miscellaneous commands] \RequirePackage{hyperref} %% ----------------------------------------------------- %% partial hyperref setup: the rest is set in style file %% ----------------------------------------------------- \hypersetup{% pdfstartpage = 1, pdfauthor = \@pdfauthor, pdftitle = \@pdftitle, pdfsubject = \@pdfsubject, pdfproducer = \LaTeX{}, pdfkeywords = cv curriculum vit\ae{}, pdfcreator = \LaTeX{} with 'mycv' (v\@versionstr) } %%%%%%%%%%%% %% % %% Margins % %% % %%%%%%%%%%%% \newenvironment{mychangemargin}[2] {\begin{list}{}{% \setlength{\topsep}{0pt}% \setlength{\leftmargin}{#1}% \setlength{\rightmargin}{#2}% \setlength{\partopsep}{0pt}% \setlength{\parsep}{\parskip}}\item[]% }% {\end{list}} \newenvironment{mychangemarginLeft}[1] {\begin{list}{}{% \setlength{\topsep}{0pt}% \setlength{\leftmargin}{#1}% \setlength{\partopsep}{0pt}% \setlength{\parsep}{\parskip}}\item[]% }% {\end{list}} \newenvironment{mychangemarginRight}[1] {\begin{list}{}{% \setlength{\topsep}{0pt}% \setlength{\rightmargin}{#1}% \setlength{\partopsep}{0pt}% \setlength{\parsep}{\parskip}}\item[]% }% {\end{list}} %%%%%%%%%%%%%%%% %% % %% Other stuff % %% % %%%%%%%%%%%%%%%% \DeclareRobustCommand{\mylang}[2][english]{% \foreignlanguage{#1}{{z#2}}} %{\color{blue}{#2}}} %% ------------ %% pdf metadata %% ------------ \DeclareRobustCommand{\mypdfsubject}[1]{\def\@pdfsubject{#1}} \DeclareRobustCommand{\mypdfauthor}[1]{\def\@pdfauthor{#1}} \DeclareRobustCommand{\mypdftitle}[1]{\def\@pdftitle{#1}} % \iffalse % % \fi % % % \iffalse %<*mycv-version.def> % \fi \def\@versionstr{1.5.6} % \iffalse % % \fi % % % \iffalse %<*mycv.cls> % \fi \NeedsTeXFormat{LaTeX2e} \RequirePackage{svn-prov} \input{mycv_version.def} \ProvidesClassSVN {$Id: mycv.cls 87 2012-05-17 00:40:11Z ghangenit $} [v\@versionstr][My Curriculum Vitae class] %% ======== %% Packages %% ======== \RequirePackage{kvoptions} % for class options with key-value format \RequirePackage{xstring} % for string utilities \RequirePackage{ifthen} % for the <\ifthenelse> command %% ============= %% Class Options %% ============= \DeclareBoolOption{withDec} \DeclareDefaultOption{% \PassOptionsToClass{\CurrentOption}{article}} \DeclareStringOption[english]{language} \DeclareStringOption[Contents]{cntdir} \DeclareStringOption[mycv_style]{style} \DeclareStringOption[]{mdlname} \ProcessKeyvalOptions* %% ----------------------------------------------------------- %% The value of an option declared with <\DeclareStringOption> %% is stored in the macro \@