diff options
author | Karl Berry <karl@freefriends.org> | 2012-05-14 23:53:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-05-14 23:53:04 +0000 |
commit | 6e33deaa4bd2d4a6029e026a54e510b847731f23 (patch) | |
tree | 25c0cd887fc3ae56eadc89cc570e6b06cee39833 /Master/texmf-dist/doc/latex | |
parent | 43bb87fb699f597f53baf7a8a32c288036fee558 (diff) |
mycv (14may12)
git-svn-id: svn://tug.org/texlive/trunk@26385 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex')
27 files changed, 833 insertions, 387 deletions
diff --git a/Master/texmf-dist/doc/latex/mycv/CHANGELOG b/Master/texmf-dist/doc/latex/mycv/CHANGELOG index 7bd5602f3d5..104a3221c90 100644 --- a/Master/texmf-dist/doc/latex/mycv/CHANGELOG +++ b/Master/texmf-dist/doc/latex/mycv/CHANGELOG @@ -37,4 +37,26 @@ Sat Apr 28 13:19:33 CEST 2012 -- Version <1.5.4> [c] Modified the default geometry of a document and did other minor changes - to the style file.
\ No newline at end of file + to the style file. + +================================================ +Sun May 13 18:53:30 CEST 2012 -- Version <1.5.5> +================================================ + + [x] Fixed a missing package that prevented + the 'mycv_dec' package from being loaded + independently from the class. + + [+] Added a Perl script to split CV contents + from one single file to multiple files + (see the doc for further details). + + [+] Added a new example of usage and did + code refactoring of the old ones. + + [c] Updated the documentation to reflect + the changes done and also tried to + fix its english (as far as I can do + that). + + [c] Other minor changes.
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Fundamentals.tex b/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Fundamentals.tex index 7384694f9ec..13e080268ea 100644 --- a/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Fundamentals.tex +++ b/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Fundamentals.tex @@ -7,104 +7,81 @@ it produces objects of beauty'' }{Knuth} %********************************************************* - +\ifparchment\begin{parchment}\fi \section{Introduction} The main goal of this class (\classname) is to give support for creating \textit{curriculum vit\ae{}} (\CV) with different layouts, allowing easy switching among them. %That is primarily the goal this class focus on. -The class also provides a basic support for using the \textit{TikZ} decorations and defines a bunch -of commands for handling the contents of a \CV, even though this is not its primary goal. +The class also provides basic support for using the \textit{TikZ} decorations and defines a bunch +of commands for managing the contents of a \CV, though that is not its primary goal. %\classname, in fact, mainly focus on switching from different curriculum layouts, %rather than handling the curriculum contents. On \keyword{CTAN} archives, there are available various \CV packages more -\textit{contents-oriented}, as it were, and they may be used together with this class, -providing missing contents functionality. - -Probably, the choice of the class's name was not so appropriate but, at the beginning, I did not -plan to publish it and chose the simplest and most obvious name. I realized that only when I -wrote these notes, but by then it was a bit too late. -%As far as the class is concerned, it uses a file-based and list-driven approach. Each file -%represents the contents of a user-chosen part of the curriculum (ideally a section, but this is not -%mandatory and may be anything else); besides, the \CV is logically divided into three main -%components: header, body and footer components. For each main component a list is associated: it -%contains sub-components, among which files with the \CV contents. In addiction, each sub-component -%may have associated some generic or specific commands to be executed. - -Before starting to describe \classname more in details, I have to say it was my first class in -\LaTeX{} and, although I tried to do my best, the lack of experience probably brought me to make -some choice not so opportune as I hoped. It goes without saying that any advice or constructive -criticism is greatly appreciated. +\textit{contents-oriented}, as it were, and they may be used together with this class. +%providing missing contents functionality. +Before starting to describe the class more in details, it goes without saying that any advice or +constructive criticism is greatly appreciated. \section{Class files} -The class \classname is composed by five files. A short brief of each one is given here: +The class \classname is composed by six files. A short brief of each one is given here: \squishlist \item \ctext{mycv.cls} \begin{myindent} it is the main file and, basically, handles the class options~\myref{sec:class-options} as - well as the inclusion of all other files (the remaining four); + well as the inclusion of all other files, except for \textit{mycv\_version.def}; \end{myindent} \item \ctext{mycv\_base.def} \begin{myindent} it contains all the commands and definitions dealing with the layout components of a - \CV~\myref{sec:layout-components}: it is the core-system file; + \CV~\myref{sec:layout-components}: it is the core file; \end{myindent} \item \ctext{mycv\_style.sty} \begin{myindent} - it contains the default style commands~\myref{sub:style-commands} provided by this class: if + it contains the default style commands~\myref{sub:style-commands} provided by the class: if the default style is not used, %~\myref{sec:class-options} this file will not be included by \textit{mycv.cls}; \end{myindent} \item \ctext{mycv\_dec.sty} \begin{myindent} - it contains the decoration commands~\myref{sub:decoration-commands}: if decorations are not - enabled% + it contains the decoration commands~\myref{sub:decoration-commands} provided by the class: if + decorations are not enabled% %~\myref{sec:class-options} , this file will not be included by \textit{mycv.cls}; \end{myindent} - \item \ctext{mycv\_misc.def} + \item \ctext{mycv\_misc.def}\hspace{5pt}and\hspace{5pt}\ctext{mycv\_version.def} \begin{myindent} - it contains some miscellaneous commands and definitions. + they respectively contain some miscellaneous commands and the version string. \end{myindent} \squishend \section {Layout components} \label{sec:layout-components} -This class considers a \textit{curriculum vit\ae{}} as logically divided into three main -components: \textit{header}, \textit{body} and \textit{footer}. -For each of these ones, a list, that basically contains some sub-components, is being -associated; files with the \CV contents -%, or ideally a part of them (a section for example, but -%this is not mandatory and may be anything else), -are also considered sub-components\footnote{it may be a good practice, to make the best use of this -class, to subdivide the contents of each cv section in different files, although this is not -mandatory and any other choice may be made}. For these reasons, we can actually say that \classname -uses a -%file-based and -sort of \textit{list-driven} approach.%\\ -%Besides, the \CV contents (ideally a section, but may be anything else) is divided in more files. +This class considers a \textit{curriculum vit\ae{}} as logically divided into three main components: +\textit{header}, \textit{body} and \textit{footer}. +To each of these ones, a list, that basically contains some sub-components, is associated; files +with the \CV contents are also considered sub-components. +For these reasons, we can actually say that \classname uses a sort of \textit{list-driven} approach. \subsection{Main components} \classname recognizes the following three lists that, for all intends and purposes, are a concrete representation of the main logical components: -\def\tmpcolor{black} -\squishlist[0pt] - \item \textbf{\ctext[\tmpcolor]{headerlayoutlist}}; - \item \textbf{\ctext[\tmpcolor]{bodylayoutlist}}; - \item \textbf{\ctext[\tmpcolor]{footerlayoutlist}}. -\squishend\sep +\bigskip +\begin{myindent} +\textbf{headerlayoutlist},\hspace{5pt}\textbf{bodylayoutlist},\hspace{5pt}\textbf{footerlayoutlist}. +\end{myindent} -It is mandatory, for the correct behavior of the class, to not change the above list names. In +\bigskip +It is mandatory, for the correct behavior of the class, to not change the above list's names. In the case a component is not required, the relative list may be omitted: for example, if a \CV does -not have a footer component, the list \textit{footerlayoutlist} is not strictly necessary. -What follows is an example of a list definition: -\codeskip -\begin{lstlisting}[firstnumber=1,numbers=none] +not have a footer component, the list \textit{footerlayoutlist} is not strictly necessary.\\ +What follows is an example of a list definition:\codeskip +\begin{latexcode}[numbers=none] \def\headerlayoutlist{sub-component1,sub-component2,[...]} -\end{lstlisting} +\end{latexcode} \subsection{Sub-components} @@ -126,32 +103,35 @@ difference is that the former have a default width of $100\%$ of the \textit{tex macro, while that value is $44\text{-}45\%$ for the latter (it depends on the components type). % (for these notes does not really matter which is which). -A \textit{filename} sub-component may either directly be the name of a file or a macro (variable): +A \textit{filename} sub-component may either be the name of a file or a macro with it: depending on the case, the syntax slightly changes.%~\myreftwo{subsub:component-options}. \subsubsection{Sub-components options} \label{subsub:component-options} Each sub-component, \textit{filename} included, may have associated options, with colons -as separators, so that the syntax is something like:\sep -\begin{myindent} -\verb|sub-component:option1:option2:[...]|. -\end{myindent}\sep -If truth be told, each option has its own separator, so colons are not strictly necessary -and, as a separator, any other symbol may be used. If wanted, it is also possible to not have any, -but this is not recommended (just for a matter of clarity). +as separators, so that the syntax is something like:\codeskip +\begin{latexcode}[numbers=none] + $sub-component$:option1:option2:[...] +\end{latexcode} + +If truth be told, each option already has its own separator, so colons are not strictly necessary +and, as a separator, any other symbol may be used. If wanted, it is also possible to not have any +separator at all, but this is not recommended if only for a matter of clarity. + +\medskip % in modo che si inizi nella pagina successiva Options for a sub-component are of different types, as listed below: \def\tmpcolor{gray} \squishlist \item <\optname{[pre\textbar post]cmd}\verb|:command1:command2:[...]|>\optdsep a sequence of commands is executed \textit{before}/\textit{after} the - begin or end of a sub-component (\textit{filename} included). - A command may have a sequence of arguments, separated by ``=''; - each of them can either be \textit{optional} or \textit{mandatory}. %\\ - In total, \classname recognizes four types of arguments: + beginning or ending of a sub-component (\textit{filename} included). + A command may have a sequence of arguments, separated by ``='', + each of which can either be \textit{optional} or \textit{mandatory}. + In total, the class recognizes four types of arguments: %, as it is possible to have $3$ different kinds of optional ones: - \squishlist + \squishlist[0pt] \item \ctext[blue]{arg} (mandatory argument equivalent to \{arg\}); \item \ctext[blue]{@arg} (optional argument equivalent to [arg]); \item \ctext[blue]{!arg} (optional argument equivalent to <arg>); @@ -162,11 +142,10 @@ Options for a sub-component are of different types, as listed below: changes the \textit{left}/\textit{right} margin of a text portion of a document, between option {\small($1$)} and option {\small($2$)}; in a typical usage, these options are associated with different sub-components, such as \verb|*PageBegin| and \verb|*PageEnd|. - \\ Each time the option {\small($1$)} is used, the option {\small($2$)} is also required for ending the margin modification, except for the \textit{filename} sub-component that automatically does that. Example (it moves the left margin to the - right of $0.2$in):\sep + right of $0.2$in): \begin{myindent} \texttt{% \ctext[\tmpcolor]{% @@ -187,13 +166,15 @@ Options for a sub-component are of different types, as listed below: \ctext[\tmpcolor]{\texttt{SubBodyPageBegin:/pagesize5.5in/}}. \item /\optname{pagebreak}/\optdsep permits to break two contiguous sub-components, aligning them one above the other, instead - side by side (that is the default behavior). This option only exists for ``\verb|*PageEnd|'' - sub-components. Example: \ctext[\tmpcolor]{\texttt{SubBodyPageEnd:/pagebreak/}}. - \item \optname{*}varname\optvsep + of side by side (that is the default behavior). This option only exists for + ``\verb|*PageEnd|'' sub-components. + Example: \ctext[\tmpcolor]{\texttt{SubBodyPageEnd:/pagebreak/}}. + \item \optname{*}macroname\optvsep filename\optname{@}\optdsep - \argname{varname} is a macro that expands to the name of a file (with the \CV contents), + \argname{macroname} is a macro expanding to the name of a file (with the \CV contents), while \argname{filename} is directly the name itself (the only \textit{non-alphanumeric} - characters allowed are ``\_'' and ``-''). + characters allowed there are ``\_'' and ``-''). Example: \ctext[\tmpcolor]{\texttt{*headerfile}}, where the macro \textit{headerfile} is somewhere defined. -\squishend
\ No newline at end of file +\squishend +\ifparchment\end{parchment}\fi
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Usage.tex b/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Usage.tex index b79a542827e..027ae60948b 100644 --- a/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Usage.tex +++ b/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Usage.tex @@ -4,43 +4,41 @@ “There are two ways to write error-free programs; only the third one works”% }{Alan J. Perlis} % ***************************************************************************** - +\ifparchment\begin{parchment}\fi \section{Requirements} - When \textit{decorations} are not enabled and the \textit{default style} is not used, \classname -has, in addiction to \ctLaTeXe{} obviously, the following requirements:\codeskip -{\small{\begin{lstlisting}[firstnumber=1,numbers=none] -\RequirePackage{kvoptions} % for options +has %, in addiction to \ctLaTeXe{} obviously, +the following requirements:\codeskip +\begin{latexcode}[numbers=none] +\RequirePackage{kvoptions} % for class options with key-value format \RequirePackage{etextools} % for lists and other useful tools -\RequirePackage{ifthen} % for \ifthenelse command +\RequirePackage{ifthen} % for the \ifthenelse command \RequirePackage{xstring} % for string utilities \RequirePackage{svn-prov} % for file info extracted from SVN \RequirePackage{hyperref} % for hypertext links and other stuff -\end{lstlisting}}}\codeskip +\end{latexcode} -Besides, if the default style is used, by means of the class option +If the default style is used, by means of the class option ``\textit{style}''~\myref{sec:class-options}, this class requires (in addiction to \textit{hyperref} and \textit{svn-prov}):\codeskip -{\small{ -\begin{lstlisting}[firstnumber=1,numbers=none] +\begin{latexcode}[numbers=none] \RequirePackage{xparse} % for commands with multiple default arguments -\RequirePackage{pifont} % for ding style (itemize environment) +\RequirePackage{pifont} % for the 'ding' style (itemize environment) \RequirePackage{titlesec} % for title format and spacing -\RequirePackage{fancyhdr} % for custom footer -\RequirePackage{xcolor} % for color -\RequirePackage{calligra} % for calligra font -\RequirePackage{times} % times font +\RequirePackage{fancyhdr} % for custom headers and footers +\RequirePackage{xcolor} % for colors +\RequirePackage{calligra} % for the calligra font +\RequirePackage{times} % for the times font \RequirePackage{marvosym} % symbols - phone \RequirePackage{amssymb} % symbols - email -\end{lstlisting}}}\codeskip +\end{latexcode} Finally, if decorations are enabled, by using the class option ``\textit{withDec}``~\myref{sec:class-options}, this class also requires (in addiction -to \textit{svn-prov} and \textit{xparse}):\codeskip -{\small{ -\begin{lstlisting}[firstnumber=1,numbers=none] +to \textit{svn-prov}, \textit{xparse} and \textit{xstring}):\codeskip +\begin{latexcode}[firstnumber=1,numbers=none] \RequirePackage{tikz} % for graphics -\end{lstlisting}}}\codeskip +\end{latexcode} \section{Class options} \label{sec:class-options} @@ -62,7 +60,7 @@ addiction, it provides the following options: \begin{myindent} specifies the file name (with or without the extension ``.sty'') containing the style commands. By default, the file \textit{mycv\_style.sty}, provided by the class itself, is that used. - It is also possible to not use any file by specifying the value ``none'' as file name; + It is also possible to not use any style file by specifying the value ``none'' as file name; \end{myindent} \item {\color{red}mdlname=<\argname[\tmpcolor]{name}>} \begin{myindent} @@ -80,12 +78,12 @@ addiction, it provides the following options: Here follows the complete list of the commands provided by \classname. The style commands %~\myref{sub:style-commands} -are only available if the class option ``\textit{style}'' was used~\myref{sec:class-options}. The -same goes for the decoration commands, +are only available if the class option ``\textit{style}'' was used; %~\myref{sec:class-options}. +the same goes for the decoration commands, %~\myref{sub:decoration-commands} -which need the class option ``\textit{withDec}'' to be used. In the following text of this section, -when present, the form {\color{blue}\omissis} (or {\color{blue}<...>}) indicates the default choice -for an optional argument of a command. +which need the class option ``\textit{withDec}''.\\ +In the following text of this section, when present, the form {\color{blue}\omissis} (or +{\color{blue}<...>}) indicates the default choice for an optional argument of a command. \subsection{Conditionals} @@ -111,7 +109,8 @@ for an optional argument of a command. \dargone{titlerule-color-below}{myheadingscolor} \end{myindent}\cmddsep \argname{titlerule-color-above} is the color for the rule above a section name, while - \argname{titlerule-color-below} is for that below. \textit{myheadingscolor} is the default color. + \argname{titlerule-color-below} is for the one below. \textit{myheadingscolor} is the default + color. \item \cmdname{mysectionTitleSpacing} \begin{myindent} \dargone{left}{$0\text{pt}$}\arghsep @@ -125,7 +124,7 @@ for an optional argument of a command. \item \cmdname{mycfoot} \marg{text}\cmddsep adds \argname{text} to the page footer. It may be useful, for example, to show information - about the last document update.% (\textbackslash{}mycfoot\{Last update \textbackslash{}today\}). + about the last update of the document. \item \cmdname{myitemize} \cmddsep a list environment that uses the \textit{ding} style. @@ -134,11 +133,10 @@ for an optional argument of a command. \subsection{Decorations} \label{sub:decoration-commands} -\classname provides some commands for using the \textit{TikZ} decorations. The support +\classname provides some commands for \textit{TikZ} decorations. The support provided is not complete at all (on the other hand \textit{TikZ} has a huge amount of -functionality), but is enough for this class purposes. The only \textit{TikZ} path supported is +functionality), but it is enough for this class purposes. The only \textit{TikZ} path supported is \textit{rectangle}. -%\\ Here follows the provided commands list: \squishlist \item \cmdname{mydecorationsPathmorphing}[*] @@ -149,12 +147,12 @@ functionality), but is enough for this class purposes. The only \textit{TikZ} pa \dargtwo{shading-type}{radial}\argvsep \dargtwo{background-color}{white}% \end{myindent}\cmddsep - \argname{show-decoration}, if equals $1$, does show the decoration \argname{decoration-type}, + \argname{show-decoration}, if equals $1$, shows the decoration \argname{decoration-type}, while if $0$ does not. - \textit{Starred} version uses the shading technique, unlike the \textit{not starred} one, and the - last argument is the background shading color.\\ - For \textit{not starred} version, the argument \argname{shading-type} is not considered - (just for a matter of clarity, a ``none'' value may be used), and the last argument is simply the + The \textit{starred} version of the command uses the shading technique and the last argument is + the background shading color.\\ + The \textit{not starred} version does not consider the argument \argname{shading-type} + (just for a matter of clarity, a ``none'' value may be used) and the last argument is simply the background color.\\ \argname{decoration-type} was tested with the following values: ``shape'', ``straight'', ``zigzag``, ``random steps``, ``saw``, ``bent``, ``bumps``, ``coil``, ``snake'' and @@ -166,9 +164,9 @@ functionality), but is enough for this class purposes. The only \textit{TikZ} pa \marg{decoration-type}\arghsep \dargone{decoration-color}{gray} \end{myindent}\cmddsep - \argname{show-decoration}, if equals $1$, does show the decoration \argname{decoration-type}, - while if $0$ does not. - \argname{decoration-type} was tested with the following ones: ``dart'', ``diamond'', + \argname{show-decoration}, if equals $1$, shows the decoration \argname{decoration-type}, + while if $0$ does not.\\ + \argname{decoration-type} was tested with the following decorations: ``dart'', ``diamond'', ``rectangle'' and ``star''. \item \cmdname{mydecorationsFading} \begin{myindent} @@ -234,11 +232,11 @@ functionality), but is enough for this class purposes. The only \textit{TikZ} pa ``b'' and ``f'', respectively, for the body and footer ones, while ``a'' is for all components. \squishend -\section{An example} +\section{Some examples} -This section gives a \textit{minimal} example and some considerations about the use of \classname -(the class permits to do much better with a little patience). This is done by creating two -\textit{curriculum vit\ae{}} with the same contents, but different layouts: one \CV will use a +This section gives some \textit{minimal} examples and does some considerations about the use of +\classname (the class permits to do much better with a little patience). This is done by creating +two \textit{curriculum vit\ae{}} with the same contents, but different layouts: one \CV will use a double page layout (abbreviated \DPL from here forward), while the other will use a single page layout (\SPL). @@ -248,33 +246,42 @@ contents: these files are not listed in the present document, as they do not con being mentioned for the purpose of these notes. First and foremost, to keep the code organized, we need a file containing the layout components -for the \DPL (\textit{model-dpl.tex}) and another one for the \SPL (\textit{model-spl.tex}). -We opt for having the header and footer components being shared, so we create a third file named -\textit{model-common.tex}, such as in listing~\ref{lst:model-common}: -\begin{lstlisting}[firstnumber=1,caption=model-common.tex,label=lst:model-common] +for the \DPL and \SPL (\textit{model-layouts.tex}). We opt to share the \textit{header} and +\textit{footer} components, so we also create a second file named \textit{model-common.tex}, +such as in listing~\ref{lst:model-common}. +\begin{latexcode}[firstnumber=1,caption=model-common.tex,label=lst:model-common] +% ---------------------- +% the shared header list +% ---------------------- \def\headerlayoutlist{% &MainHeaderPageBegin&:<postcmd:vspace=10pt>, % --------------------------------- left header |SubHeaderPageBegin|:<precmd:hfill>, - $header_title@$, % header file one + % header file (1) + $header_title@$, |SubHeaderPageEnd|:<postcmd:hfill>, % --------------------------------- right header |SubHeaderPageBegin|, - $header_contacts@$, % header file two + % header file (2) + $header_contacts@$, |SubHeaderPageEnd|, &MainHeaderPageEnd&% } -\def\footerlayoutlist{footer_sign@} % footer file -\end{lstlisting} -\codeskip -Now we can deal with the layout components specific for the \DPL (\textit{model-dpl.tex}), -as in listing~\ref{lst:dplmodel}. +% ---------------------- +% the shared footer list +% ---------------------- +\def\footerlayoutlist{footer_sign@} +\end{latexcode} + +\subsection{Double page layout} + +Here we deal with the layout components specific for the \DPL, as showed in +listing~\ref{lst:dplmodel}. %\lstinputlisting[firstnumber=1,caption=model-dpl.tex,label=lst:dplmodel]{ %../Examples/Models/model-dpl.tex} -\begin{lstlisting}[firstnumber=1,caption=model-dpl.tex,label=lst:dplmodel] -\input{Models/model-common} -\def\bodylayoutlist{% +\begin{latexcode}[firstnumber=1,caption=DPL model (part of 'model-layouts.tex'),label=lst:dplmodel] +\def\bodylayoutlist{% the DPL's body list % --------------------------------------------------------- % moves the right margin to the left (text and title rules) % --------------------------------------------------------- @@ -303,27 +310,16 @@ as in listing~\ref{lst:dplmodel}. % ----------------------------------------- &MainBodyPageEnd&% } -\end{lstlisting} -\codeskip - -%The directive colored in red moves the right margin to the left (text and title rules) while the -%directives in orange are just used as a trick to do the same thing for the left margin (that is -%moved to the right):\codeskip -%\begin{lstlisting}[firstnumber=1,numbers=none] -%&MainBodyPageBegin&:<0.96> -%|SubBodyPageBegin|, -%|SubBodyPageEnd|, -%\end{lstlisting} - -As far as the \DPL, we have done; we still have to deal with the layout components specific for -the \SPL (\textit{model-spl.tex}). In this case, we do not need to use the \verb|*PageBegin| -components, but it is sufficient to directly include the files with the contents. The resulting code -is showed in listing~\ref{lst:splmodel}. -%\lstinputlisting[firstnumber=1,caption=model-spl.tex,label=lst:splmodel]{ -%../Examples/Models/model-spl.tex }\codeskip -\begin{lstlisting}[firstnumber=1,caption=model-spl.tex,label=lst:splmodel] -\input{Models/model-common} -\def\bodylayoutlist{% +\end{latexcode} + +\subsection{Single page layout} + +As far as the \SPL, we do not need to use the \verb|*PageBegin| components, but it is sufficient to +directly include the files with the contents. The resulting code is showed +in listing~\ref{lst:splmodel}. +\begin{latexcode}[firstnumber=1,caption=SPL model (part of +'model-layouts.tex'),label=lst:splmodel] +\def\bodylayoutlist{% the SPL's body list % --------------------------------------------------- $contents_partA@$:<precmd:vspace=10pt:sectionnumber=1>, $contents_partB@$:<precmd:vspace=10pt:sectionnumber=2>, @@ -332,95 +328,88 @@ is showed in listing~\ref{lst:splmodel}. $contents_partB@$:<precmd:vspace=10pt:sectionnumber=5> % --------------------------------------------------- } -\end{lstlisting} -\codeskip +\end{latexcode} + +\subsection{Main file} -At this point, we both have the components for the double and single page layouts and we can -proceed writing the main files (\textit{mycv-example-dpl.tex} and \textit{mycv-example-spl.tex}) -that pick and use them.\\ +Since we both have the components for the double and single page layouts, we can proceed writing the +main file (\textit{mycv-example-main.tex}) that picks and use them.\\ We start by setting up some options for the %\classname -class; we have chosen to store the \CV contents files in the directory ``Contents'' (that is the -default one where the class searches for the contents files), so there is not need to specify the -path with the option ``\textit{cntdir}''~\myref{sec:class-options}. -\\ -The options we want to pass to the class are those related to the decorations and language support; -in addiction, we pass the name of the layout (model) we mean to use. +class, such as those related to the decorations and language support, as well as the name of the +model (layout) we mean to register. +Besides, we opt to store the \CV contents files in the directory ``Contents'' (that is the default +one where the class searches for the contents files), so there is not need to specify its path with +the option ``\textit{cntdir}''. %~\myref{sec:class-options}. % (see the listings~~\ref{lst:dplmodel} or~\ref{lst:splmodel}). -\\ -Here we take the \DPL as an example (listing~\ref{lst:mycv-example-dpl}), but switching to the + +In listing~\ref{lst:mycv-example-main} we take the \DPL as an example, but switching to the \SPL would just be a matter of changing the ``\textit{mdlname}'' option from \keyword{verDPL} to \keyword{verSPL}. -\begin{lstlisting}[firstnumber=1,label=lst:mycv-example-dpl,caption=mycv-example-dpl.tex] +\begin{latexcode}[firstnumber=1,label=lst:mycv-example-main,caption=mycv-example-main.tex] \documentclass[10pt,mdlname=verDPL,withDec,language=english]{mycv} \input{mycv-example-common} - \begin{document} \cvdec\myrenderlayout\mycfoot{Last update: \today} \end{document} -\end{lstlisting}\codeskip - -The input file \textit{mycv-example-common[.tex]}, showed in listing~\ref{lst:example-common}, -selects the appropriate layout components (\ref{lst:dplmodel} or \ref{lst:splmodel}) to be included -(\textit{\textbackslash{}ifmodel} conditional command), which will be subsequently processed by -the command \textit{\textbackslash{}myrenderlayout}.\\ -%showed in listing~\ref{lst:example-common}. Since this portion of code is shared between -%\textit{mycv-example-dpl.tex} and \textit{mycv-example-spl.tex}, we need to use -%\textit{\textbackslash{}ifmodel} for selecting the right file to be included. -In addiction, that file contains some decoration commands, which need to be picked up only when the -class option ``\textit{withDec}' is being used; this is the reason why the conditional command -\textit{\textbackslash{}ifoption} is also used. -\begin{lstlisting}[firstnumber=1,caption=mcv-example-common.tex,label=lst:example-common] +\end{latexcode} + +The file \textit{mycv-example-common[.tex]}, showed in listing~\ref{lst:example-common}, +selects the appropriate layout components (listings~\ref{lst:dplmodel} or \ref{lst:splmodel}) to be +included and, subsequently, processed by \textit{\textbackslash{}myrenderlayout}. +%(to be more exact, those components are selected inside the file \textit{model-layouts[.tex]}).\\ +%by using +%the conditional command \textit{\textbackslash{}ifmodel}.\\ +In addiction, the file \textit{mycv-example-common.tex} contains some decoration commands, which +need to be used only if the option ``\textit{withDec}' was given to the class; this is the +reason of the conditional command \textit{\textbackslash{}ifoption}. +\begin{latexcode}[firstnumber=1,caption=mcv-example-common.tex,label=lst:example-common] [...] \ifoption{withDec}{% \newcommand{\cvdec}{ \mydecorationsSetLineWidth[0.3mm]% \mydecorationsPathmorphing*{coil}<radial><lightgray> - }% + } + [...] }{\newcommand{\cvdec}{}} -\ifmodel{verSPL}{\input{Models/model-spl}[...]}{\relax} -\ifmodel{verDPL}{\input{Models/model-dpl}[...]}{\relax} +% include layouts components +\input{Models/model-layouts} [...] -\end{lstlisting} +\end{latexcode} %\lstinputlisting[firstnumber=1,caption=mcv-example-common.tex,label=lst:example]{ %../Examples/mycv-example-common.tex} -\section{Split the contents} +\subsection{Layout notes} When a double layout page is used, it may occur, for example, that a section is too long for a -page: this would not be a problem with a single layout page, since \LaTeX{} would automatically +page: this would not be a problem with a single page layout, since \LaTeX{} would automatically break the section contents. Unfortunately, with a double page layout the behavior is substantially -different: this is because \classname uses a \textit{minipage-based mechanism} and a minipage is by +different: this is because the class uses a \textit{minipage-based mechanism} and a minipage is by itself not breakable. Thus, what happens is that part of the section contents comes out from the -margins, without being displayed. +page margins. %, without being displayed. When a problem such as this occurs, a possible workaround is to manually break the section contents. This can be done by using a counter that keeps track of the number of times a same file is included: when the counter is equal $1$, a part of the section contents is included in the left page, otherwise is the remaining one to be included in the right page. Listing~\ref{lst:split-contents-example} shows a practical example of what just discussed. -\begin{lstlisting}[firstnumber=1,label=lst:split-contents-example,caption=split-contents-example] +\begin{latexcode}[firstnumber=1,label=lst:split-contents-example, +caption=workaround example] % --------------------------------------------------------- % file with the section contents: i.e. <section_skills.tex> % --------------------------------------------------------- - -% increases the counter 'acounter' -% (it's defined outside this file) -\stepcounter{acounter} - -\newcommand{\conditionalblock}[2]{% - \ifthenelse{\value{acounter}<2}{#1}{#2}% -} +% increases the counter 'cnt': it's defined outside this file +\stepcounter{cnt} % selects the appropriate part of the file contents -\conditionalblock% - {skills section contents part A}% - {skills section contents part B (the remaining part)} +\newcommand{\condblock}[2]{\ifthenelse{\value{cnt}<2}{#1}{#2}} -% -------------------------------------------------- -% file with the DPL components: i.e. <model-dpl.tex> -% -------------------------------------------------- +\condblock{skills section contents part A}% + {skills section contents part B (the remaining part)} +% ------------------------------------------------------ +% file with the DPL components: i.e. <model-layouts.tex> +% ------------------------------------------------------ \def\bodylayoutlist{% |SubBodyPageBegin|:<0.48>, % left page % include part A in the left page @@ -433,41 +422,104 @@ Listing~\ref{lst:split-contents-example} shows a practical example of what just [...] |SubBodyPageEnd| } -\end{lstlisting}\codeskip +\end{latexcode} Of course the proposed workaround is not the best we could wish for, since it requires manual -operations.\\% (any advice about that is greatly appreciated).\\ +operations. % (any advice about that is greatly appreciated).\\ As an alternative, it is possible to not use the \verb|*PageBegin| and \verb|*PageEnd| mechanism, delegating the double page layout to an external package (i.e. \textit{multicols}). -This kind of approach is showed in listings~\ref{lst:model-dpl2} and~\ref{lst:mycv-example-dpl2}. -%(respectively files \textit{model-dpl2.tex} and \textit{mycv-example-dpl2.tex}). -\bigskip -%\lstinputlisting[firstnumber=1,caption=model-dpl2.tex,label=lst:model-dpl2]{ -%../Examples/Models/model-dpl2.tex } -\begin{lstlisting}[firstnumber=1,caption=model-dpl2.tex,label=lst:model-dpl2] -\input{Models/model-common} - +This kind of approach is showed in listings~\ref{lst:model-dpl2}. +\begin{latexcode}[firstnumber=1,caption=DPL$2$ model (part of +'model-layouts.tex'),label=lst:model-dpl2] \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>,% + [...] + $contents_partB@$:<precmd:vspace=10pt:sectionnumber=6>:<postcmd:mcend>,% } -\end{lstlisting}\codeskip +\end{latexcode} Notice the usage of the commands \textit{\textbackslash{mcbegin}} and \textit{\textbackslash{mcend}}, which act as a wrapper for the \textit{multicols} environment. -\lstinputlisting[firstnumber=1,label=lst:mycv-example-dpl2,caption=mycv-example-dpl2.tex]{ -../Examples/mycv-example-dpl2.tex} -\codeskip +\section{Split file contents} + +This class uses a file based approach as far as the contents of a \CV, that is to say it needs that +the contents be into separated file/s (at least one) with respect to the main file. + +As the class works, having the contents in just one single file is not as good as would be with +multiple files (ideally a file for each section of the document), since multiple files allow to +more easily customize the \CV layout without directly acting on the contents. +On the other hand, a multiple file approach may compel to use several files and not be +convenient.\\ +For these reasons, this class provides a \keyword{PERL} script named +\textit{mycv\_split\_contents.pl} (for a list of all the options provided, type +\textit{mycv\_split\_contents.pl -h} inside a shell environment) +% or take a look at the file itself(function \textit{usage})), +that can process a file and, according to what specified by the +directives in the file itself, split its contents into several files (which will be those +effectively used by the class). In this way is possible to directly manage one single file for the +contents. + +If requested, the script can also create a basic model file with the layout components: +it has to be considered just as a skeleton and probably needs to be edited by hand afterward. + +The directives that may be used inside a contents file have the following form:\codeskip +\begin{latexcode}[numbers=none] +###::|filename|:$component$:&commands& +\end{latexcode} + +{\color{orange}\textit{filemane}} is the name of the file to create, +{\color{brown}\textit{component}} is the main component (\textit{header}, \textit{body} or +\textit{footer}) that the file represents, while {\color{red}\textit{commands}} are the relative +commands associated to the component. +Both \textit{component} and \textit{commands} are not mandatory, but may be useful, especially +\textit{component}, when is requested to generate a basic model file.\\ +The script \textit{mycv\_split\_contents.pl} may be called inside the main file as showed in +listing~\ref{lst:mycv-example-main2}. + +\begin{latexcode}[firstnumber=1,caption=mycv-example-main.tex,label=lst:mycv-example-main2] +% ------------------------------------------------------------------- +% To compile this file is necessary to use the option '-shell-escape' +% to enable the 'write18' construct. +% ------------------------------------------------------------------- +\documentclass[10pt,mdlname=verSPL,withDec,language=english]{mycv} +\immediate\write18{<dirpath>/mycv_split_contents.pl -i cv-contents.tex} +[...] +\end{latexcode} + +When the file \textit{cv-contents.tex} (listing~\ref{lst:cv-contents}) is processed by the script, +the files \textit{*.tex} are created in the directory ''Contents`` (the default one). +\begin{latexcode}[firstnumber=1,caption=cv-contents.tex,label=lst:cv-contents] +% ----------------------------- +% ###::header_title.tex::header +% ----------------------------- +[...] +% ------------------------------------------------------------------- +% ###::contents_partA.tex::body::<precmd:vspace=10pt:sectionnumber=1> +% ------------------------------------------------------------------- +[...] +% ------------------------------------------------------------------- +% ###::contents_partB.tex::body::<precmd:vspace=10pt:sectionnumber=2> +% ------------------------------------------------------------------- +[...] +% ---------------------------- +% ###::footer_sign.tex::footer +% ---------------------------- +[...] +\end{latexcode} + +%To make the example works, is necessary to compile the main file using the option +%\textit{-shell-escape} to enable the \textit{\textbackslash{write18}} construct. +%as follows:\codeskip +%\begin{latexcode}[numbers=none] +%||pdflatex|| -&shell-escape& mycv-example-spl.tex +%\end{latexcode} -\bigskip\bigskip -That's all, {\color{brown}happy \LaTeX{}ing!}\\[5pt] -\Large\calligra{AndreaGhersi}
\ No newline at end of file +\bigskip +\fbox{That's all, {\color{brown}happy \LaTeX{}ing!}} +\hfill\Large\calligra{AndreaGhersi} +\ifparchment\end{parchment}\fi +%\todo[color=lightgray!10,noline]{That's all, {\color{brown}happy \LaTeX{}ing!}} diff --git a/Master/texmf-dist/doc/latex/mycv/Doc/FrontBackMatter/Titlepage+Abstract.tex b/Master/texmf-dist/doc/latex/mycv/Doc/FrontBackMatter/Titlepage+Abstract.tex index 14079c3c0ac..f02c81481e5 100644 --- a/Master/texmf-dist/doc/latex/mycv/Doc/FrontBackMatter/Titlepage+Abstract.tex +++ b/Master/texmf-dist/doc/latex/mycv/Doc/FrontBackMatter/Titlepage+Abstract.tex @@ -6,8 +6,6 @@ % Definitions % =========== -%\def\version{1.5.2} - % this sets the counter to symbols (*, dagger, and so on) \renewcommand{\thefootnote}{\fnsymbol{footnote}} \newcommand{\HRule}{\rule{\linewidth}{0.5mm}} @@ -45,9 +43,9 @@ to the other c.v. classes or packages. Basically, the idea is that a user can write some custom configuration directives, by means of which is possible both to produce different c.v. layouts and quickly switch among them. -\\ + In order to process such directives, this class uses a set of lists, provided by the package -\textit{etextools}.\;A basic support for using the \textit{TikZ} decorations is also provided. +\textit{etextools}. A basic support for \textit{TikZ} decorations is also provided. \end{minipage} diff --git a/Master/texmf-dist/doc/latex/mycv/Doc/Images/logo-1.png b/Master/texmf-dist/doc/latex/mycv/Doc/Images/logo-1.png Binary files differindex b1a2b91b171..861738e2f27 100644 --- a/Master/texmf-dist/doc/latex/mycv/Doc/Images/logo-1.png +++ b/Master/texmf-dist/doc/latex/mycv/Doc/Images/logo-1.png diff --git a/Master/texmf-dist/doc/latex/mycv/Doc/mycv-decs.def b/Master/texmf-dist/doc/latex/mycv/Doc/mycv-decs.def new file mode 100644 index 00000000000..390ef395e0c --- /dev/null +++ b/Master/texmf-dist/doc/latex/mycv/Doc/mycv-decs.def @@ -0,0 +1,110 @@ +%%%%%%%%%%%%% +% % +% Parchment % +% % +%%%%%%%%%%%%% + +% ================================================================== +% Code taken from http://www.texample.net/tikz/examples/framed-tikz/ +% (just a couple of changes made) +% ================================================================== + +\usepackage{framed} +\usetikzlibrary{decorations.pathmorphing,decorations.shapes,calc} +\pgfmathsetseed{1} % To have predictable results +% Define a background layer, in which the parchment shape is drawn +\pgfdeclarelayer{background} +\pgfsetlayers{background,main} + +% ------------------------------------------------------- +% define styles for the normal border and the torn border +% ------------------------------------------------------- +\tikzset{ + normal border/.style={lightgray!12, % or: orange!20!black!10, brown!10 + decorate, decoration={shape, segment length=0.5cm, amplitude=.7mm}}, + torn border/.style={orange!30!black!5, decorate, + decoration={random steps, segment length=.5cm, amplitude=1.7mm}}} + +% ---------------------------------------------------------------------- +% Macro to draw the shape behind the text, when it fits completly in the +% page +% ---------------------------------------------------------------------- +\def\parchmentframe#1{ +\tikz{ + \node[inner sep=2em] (A) {#1}; % Draw the text of the node + \begin{pgfonlayer}{background} % Draw the shape behind + \fill[normal border] + (A.south east) -- (A.south west) -- + (A.north west) -- (A.north east) -- cycle; + \end{pgfonlayer}}} + +% ----------------------------------------------------------------- +% Macro to draw the shape, when the text will continue in next page +% ----------------------------------------------------------------- +\def\parchmentframetop#1{ +\tikz{ + \node[inner sep=2em] (A) {#1}; % Draw the text of the node + % (inner sep=2em is for the + % inner space of all borders + % (left,right,top and bottom) + % inner ysep=0pt for the top + % and bottom borders) + \begin{pgfonlayer}{background} + \fill[normal border] % Draw the ``complete shape'' behind + (A.south east) -- (A.south west) -- + (A.north west) -- (A.north east) -- cycle; + \fill[torn border] % Add the torn lower border + ($(A.south east)-(0,.2)$) -- ($(A.south west)-(0,.2)$) -- + ($(A.south west)+(0,.2)$) -- ($(A.south east)+(0,.2)$) -- cycle; + \end{pgfonlayer}}} + +% ------------------------------------------------------------------- +% Macro to draw the shape, when the text continues from previous page +% ------------------------------------------------------------------- +\def\parchmentframebottom#1{ +\tikz{ + \node[inner sep=2em] (A) {#1}; % Draw the text of the node + \begin{pgfonlayer}{background} + \fill[normal border] % Draw the ``complete shape'' behind + (A.south east) -- (A.south west) -- + (A.north west) -- (A.north east) -- cycle; + \fill[torn border] % Add the torn upper border + ($(A.north east)-(0,.2)$) -- ($(A.north west)-(0,.2)$) -- + ($(A.north west)+(0,.2)$) -- ($(A.north east)+(0,.2)$) -- cycle; + \end{pgfonlayer}}} + +% ------------------------------------------------------------------------ +% Macro to draw the shape, when both the text continues from previous page +% and it will continue in next page +% ------------------------------------------------------------------------ +\def\parchmentframemiddle#1{ +\tikz{ + \node[inner sep=2em] (A) {#1}; % Draw the text of the node + \begin{pgfonlayer}{background} + \fill[normal border] % Draw the ``complete shape'' behind + (A.south east) -- (A.south west) -- + (A.north west) -- (A.north east) -- cycle; + \fill[torn border] % Add the torn lower border + ($(A.south east)-(0,.2)$) -- ($(A.south west)-(0,.2)$) -- + ($(A.south west)+(0,.2)$) -- ($(A.south east)+(0,.2)$) -- cycle; + \fill[torn border] % Add the torn upper border + ($(A.north east)-(0,.2)$) -- ($(A.north west)-(0,.2)$) -- + ($(A.north west)+(0,.2)$) -- ($(A.north east)+(0,.2)$) -- cycle; + \end{pgfonlayer}}} + +% ------------------------------------------------------------------------ +% Define the environment which puts the frame +% In this case, the environment also accepts an argument with an optional +% title (which defaults to ``Example'', which is typeset in a box overlaid +% on the top border +% ------------------------------------------------------------------------ +\newenvironment{parchment}{%[1][Example]{% + \def\FrameCommand{\parchmentframe}% + \def\FirstFrameCommand{\parchmentframetop}% + \def\LastFrameCommand{\parchmentframebottom}% + \def\MidFrameCommand{\parchmentframemiddle}% + \vskip\baselineskip + \MakeFramed {\FrameRestore}} + %\noindent\tikz\node[inner sep=1ex, draw=black!20,fill=white, + % anchor=west, overlay] at (0em, 2em) {\sffamily#1};\par}% +{\endMakeFramed}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Doc/mycv-macros.sty b/Master/texmf-dist/doc/latex/mycv/Doc/mycv-macros.sty index ad9c624aab5..9c07fd40cae 100644 --- a/Master/texmf-dist/doc/latex/mycv/Doc/mycv-macros.sty +++ b/Master/texmf-dist/doc/latex/mycv/Doc/mycv-macros.sty @@ -8,8 +8,8 @@ \RequirePackage{svn-prov} \ProvidesPackageSVN - {$Id: mycv-macros.sty 66 2012-04-28 14:38:41Z ghangenit $} - [\version][A package providing some useful commands] + {$Id: mycv-macros.sty 85 2012-05-12 17:07:42Z ghangenit $} + [v\version][A package providing some useful commands for writing this doc] \ifdraft % --------------------------------- @@ -254,41 +254,48 @@ % for backgroundcolor color \definecolor{lightergray}{gray}{0.99} -\lstset{language=[LaTeX]Tex, - keywordstyle=\color{RoyalBlue}, - basicstyle=\normalfont\ttfamily, - commentstyle=\color{Emerald}\ttfamily, - stringstyle=\rmfamily, - numbers=none,%left,% where to put the line-numbers ('none' if no numbers are wanted) - % to decomment for having numbers inside the listing box instead outside - %xleftmargin=2em,frame=single,framexleftmargin=1.5em, - numberstyle=\scriptsize\color{gray},% the style that is used for the line-numbers - stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered - numbersep=8pt,% how far the line-numbers are from the code - showstringspaces=false, - breaklines=true, - frameround=ftff, - frame=lines, - moredelim=[is][\color{orange}]{|}{|}, - moredelim=[is][\color{brown}]{$}{$}, - moredelim=[is][\color{red}]{&}{&}, - backgroundcolor=\color{lightergray} -} +\lstnewenvironment{latexcode}[1][]{% + \small + \lstset{language=[LaTeX]Tex, + keywordstyle=\color{RoyalBlue}, + basicstyle=\normalfont\ttfamily, + commentstyle=\color{Emerald}\ttfamily, + stringstyle=\rmfamily, + numbers=none,%left,% where to put the line-numbers ('none' if no numbers are wanted) + % to decomment for having numbers inside the listing box instead outside + %xleftmargin=2em,frame=single,framexleftmargin=1.5em, + numberstyle=\scriptsize\color{gray},% the style that is used for the line-numbers + stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered + numbersep=8pt,% how far the line-numbers are from the code + showstringspaces=false, + breaklines=true, + frameround=ftff, + frame=lines, + moredelim=[is][\color{orange}]{|}{|}, + moredelim=[is][\color{brown}]{$}{$}, + moredelim=[is][\color{red}]{&}{&}, + moredelim=[is][\textbf]{||}{||}, + backgroundcolor=\color{lightergray}, + #1 % option that may be passed + } + \lstset{ + morekeywords=% + {% + RequirePackage,newboolean,DeclareOption,setboolean,% + ProcessOptions,PackageError,ifthenelse,boolean,% + MakeTextLowercase,@ifpackageloaded,undefined,% + DeclareRobustCommand,MakeTextUppercase,conditionalblock,% + color,titlerule,titlespacing,ifmodel,ifoption,mypdftitle,% + labelitemi,hypersetup,setlength,mydecorationsSetLineWidth, + mydecorationsPathmorphing,mycfoot,myrenderlayout,cvdec,% + definecolor,includegraphics,ifdefined,mcbegin,mcend,% + ProvidesPackage,PackageInfo,PackageWarningNoLine,% + @ifclassloaded,ExecuteOptions,PackageWarning,textcolor% + },% + commentstyle=\color{Emerald}\ttfamily,% + frame=lines% + } +}{\codeskip} -\lstset{ - morekeywords=% - {% - RequirePackage,newboolean,DeclareOption,setboolean,% - ProcessOptions,PackageError,ifthenelse,boolean,% - MakeTextLowercase,@ifpackageloaded,undefined,% - DeclareRobustCommand,MakeTextUppercase,conditionalblock,% - color,titlerule,titlespacing,ifmodel,ifoption,% - labelitemi,hypersetup,setlength,mydecorationsSetLineWidth, - mydecorationsPathmorphing,mycfoot,myrenderlayout,cvdec,% - definecolor,includegraphics,ifdefined,mcbegin,mcend,% - ProvidesPackage,PackageInfo,PackageWarningNoLine,% - @ifclassloaded,ExecuteOptions,PackageWarning,textcolor% - },% - commentstyle=\color{Emerald}\ttfamily,% - frame=lines% -}
\ No newline at end of file +% include le macro per la pergamena se richiesto +\ifparchment\input{mycv-decs.def}\fi
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Doc/mycv.tex b/Master/texmf-dist/doc/latex/mycv/Doc/mycv.tex index 3cd4bce9786..214e3db7e55 100644 --- a/Master/texmf-dist/doc/latex/mycv/Doc/mycv.tex +++ b/Master/texmf-dist/doc/latex/mycv/Doc/mycv.tex @@ -1,7 +1,11 @@ -\def\version{1.5.4} +\def\version{1.5.5} \newif\ifdraft %\drafttrue % se decommentato utilizza formato bozza +\newif\ifparchment +% se commentato non utilizza la pergamena +\parchmenttrue + \documentclass[ 10pt, % corpo del font principale a4paper,oneside,openany, % carta A4, pagina singola @@ -47,9 +51,15 @@ % calligra font \usepackage{calligra} +% todo notes +\usepackage{todonotes} + % nessuna identazione \setlength{\parindent}{0pt} +% per l'environment comment +\usepackage{comment} + % codice \usepackage{listings} diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/Contents/header_contacts.tex b/Master/texmf-dist/doc/latex/mycv/Examples/Contents/header_contacts.tex index 93066603a85..4e11e9d96a7 100644 --- a/Master/texmf-dist/doc/latex/mycv/Examples/Contents/header_contacts.tex +++ b/Master/texmf-dist/doc/latex/mycv/Examples/Contents/header_contacts.tex @@ -1,7 +1,17 @@ \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 [fill=myshadecolor,rounded corners=10pt, minimum size= 2.5cm]{% + \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 @@ -9,6 +19,8 @@ \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
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/Contents/header_title.tex b/Master/texmf-dist/doc/latex/mycv/Examples/Contents/header_title.tex index 6fb52bda72e..7b06ae8f0af 100644 --- a/Master/texmf-dist/doc/latex/mycv/Examples/Contents/header_title.tex +++ b/Master/texmf-dist/doc/latex/mycv/Examples/Contents/header_title.tex @@ -1,3 +1,5 @@ \bigskip {\sffamily\Huge{}Dr. Adam Smith}\\[3pt]% -{\color{myheadingscolor}\huge\calligra{CurriculumVitae}\\[25pt]}
\ No newline at end of file +\ifmodel{verSPL2} + {{\color{red}\huge\calligra{CurriculumVitae}\\[25pt]}} + {{\color{myheadingscolor}\huge\calligra{CurriculumVitae}\\[25pt]}}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-dpl.tex b/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-dpl.tex deleted file mode 100644 index 20f88f11e5a..00000000000 --- a/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-dpl.tex +++ /dev/null @@ -1,30 +0,0 @@ -\input{Models/model-common} -\def\bodylayoutlist{% - % --------------------------------------------------------- - % moves the right margin to the left (text and title rules) - % --------------------------------------------------------- - MainBodyPageBegin:<0.96>, - % --------------------------------------------------------- - % the 2 directives below are just used as a trick to do the - % same thing for the left margin (it is moved to the right) - % --------------------------------------------------------- - SubBodyPageBegin, - SubBodyPageEnd, - % ----------------------------------------- - % left page (0.48 of textwidth) - % ----------------------------------------- - 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>, - % ----------------------------------------- - % right page (0.48 of textwidth) - % ----------------------------------------- - SubBodyPageBegin:<0.48>, - contents_partA@:<precmd:vspace=10pt:sectionnumber=4>, - contents_partB@:<precmd:vspace=10pt:sectionnumber=5>, - SubBodyPageEnd, - % ----------------------------------------- - MainBodyPageEnd% -}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-dpl2.tex b/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-dpl2.tex deleted file mode 100644 index 7826702826d..00000000000 --- a/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-dpl2.tex +++ /dev/null @@ -1,14 +0,0 @@ -\input{Models/model-common} - -\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>,% -}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-layouts.tex b/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-layouts.tex new file mode 100644 index 00000000000..f3297affee5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-layouts.tex @@ -0,0 +1,77 @@ +\input{Models/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}{% + % changes color of text and sections + \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{% + % --------------------------------------------------------- + % moves the right margin to the left (text and title rules) + % --------------------------------------------------------- + MainBodyPageBegin:<0.96>, + % --------------------------------------------------------- + % the 2 directives below are just used as a trick to do the + % same thing for the left margin (it is moved to the right) + % --------------------------------------------------------- + SubBodyPageBegin, + SubBodyPageEnd, + % ----------------------------------------- + % left page (0.48 of textwidth) + % ----------------------------------------- + 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>, + % ----------------------------------------- + % right page (0.48 of textwidth) + % ----------------------------------------- + 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}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-spl.tex b/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-spl.tex deleted file mode 100644 index 2123f90d77f..00000000000 --- a/Master/texmf-dist/doc/latex/mycv/Examples/Models/model-spl.tex +++ /dev/null @@ -1,10 +0,0 @@ -\input{Models/model-common} -\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> - % --------------------------------------------------- -}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/Notes.txt b/Master/texmf-dist/doc/latex/mycv/Examples/Notes.txt new file mode 100644 index 00000000000..e373e7d8676 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mycv/Examples/Notes.txt @@ -0,0 +1,17 @@ + +========================================================================================= +To produce the pdf files with examples, set the local environment variable 'TEXINPUTS' to +the directory where you unzipped the 'mycv' bundle. As an example, on Linux: + + export TEXINPUTS=".:$TEXINPUTS:<dirpath>/mycv:" + +Then run the commands (it may be necessary to run each command twice): + + pdflatex -jobname mycv-example-dpl "\def\model{verDPL}\input{mycv-example-main}" + pdflatex -jobname mycv-example-dpl2 "\def\model{verDPL2}\input{mycv-example-main}" + pdflatex -jobname mycv-example-spl "\def\model{verSPL}\input{mycv-example-main}" + pdflatex -jobname mycv-example-spl2 "\def\model{verSPL2}\input{mycv-example-main}" + +If the class has been installed in the system (see the README file), you simply need to +run the commands above (without setting the environment variable 'TEXINPUTS'). +=========================================================================================
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-common.tex b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-common.tex index 3cfb9f7a721..81d57655353 100644 --- a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-common.tex +++ b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-common.tex @@ -8,22 +8,24 @@ \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}{}} -\ifmodel{verSPL}{ - \input{Models/model-spl} - \mypdftitle{Simple CV example: SPL} -}{\relax} +% include layouts components +\input{Models/model-layouts} -\ifmodel{verDPL}{ - \input{Models/model-dpl} - \mypdftitle{Simple CV example: DPL} -}{\relax} - -\ifmodel{verDPL2}{ - \input{Models/model-dpl2} - \mypdftitle{Simple CV example: DPL2} -}{\relax} +\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}
\ No newline at end of file +\mypdfauthor{Andrea Ghersi}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl.pdf b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl.pdf Binary files differindex 20c2c9267e2..dfa87f5bb84 100644 --- a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl.pdf +++ b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl.pdf diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl.tex b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl.tex deleted file mode 100644 index 8e97e087af6..00000000000 --- a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl.tex +++ /dev/null @@ -1,9 +0,0 @@ -\documentclass[10pt,mdlname=verDPL,withDec,language=english]{mycv} - -\usepackage{mycv_style} -\usepackage{mycv_dec} -\input{mycv-example-common} - -\begin{document} -\cvdec\myrenderlayout\mycfoot{Last update: \today} -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl2.pdf b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl2.pdf Binary files differindex 80ce1baacba..a88ec273e27 100644 --- a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl2.pdf +++ b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl2.pdf diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl2.tex b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl2.tex deleted file mode 100644 index 30a452e83a5..00000000000 --- a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-dpl2.tex +++ /dev/null @@ -1,10 +0,0 @@ -\documentclass[10pt,mdlname=verDPL2,language=english]{mycv} -\input{mycv-example-common} - -\usepackage{multicol} -\setlength{\columnsep}{2.0pc} -\setlength\columnseprule{.4pt} - -\begin{document} -\myrenderlayout\mycfoot{Last update: \today} -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-main.tex b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-main.tex new file mode 100644 index 00000000000..2514e4b20ce --- /dev/null +++ b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-main.tex @@ -0,0 +1,9 @@ +\def\cvmodel{verDPL} % default model +\ifdefined\model\def\cvmodel{\model}\fi + +\documentclass[10pt,mdlname=\cvmodel,withDec,language=english]{mycv} +\input{mycv-example-common} + +\begin{document} +\cvdec\myrenderlayout\mycfoot{Last update: \today} +\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-spl.pdf b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-spl.pdf Binary files differindex d17cad83403..f18af8cf950 100644 --- a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-spl.pdf +++ b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-spl.pdf diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-spl.tex b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-spl.tex deleted file mode 100644 index 5bdb8dcde23..00000000000 --- a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-spl.tex +++ /dev/null @@ -1,6 +0,0 @@ -\documentclass[10pt,mdlname=verSPL,withDec,language=english]{mycv} -\input{mycv-example-common} - -\begin{document} -\cvdec\myrenderlayout\mycfoot{Last update: \today} -\end{document}
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-spl2.pdf b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-spl2.pdf Binary files differnew file mode 100644 index 00000000000..7d8a0da04c8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mycv/Examples/mycv-example-spl2.pdf diff --git a/Master/texmf-dist/doc/latex/mycv/README b/Master/texmf-dist/doc/latex/mycv/README index 91a5fb6b656..35b74c9b8d7 100644 --- a/Master/texmf-dist/doc/latex/mycv/README +++ b/Master/texmf-dist/doc/latex/mycv/README @@ -1,7 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % -% MyCV class (v1.5.4) % -% 2012-04-28 % +% MyCV class (v1.5.5) % +% 2012-05-13 % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -31,8 +31,7 @@ is possible both to produce different c.v. layouts and quickly switch among them. In order to process such directives, this class uses a set of lists, provided by the package <etextools>. -A basic support for using the <TikZ> decorations is -also provided. +A basic support for TikZ decorations is also provided. ========================== | | @@ -47,27 +46,39 @@ and sub-directories: 'README' -- this file 'CHANGELOG -- the revision history -'mycv.cls' -- the main class file (**) +'mycv.cls' -- the main class file 'mycv_*.def' -- files to support the main - class implementation (**) -'mycv_*.sty' -- class extensions (**) + class implementation +'mycv_*.sty' -- class extensions 'mycv.pdf' -- the documentation file +'mycv_*.pl' -- a Perl script (see the doc. file) <Examples> -- directory with some examples <Doc> -- contains the documentation sources ------------- -Installation ------------- +------------------ +Class installation +------------------ -In order to install the MyCV class, move all 'mycv_*.def', -'mycv_*.sty' and 'mycv.cls' files, marked with '**' in the -list above, into a folder searched by LaTeX; the update of -the LaTeX db might be necessary to finish the installation. +*) In order to install this class, move all files with + extensions '.def', '.sty' and '.cls' into a folder + searched by LaTeX; the update of the LaTeX database + might be necessary to complete the installation. -To produce the files with examples, move to the directory -<Examples> and run 'mycv-example-[dpl*|spl].tex' through -pdfLaTeX. Except for the file 'mycv-example-dpl2.tex', it -might be necessary to repeat the operation twice. +*) Optionally, the Perl script 'mycv_split_contents.pl' + may be copied to a folder in the 'PATH' environment + variable. -To create the documentation, move to the <Doc> directory -and run 'mycv.tex' twice through pdfLaTeX.
\ No newline at end of file +------------- +Documentation +------------- + +To create the documentation, move to the <Doc> folder +and run 'mycv.tex' twice through pdfLaTeX. Due to the +use of some TikZ decorations, it may take awhile. + +-------- +Examples +-------- + +See the file 'Notes.txt' in the folder 'Examples' for +information on how to produce pdf files with examples.
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/mycv/mycv.pdf b/Master/texmf-dist/doc/latex/mycv/mycv.pdf Binary files differindex a1e2318aca7..8d2b766e9da 100644 --- a/Master/texmf-dist/doc/latex/mycv/mycv.pdf +++ b/Master/texmf-dist/doc/latex/mycv/mycv.pdf diff --git a/Master/texmf-dist/doc/latex/mycv/mycv_split_contents.pl b/Master/texmf-dist/doc/latex/mycv/mycv_split_contents.pl new file mode 100644 index 00000000000..58f335043a9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mycv/mycv_split_contents.pl @@ -0,0 +1,215 @@ +#!/usr/bin/perl -w + +# ------------------------------------------------------- +# 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'. +# ------------------------------------------------------- + +# $Id: mycv_split_contents.pl 83 2012-05-10 17:21:40Z ghangenit $ + +use Getopt::Long; +use File::Path; +use warnings; +use strict; +use Cwd; + +# hashes with errors and warnings messages + +my %errors = ( + OME => "$0: ERROR opening <%s> in output mode (CWD: %s): %s\n", + IME => "$0: ERROR opening <%s> in input mode (CWD: %s): %s\n", + NIF => "$0: ERROR: no input file provided!\nUse the option <-i infile>.\n", + NOD => "$0: ERROR: no output dir. provided!\nUse the option <-o outdir>.\n", + IOE => "$0: ERROR: input file and output dir are the same!\n" +); + +my %warnings = ( + NVC => "WARNING:: <%s> is not recognized as a valid component!\n" . + "A component can only be 'header', 'body' or 'footer'.\n" +); + +my $outdir = 'Contents'; # default output dir +my $infile = 'cv_contents.tex'; # default input file +my $cwd = getcwd(); # current directory +my %opt = (); # hash for options + + +### +### + +sub _usage() +{ + print STDERR << "EOF"; + + Usage: $0 [-h] [-e] [-i infile] [-o outdir] [-m modelfile] + Version <1.0> + + Options: + ======== + + -o outdir \t : uses <outdir> as output dir {default: 'Contents'} + -m mdlfile \t : writes basic model directives to the <mdlfile> file + -i infile \t : uses <infile> as input file {default: 'cv_contents.tex'} + -e \t : keeps file names extension in model directives + -h \t : this help message + + Examples: + ========= + + 1) Splits the input file 'cv_contents.tex' into multiple files (they + will be created in the directory 'Contents'), as specified in the + file itself - the input file is not modified: + + [$0 -i cv_contents.tex] + + 2) As above but, in addiction, a basic model file (model-spl.tex) for + multiple files is created (in the model directives, the file names + extension will be removed): + + [$0 -i cv_contents.tex -m model-spl.tex] + + 3) As above, but file names in the model directives will keep their + own extension: + + [$0 -i cv_contents.tex -m model-spl.tex -e] + +EOF + exit 0; +} + + +### +### + +sub mcdie { printf STDERR @_, $!; exit 1; } + + +### +### + +sub processCommandLine() +{ + GetOptions ( + 'o=s' => \$opt{o}, 'i=s' => \$opt{i}, + 'm=s' => \$opt{m}, 'h' => \$opt{h}, + 'e' => \$opt{e} + ) or _usage(); + + $opt{h} and _usage(); + _usage() if ( $#ARGV > -1 ); + + _dealWithInOutFiles(); + return \%opt; +} + + +### +### + +sub _dealWithInOutFiles +{ + $opt{o} and $outdir = $opt{o}; + $opt{i} and $infile = $opt{i}; + + if ( $infile eq "" ){ die $errors{NIF} } + if ( $outdir eq "" ){ die $errors{NOD} } + if ( $infile eq $outdir ){ die $errors{IOE} } + + $opt{outdir} = $outdir; + $opt{infile} = $infile; +} + + +### +### + +sub fileprocess ($) +{ + my $cmdoptions = shift; + my $outdir = $cmdoptions->{'outdir'}; + my $linehook = '###'; + my %components; + my $sep = '::'; + + open INFILE, $cmdoptions->{'infile'} or + mcdie( $errors{IME}, $cmdoptions->{'infile'}, $cwd ); + + mkpath($outdir); + (-d $outdir) or mcdie( $errors{OME}, $outdir, $cwd ); + + while ( my $line = <INFILE> ) + { + my @info; my $ctype=''; + if ( $line =~ /$linehook/ ) + { + PROCESSLINE: + @info = split(/$sep/, $line); + + $ctype=$info[2]; # contains the component type (header,...) + chomp($ctype); + + if ( $info[2] ) + { + if ( $ctype =~ /header/ ) { push (@{$components{h}}, $line) } + elsif ( $ctype =~ /body/ ){ push (@{$components{b}}, $line) } + elsif ( $ctype =~ /footer/ ){ push (@{$components{f}}, $line) } + else { printf STDERR $warnings{NVC}, $ctype } + } + + if ( $info[1] ) # contains the file name to write + { + open OUTFILE, '>', "$outdir/$info[1]" or + mcdie( $errors{OME}, $info[1], $cwd ); + + while ( $line = <INFILE> ) + { + if ( $line =~ /$linehook/ ) + { + close OUTFILE; + goto PROCESSLINE; + } + else { print OUTFILE $line } # write to file + } + } + } + } + + close INFILE; + if ( $cmdoptions->{'m'} ) + { + open OUTFILE, '>', $cmdoptions->{'m'} or + mcdie( $errors{OME}, $cmdoptions->{'m'}, $cwd ); + + for my $key ( keys %components ) + { + if ( $key eq "b" ) { print OUTFILE "\\def\\bodylayoutlist{%\n" } + elsif ( $key eq "h" ) { print OUTFILE "\\def\\headerlayoutlist{%\n" } + elsif ( $key eq "f" ) { print OUTFILE "\\def\\footerlayoutlist{%\n" } + + my @info; my $cnt=0; my $fname=''; + while ( $components{$key}[$cnt] ) + { + @info = split(/$sep/, $components{$key}[$cnt]); + $cnt++; + + $fname=$info[1]; + if ( !$cmdoptions->{'e'} ){ $fname =~ s{\.[^.]+$}{} } + if ( $info[1] ){ chomp($fname); print OUTFILE " $fname@" } + if ( $info[3] ){ chomp($info[3]); print OUTFILE ":$info[3]" } + print OUTFILE ",\n"; + } + print OUTFILE "}\n"; + } + close OUTFILE; + } +} + + +## +## MAIN +## + +fileprocess( processCommandLine() );
\ No newline at end of file |