summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Usage.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Usage.tex')
-rw-r--r--Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Usage.tex241
1 files changed, 168 insertions, 73 deletions
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 43cfcbccad6..b79a542827e 100644
--- a/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Usage.tex
+++ b/Master/texmf-dist/doc/latex/mycv/Doc/Chapters/Usage.tex
@@ -7,21 +7,24 @@
\section{Requirements}
-When \textit{decorations} are not enabled and the \textit{default style} is not used, \classname has
-(apart from \ctLaTeXe) the following requirements:\codeskip
-\begin{lstlisting}[firstnumber=1,numbers=none]
+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
\RequirePackage{etextools} % for lists and other useful tools
\RequirePackage{ifthen} % for \ifthenelse command
-\RequirePackage{pifont} % for ding style (itemize environment)
\RequirePackage{xstring} % for string utilities
\RequirePackage{svn-prov} % for file info extracted from SVN
-\RequirePackage{xparse} % for commands with multiple default arguments
-\end{lstlisting}\codeskip
+\RequirePackage{hyperref} % for hypertext links and other stuff
+\end{lstlisting}}}\codeskip
-In addiction, if the default style is used, by means of the class option
-``\textit{style}''~\myref{sec:class-options}, this class requires:\codeskip
+Besides, 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]
+\RequirePackage{xparse} % for commands with multiple default arguments
+\RequirePackage{pifont} % for ding style (itemize environment)
\RequirePackage{titlesec} % for title format and spacing
\RequirePackage{fancyhdr} % for custom footer
\RequirePackage{xcolor} % for color
@@ -29,13 +32,15 @@ In addiction, if the default style is used, by means of the class option
\RequirePackage{times} % times font
\RequirePackage{marvosym} % symbols - phone
\RequirePackage{amssymb} % symbols - email
-\end{lstlisting}\codeskip
+\end{lstlisting}}}\codeskip
-Finally, if decorations are enabled, by using the class option
-``\textit{withDec}``~\myref{sec:class-options}, this class also requires:\codeskip
+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]
-RequirePackage{tikz} % for graphics
-\end{lstlisting}\codeskip
+\RequirePackage{tikz} % for graphics
+\end{lstlisting}}}\codeskip
\section{Class options}
\label{sec:class-options}
@@ -55,8 +60,8 @@ addiction, it provides the following options:
\end{myindent}
\item {\color{red}style=<\argname[\tmpcolor]{filemane}>}
\begin{myindent}
- specifies the file name (without the extension ``.tex'' if any) with the style commands.
- By default, the file \textit{mycv\_style.def}, provided by the class itself, is that used.
+ 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;
\end{myindent}
\item {\color{red}mdlname=<\argname[\tmpcolor]{name}>}
@@ -67,7 +72,7 @@ addiction, it provides the following options:
\end{myindent}
\item {\color{red}withDec}
\begin{myindent}
- enables support for decorations (provided by the \textit{TikZ} package);
+ enables support for decorations (provided by the \textit{TikZ} package).
\end{myindent}
\squishend
@@ -121,6 +126,9 @@ for an optional argument of a command.
\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\}).
+\item \cmdname{myitemize}
+ \cmddsep
+ a list environment that uses the \textit{ding} style.
\squishend
\subsection{Decorations}
@@ -213,10 +221,6 @@ functionality), but is enough for this class purposes. The only \textit{TikZ} pa
temporarily changes the language in use (\textit{babel} package) to \argname{language} for
\argname{text}.
-\item \cmdname{myitemize}
- \cmddsep
- a list environment that uses the \textit{ding} style.
-
\item \cmdname{mychangemargin}
\marg{left-margin}\arghsep
\marg{right-margin}\cmddsep
@@ -244,32 +248,62 @@ 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}).
-%For our intents,
+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 this:
-\lstinputlisting[firstnumber=1,caption=model-common.tex,label=lst:model-common]{
-../Examples/Models/model-common.tex}\codeskip
-
-Notice that in listing~\ref{lst:model-common}, for the \DPL, we used some decoration commands.
-Obviously, it is also possible to not use decorations (simply by not using the relative class
-option), but in that case the showed code would yield some compilation errors, since decoration
-commands would be called without being defined.\\
-A possible solution makes the use of the conditional command \textit{\textbackslash{}ifoption}, so
-that the first part of the code would become something like in listing~\ref{lst:model-common-hint}.
-\begin{lstlisting}[firstnumber=1,label=lst:model-common-hint,caption=model-common-hint]
-\ifmodel{verDPL}{%
- \ifoption{withDec}{%
- [...]
- }{\newcommand{\cvdec}{}}
-}{\newcommand{\cvdec}{}}
-\end{lstlisting}\codeskip
+\textit{model-common.tex}, such as in listing~\ref{lst:model-common}:
+\begin{lstlisting}[firstnumber=1,caption=model-common.tex,label=lst:model-common]
+\def\headerlayoutlist{%
+ &MainHeaderPageBegin&:<postcmd:vspace=10pt>,
+ % --------------------------------- left header
+ |SubHeaderPageBegin|:<precmd:hfill>,
+ $header_title@$, % header file one
+ |SubHeaderPageEnd|:<postcmd:hfill>,
+ % --------------------------------- right header
+ |SubHeaderPageBegin|,
+ $header_contacts@$, % header file two
+ |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})
+Now we can deal with the layout components specific for the \DPL (\textit{model-dpl.tex}),
as in listing~\ref{lst:dplmodel}.
-\lstinputlisting[firstnumber=1,caption=model-dpl.tex,label=lst:dplmodel]{
-../Examples/Models/model-dpl.tex }
+%\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{%
+ % ---------------------------------------------------------
+ % 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&%
+}
+\end{lstlisting}
\codeskip
%The directive colored in red moves the right margin to the left (text and title rules) while the
@@ -282,23 +316,36 @@ as in listing~\ref{lst:dplmodel}.
%\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-dpl.tex}). In this case, we do not need to use \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
+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{%
+ % ---------------------------------------------------
+ $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>
+ % ---------------------------------------------------
+}
+\end{lstlisting}
+\codeskip
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.\\
-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 directory path with the option
-``\textit{cntdir}''~\myref{sec:class-options}.
+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 support and language;
+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.
-% (see the listings~~\ref{lst:dplmodel} or ~\ref{lst:splmodel}).
+% (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
\SPL would just be a matter of changing the ``\textit{mdlname}'' option from \keyword{verDPL} to
@@ -306,22 +353,34 @@ Here we take the \DPL as an example (listing~\ref{lst:mycv-example-dpl}), but sw
\begin{lstlisting}[firstnumber=1,label=lst:mycv-example-dpl,caption=mycv-example-dpl.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
-What remains to do is just to include the appropriate layout components file (\ref{lst:dplmodel} or
-\ref{lst:splmodel}) and process them with the \textit{\textbackslash{}myrenderlayout} command, as
-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.
+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]
[...]
-\ifmodel{verSPL}{\input{Models/model-spl}}{\relax}
-\ifmodel{verDPL}{\input{Models/model-dpl}}{\relax}
+\ifoption{withDec}{%
+ \newcommand{\cvdec}{
+ \mydecorationsSetLineWidth[0.3mm]%
+ \mydecorationsPathmorphing*{coil}<radial><lightgray>
+ }%
+}{\newcommand{\cvdec}{}}
-\begin{document}
-\myrenderlayout % all components
+\ifmodel{verSPL}{\input{Models/model-spl}[...]}{\relax}
+\ifmodel{verDPL}{\input{Models/model-dpl}[...]}{\relax}
[...]
-\end{document}
\end{lstlisting}
%\lstinputlisting[firstnumber=1,caption=mcv-example-common.tex,label=lst:example]{
%../Examples/mycv-example-common.tex}
@@ -340,38 +399,74 @@ This can be done by using a counter that keeps track of the number of times a sa
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]
% ---------------------------------------------------------
% file with the section contents: i.e. <section_skills.tex>
% ---------------------------------------------------------
-% increase the counter 'acounter', that is defined outside this file
+
+% increases the counter 'acounter'
+% (it's defined outside this file)
\stepcounter{acounter}
-\newcommand{\conditionalblock}[2]{\ifthenelse{\value{acounter}<2}{#1}{#2}}
-\textconditionalblock%
+
+\newcommand{\conditionalblock}[2]{%
+ \ifthenelse{\value{acounter}<2}{#1}{#2}%
+}
+
+% selects the appropriate part of the file contents
+\conditionalblock%
{skills section contents part A}%
{skills section contents part B (the remaining part)}
+
% --------------------------------------------------
% file with the DPL components: i.e. <model-dpl.tex>
% --------------------------------------------------
+
\def\bodylayoutlist{%
|SubBodyPageBegin|:<0.48>, % left page
% include part A in the left page
- section_skills@,
+ $section_skills@$,
[...]
|SubBodyPageEnd|,
|SubBodyPageBegin|:<0.48>, % right page
% include part B in the right page
- section_skills@,
+ $section_skills@$,
[...]
|SubBodyPageEnd|
}
\end{lstlisting}\codeskip
Of course the proposed workaround is not the best we could wish for, since it requires manual
-operations. Unfortunately, at the moment, I would not know how to solve the problem with a brighter
-idea. Any advice or comment is greatly appreciated, either for the specific problem or for this
-work in general.
+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}
+
+\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>,%
+}
+\end{lstlisting}\codeskip
+
+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
\bigskip\bigskip
That's all, {\color{brown}happy \LaTeX{}ing!}\\[5pt]