1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047
|
% ----------------------------------------------------------
% ** This file was automatically generated by <DoPackage.sh>
% ** with option(s) 'ctan'.
% ** Date: Sun May 20 21:31:48 CEST 2012::1337542308
% ----------------------------------------------------------
% -------------------------------------------------------
% 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'.
% -------------------------------------------------------
\def\version{1.5.6}
\newif\ifdraft
\newif\ifparchment
\parchmenttrue
\documentclass[
10pt,
a4paper,oneside,openany,
titlepage,
fleqn,
headinclude,footinclude,
BCOR5mm,
numbers=noenddot,
cleardoublepage=empty,
captions=tableheading
\ifdraft
,draft
\else
\fi
]{scrreprt}
\usepackage[backref]{classicthesis-ldpkg}
\usepackage[
eulerchapternumbers,
subfig,
beramono,
eulermath,
pdfspacing,
dottedtoc
]{classicthesis}
\usepackage[english]{arsclassica}
\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\usepackage{textcomp}
\usepackage{empheq}
\usepackage{calligra}
\usepackage{todonotes}
\setlength{\parindent}{0pt}
\usepackage{comment}
\usepackage{listings}
\ifdraft
\overfullrule=5pt
\fi
\hypersetup{citecolor=webgreen}
\hypersetup{pdfstartpage=1}
\hypersetup{%
pdfstartpage = 1,
pdfauthor = Andrea Ghersi,
pdftitle = MyCV,
pdfsubject = MyCV class documentation,
pdfproducer = \LaTeX{},
pdfkeywords = {},
pdfcreator = \LaTeX{} with 'arsclassica'
}
\newcommand{\myTitle}{MyCV\xspace}
\newcommand{\myName}{Andrea Ghersi\xspace}
\newcommand{\myMail}{ghanhawk@gmail.com}
\areaset{412pt}{749pt}
\titleformat{\section}%
{\color{red}\normalfont\Large\bfseries\bf}%
{\color{red}\MakeTextLowercase{\thesection}}{1em}{\spacedlowsmallcaps}
\titleformat{\subsection}%
{\color{orange}\normalfont\bfseries\bf}
{\textsc{\MakeTextLowercase{\thesubsection}}}{1em}{\normalsize}
\titleformat{\subsubsection}%
{\color{cyan}\normalfont\bfseries\bf}
{\textsc{\MakeTextLowercase{\thesubsection}}}{1em}{\small}
\renewcommand*\cftchapfont{\color{red}\bfseries}
\renewcommand*\cftsecfont{\color{gray}\bfseries}
\def\chapterautorefname{chapter}
\def\sectionautorefname{section}
\def\subsectionautorefname{subsection}
\def\myitemsep{5pt}
\newcommand{\squishlist}[1][\myitemsep]{%
\begin{list}{$\triangleright$}%
{
\setlength{\parskip}{5pt}%
\setlength{\itemsep}{#1}%
\setlength{\parsep}{5pt}%
\setlength{\topsep}{5pt}%
\setlength{\partopsep}{0pt}%
\setlength{\leftmargin}{2.5em}%
\setlength{\labelwidth}{1em}%
\setlength{\labelsep}{0.5em}%
}}
\newcommand{\squishend}{%
\end{list}}
\newcommand{\quotes}[3][0]{%
\definecolor{authorcolor}{RGB}{51, 153, 51}
\definecolor{datecolor} {RGB}{51, 153, 51}
%
\noindent\makebox[0.90\textwidth]{%
\begin{minipage}[t]{0.50\textwidth}%
\hfill%
\end{minipage}%
\begin{minipage}[t]{0.50\textwidth}%
{\small\ignorespaces\slshape #2}\\[0.5em]%
\medskip%
\hfill\texttt{---} {{\color{authorcolor}{#3}}}%
\ifnum#1>0%
\xspace[{\color{datecolor}{#1}}]%
\fi%
\end{minipage}%
}}
\newcommand{\myref}[1]{{\color{blue}(\autoref{#1})}\xspace}
\newcommand{\myreftwo}[1]{{\color{blue}(see~\autoref{#1})}\xspace}
\newcommand{\keyword}[1]{{\footnotesize\textbf{#1}}\xspace}
\newcommand{\argvsep}{\\[5pt]}
\newcommand{\arghsep}{\;\;}
\newcommand{\cmdvsep}{\\[5pt]}
\newcommand{\cmdhsep}{\;\;}
\newcommand{\cmddsep}{\par\medskip}
\newcommand{\optvsep}{\\[5pt]}
\newcommand{\opthsep}{\;\;}
\newcommand{\optdsep}{\par}
\newcommand{\sep}{\medskip}
\newcommand{\argname}[2][black]{{\color{#1}{$\langle$\textit{#2}$\rangle$}}}
\newcommand{\cmdname}[2][brown]{{\color{#1}{\textbf{\textbackslash#2}}}}
\newcommand{\optname}[2][brown]{{\color{#1}{\textbf{#2}}}}
\newcommand{\classname}{{\color{blue}{\textit{MyCV}}}\xspace}
\newcommand{\codeskip}{\medskip}
\newcommand{\DPL}{\keyword{DPL}}
\newcommand{\SPL}{\keyword{SPL}}
\newcommand{\CV}{\keyword{CV}}
\newcommand{\marg}[1]{%
\fbox{%
{\color{red}\textbf{\{}}$\langle$%
\textit{#1}%
$\rangle${\color{red}\textbf{\}}}}%
}
\newcommand{\dargone}[2]{%
\fbox{%
{\color{cyan}\textbf{[}}$\langle$%
\textit{#1}%
$\rangle${\color{cyan}\textbf{]}}%
}\;$\longrightarrow$\;{\color{blue}\textbf{[}\textit{#2}\textbf{]}}}
\newcommand{\dargtwo}[2]{%
\fbox{%
{\color{cyan}\textbf{<}}$\langle$%
\textit{#1}%
$\rangle${\color{cyan}\textbf{>}}%
}\;$\longrightarrow$\;{\color{blue}\textbf{<}\textit{#2}\textbf{>}}}
\newenvironment{myindent}[1][0.2in]%
{ \begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\partopsep}{0pt}%
\setlength{\parsep}{\parskip}}\item[]%
}
{\end{list}}
\newcommand{\ctext}[2][red]{{\color{#1}{#2}}}
\newcommand{\omissis}{[\dots\negthinspace]}
\definecolor{lightergray}{gray}{0.99}
\lstnewenvironment{latexcode}[1][]{%
\small
\lstset{language=[LaTeX]Tex,
keywordstyle=\color{RoyalBlue},
basicstyle=\normalfont\ttfamily,
commentstyle=\color{Emerald}\ttfamily,
stringstyle=\rmfamily,
numbers=none,
numberstyle=\scriptsize\color{gray},
stepnumber=1,
numbersep=8pt,
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
}
\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}
\ifparchment
\usepackage{framed}
\usetikzlibrary{decorations.pathmorphing,decorations.shapes,calc}
\pgfmathsetseed{1}
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\tikzset{
normal border/.style={lightgray!12,
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}}}
\def\parchmentframe#1{
\tikz{
\node[inner sep=2em] (A) {#1};
\begin{pgfonlayer}{background}
\fill[normal border]
(A.south east) -- (A.south west) --
(A.north west) -- (A.north east) -- cycle;
\end{pgfonlayer}}}
\def\parchmentframetop#1{
\tikz{
\node[inner sep=2em] (A) {#1};
\begin{pgfonlayer}{background}
\fill[normal border]
(A.south east) -- (A.south west) --
(A.north west) -- (A.north east) -- cycle;
\fill[torn border]
($(A.south east)-(0,.2)$) -- ($(A.south west)-(0,.2)$) --
($(A.south west)+(0,.2)$) -- ($(A.south east)+(0,.2)$) -- cycle;
\end{pgfonlayer}}}
\def\parchmentframebottom#1{
\tikz{
\node[inner sep=2em] (A) {#1};
\begin{pgfonlayer}{background}
\fill[normal border]
(A.south east) -- (A.south west) --
(A.north west) -- (A.north east) -- cycle;
\fill[torn border]
($(A.north east)-(0,.2)$) -- ($(A.north west)-(0,.2)$) --
($(A.north west)+(0,.2)$) -- ($(A.north east)+(0,.2)$) -- cycle;
\end{pgfonlayer}}}
\def\parchmentframemiddle#1{
\tikz{
\node[inner sep=2em] (A) {#1};
\begin{pgfonlayer}{background}
\fill[normal border]
(A.south east) -- (A.south west) --
(A.north west) -- (A.north east) -- cycle;
\fill[torn 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]
($(A.north east)-(0,.2)$) -- ($(A.north west)-(0,.2)$) --
($(A.north west)+(0,.2)$) -- ($(A.north east)+(0,.2)$) -- cycle;
\end{pgfonlayer}}}
\newenvironment{parchment}{%[1][Example]{%
\def\FrameCommand{\parchmentframe}%
\def\FirstFrameCommand{\parchmentframetop}%
\def\LastFrameCommand{\parchmentframebottom}%
\def\MidFrameCommand{\parchmentframemiddle}%
\vskip\baselineskip
\MakeFramed {\FrameRestore}}
{\endMakeFramed}
\fi
\begin{document}
\pagestyle{useheadings}
\pagestyle{plain}
\pagenumbering{roman}
\begin{titlepage}
\begin{center}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\def\versionMsg{This file has version number \version{} \texttt{---} %
documentation dated April 13, 2012 \texttt{---} %
last revised \today}
\textsc{\large\color{gray}\today}\\[0.5cm]
\HRule\\[0.4cm]%
{\huge\medskip\bfseries\myTitle\footnote{\versionMsg}}\\[0.4cm]%
\HRule\\[1.5cm]
\large\emph{Author:}\\
\href{mailto:\myMail}{\textsc{\myName}}
\vspace{20pt}
\includegraphics[width=0.30\textwidth]{Images/logo-1.png}\\[1cm]
\vspace{10pt}
\textbf{\textit{Abstract}}\normalsize\par\bigskip
\begin{minipage}{0.75\textwidth}
\noindent
This \LaTeX{} class provides a set of functionality for writing \textit{curriculum vit\ae{}}
with different layouts. To achieve this goal, it adopts a different approach with respect
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 \textit{TikZ} decorations is also provided.
\end{minipage}
\renewcommand{\thefootnote}{\arabic{footnote}}\setcounter{footnote}{0}
\end{center}
\end{titlepage}
\pagestyle{scrheadings}
\pdfbookmark{\contentsname}{tableofcontents}
\setcounter{tocdepth}{2}
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}
\chapter{Fundamentals}
\quotes[1973]{
``Computer programming is an art, because it applies
accumulated knowledge to the world, because it
requires skill and ingenuity, and especially because
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.
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.
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.
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 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, 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 file;
\end{myindent}
\item \ctext{mycv\_style.sty}
\begin{myindent}
it contains the default style commands~\myref{sub:style-commands} provided by the class: if
the default style is not used,
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} provided by the class: if
decorations are not enabled%
, this file will not be included by \textit{mycv.cls};
\end{myindent}
\item \ctext{mycv\_misc.def}\hspace{5pt}and\hspace{5pt}\ctext{mycv\_version.def}
\begin{myindent}
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}.
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:
\bigskip
\begin{myindent}
\textbf{headerlayoutlist},\hspace{5pt}\textbf{bodylayoutlist},\hspace{5pt}\textbf{footerlayoutlist}.
\end{myindent}
\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{latexcode}[numbers=none]
\def\headerlayoutlist{sub-component1,sub-component2,[...]}
\end{latexcode}
\subsection{Sub-components}
We previously said that \classname is based on three main components (\textit{header},
\textit{body} and \textit{footer}) and that each of these ones are represented by a list. A list
(therefore a main component), in turn, may have one or more sub-component, separated by
a comma, which are identified as follows:
\squishlist[0pt]
\item \texttt{\ctext{Main}[Header|Body|Footer]\ctext{PageBegin}};
\item \texttt{\ctext{Main}[Header|Body|Footer]\ctext{PageEnd}};
\item \texttt{\ctext[blue]{Sub}[Header|Body|Footer]\ctext[blue]{PageBegin}};
\item \texttt{\ctext[blue]{Sub}[Header|Body|Footer]\ctext[blue]{PageEnd}};
\item \texttt{\ctext[orange]{filename}} with the (partial) \CV contents.
\squishend\sep
Both ``\verb|Main[...]PageBegin|'' and ``\verb|Sub[...]PageBegin|'' are \textit{minipages}; the
difference is that the former have a default width of $100\%$ of the \textit{textwidth}
macro, while that value is $44\text{-}45\%$ for the latter (it depends on the components type).
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:\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
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
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:
\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>);
\item \ctext[blue]{*} (optional argument equivalent to *).
\squishend
\item /\optname{m[l\textbar r]}\verb|<value>|/\hfill\opthsep{\small($1$)}\optvsep
/\optname{endm[l\textbar r]}/\hfill\opthsep{\small($2$)}\optdsep
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):
\begin{myindent}
\texttt{%
\ctext[\tmpcolor]{%
SubBodyPageBegin:</ml0.2in/>\\
\omissis\\
SubBodyPageEnd:</endml>}%
}.
\end{myindent}
\item \verb|<width-value>|\optdsep
sets the width of a sub-component in terms of \textit{textwidth} percentage.
This option only exists for ``\verb|*PageBegin|`` sub-components. Example:
\ctext[\tmpcolor]{\texttt{SubBodyPageBegin:<0.48>}}.
\item /\optname{pagesize}\verb|<value>|/\optdsep
sets the width of a sub-component, as the option above, but in terms of absolute reference
(instead of \textit{textwidth} percentage). Also this option only exists for
``\verb|*PageBegin|`` sub-components. Example:
\ctext[\tmpcolor]{\texttt{SubBodyPageBegin:/pagesize5.5in/}}.
\item /\optname{pagebreak}/\optdsep
permits to break two contiguous sub-components, aligning them one above the other, instead
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{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 there are ``\_'' and ``-'').
Example: \ctext[\tmpcolor]{\texttt{*headerfile}}, where the macro \textit{headerfile}
is somewhere defined.
\squishend
\ifparchment\end{parchment}\fi
\chapter{Usage}
\quotes{%
“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
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 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{latexcode}
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
\begin{latexcode}[numbers=none]
\RequirePackage{xparse} % for commands with multiple default arguments
\RequirePackage{pifont} % for the 'ding' style (itemize environment)
\RequirePackage{titlesec} % for title format and spacing
\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{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}, \textit{xparse} and \textit{xstring}):\codeskip
\begin{latexcode}[firstnumber=1,numbers=none]
\RequirePackage{tikz} % for graphics
\end{latexcode}
\section{Class options}
\label{sec:class-options}
\classname can use any option supported by the \textit{article} class, on which is based. In
addiction, it provides the following options:
\def\tmpcolor{brown}
\squishlist
\item {\color{red}language=<\argname[\tmpcolor]{string}>}
\begin{myindent}
string language to pass to the \textit{babel} package for the document (\CV) language;
\end{myindent}
\item {\color{red}cntdir=<\argname[\tmpcolor]{dirname}>}
\begin{myindent}
sets the directory name where \classname will search for files with the \CV contents.\\
The default one is ``Contents'';
\end{myindent}
\item {\color{red}style=<\argname[\tmpcolor]{filemane}>}
\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 style file by specifying the value ``none'' as file name;
\end{myindent}
\item {\color{red}mdlname=<\argname[\tmpcolor]{name}>}
\begin{myindent}
registers a name for the layout (model) intended to be used: in this way is possible, for
example, to select the appropriate layout configuration file or a layout-specific portion of
code;
\end{myindent}
\item {\color{red}withDec}
\begin{myindent}
enables support for decorations (provided by the \textit{TikZ} package).
\end{myindent}
\squishend
\section{Class commands}
Here follows the complete list of the commands provided by \classname. The style commands
are only available if the class option ``\textit{style}'' was used;
the same goes for the decoration commands,
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}
\squishlist
\item \cmdname{ifoption}
\marg{option}\arghsep
\marg{true}\arghsep\marg{false}\argvsep
\cmdname{ifmodel}
\marg{mdlname}\arghsep
\marg{true}\arghsep\marg{false}\cmddsep
\textit{ifoption} checks whether \argname{option} was used,
while \textit{ifmodel} checks whether \argname{mdlname} was registered in the class; then both
commands use the appropriate \argname{true} or \argname{false} block of code.
\squishend
\subsection{Default style}
\label{sub:style-commands}
\squishlist
\item \cmdname{mysectionTitleFormat}
\begin{myindent}
\dargone{titlerule-color-above}{myheadingscolor}\argvsep
\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 the one below. \textit{myheadingscolor} is the default
color.
\item \cmdname{mysectionTitleSpacing}
\begin{myindent}
\dargone{left}{$0\text{pt}$}\arghsep
\dargone{beforesep}{$0\text{pt}$}\arghsep
\dargone{aftersep}{$5\text{pt}$}
\end{myindent}\cmddsep
this command is just an alias for
\textit{\textbackslash{titlespacing}\{\textbackslash{section}\}\{\argname{left}\}%
\{\argname{beforesep}\}\{\argname{aftersep}\}}. See the \textit{titlesec} package for further
information.
\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 update of the document.
\item \cmdname{myitemize}
\cmddsep
a list environment that uses the \textit{ding} style.
\squishend
\subsection{Decorations}
\label{sub:decoration-commands}
\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 it is enough for this class purposes. The only \textit{TikZ} path supported is
\textit{rectangle}.
\squishlist
\item \cmdname{mydecorationsPathmorphing}[*]
\begin{myindent}
\dargone{show-decoration}{$1$}\argvsep
\marg{decoration-type}\argvsep
\dargone{decoration-color}{gray}\argvsep
\dargtwo{shading-type}{radial}\argvsep
\dargtwo{background-color}{white}%
\end{myindent}\cmddsep
\argname{show-decoration}, if equals $1$, shows the decoration \argname{decoration-type},
while if $0$ does not.
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
``Koch snowflake``.\\
\argname{shading-type} was tested with ``radial'' and ``ball'' shadings.
\item \cmdname{mydecorationsShape}
\begin{myindent}
\dargone{show-decoration}{$1$}\arghsep
\marg{decoration-type}\arghsep
\dargone{decoration-color}{gray}
\end{myindent}\cmddsep
\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}
\dargone{path-fading}{north}\argvsep
\marg{primary-color}\argvsep
\dargone{color-gradient}{$80$}\argvsep
\dargone{secondary-color}{black}\argvsep
\dargtwo{opacity}{$1.0$}%
\end{myindent}\cmddsep
the resulting fill color is given by \argname{primary-color}, \argname{color-gradient}
and \argname{secondary-color}, which are composed as follows:
\argname{primary-color}!\argname{color-gradient}!\argname{secondary-color}.
\item \cmdname{mydecorationsSetPos[XTL|YTL|XBR|YBR]}
\begin{myindent}
\dargone{coordinate-value}{$1\text{cm}\mid-1\text{cm}\mid-1\text{cm}\mid1\text{cm}$}
\end{myindent}\cmddsep
sets the position for the decoration in use. Since the decoration path is \textit{rectangle}, it
is sufficient to have the $(x,y)$ coordinates of two points: the top-left and bottom-right.
\textit{XTL} stands for ``\texttt{X-Top-Left}'', \textit{XBR} for ``\texttt{X-Bottom-Right}''
and so on.
\item
\cmdname{mydecorationsSetLineWidth}[*]
\dargone{line-width}{tikz value}\cmdvsep
\cmdname{mydecorationsSetSegmentAmplitude}[*]
\dargone{segment-amplitude}{tikz value}\cmdvsep
\cmdname{mydecorationsSetSegmentLength}[*]
\dargone{segment-length}{tikz value}\cmddsep
these commands may respectively be used for modifying the properties \argname{line-width},
\argname{segment-amplitude} and \argname{segment-length} for the decoration in use.
\textit{Starred} versions do not require any argument and reinitialize the properties to their
default values.
\squishend
\subsection{Miscellaneous}
\squishlist
\item
\cmdname{mypdfauthor}
\marg{author}\cmdvsep
\cmdname{mypdftitle}
\marg{title}\cmdvsep
\cmdname{mypdfsubject}
\marg{subject}\cmddsep
these commands do nothing but register \argname{author}, \argname{title} and \argname{subject}
information in the document properties of the pdf is being produced.
\item \cmdname{mylang}
\marg{text}\arghsep
\dargone{language}{english}\cmddsep
temporarily changes the language in use (\textit{babel} package) to \argname{language} for
\argname{text}.
\item \cmdname{mychangemargin}
\marg{left-margin}\arghsep
\marg{right-margin}\cmddsep
\textit{mychangemargin} environment changes the left and right margin of a portion of
text. The environments \textit{mychangemarginLeft} and \textit{mychangemarginRight}, whose
meaning is straight forward, are also available.
\item \cmdname{myrenderlayout}
\dargone{component}{a}\cmddsep
processes and draws the layout component(s). The option value ``h'' is for the header component,
``b'' and ``f'', respectively, for the body and footer ones, while ``a'' is for all components.
\squishend
\section{Some examples}
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).
The sample code presented here can be found in the ``Examples'' directory shipped with the
\textit{mycv} bundle, which this document is part of, and that also contains files with the \CV
contents: these files are not listed in the present document, as they do not contain anything worth
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 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 file (1)
$header_title@$,
|SubHeaderPageEnd|:<postcmd:hfill>,
% --------------------------------- right header
|SubHeaderPageBegin|,
% header file (2)
$header_contacts@$,
|SubHeaderPageEnd|,
&MainHeaderPageEnd&%
}
% ----------------------
% 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}.
\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)
% ---------------------------------------------------------
&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{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>,
$contents_partC@$:<precmd:vspace=10pt:sectionnumber=3>,
$contents_partA@$:<precmd:vspace=10pt:sectionnumber=4>,
$contents_partB@$:<precmd:vspace=10pt:sectionnumber=5>
% ---------------------------------------------------
}
\end{latexcode}
\subsection{Main file}
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
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 current directory (that is not the default one
where the class searches for the contents files), so there is need to specify its path with
the option ``\textit{cntdir}''.
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{latexcode}[firstnumber=1,label=lst:mycv-example-main,caption=mycv-example-main.tex]
\documentclass[10pt,mdlname=verDPL,withDec,cntdir=.,language=english]{mycv}
\input{mycv-example-common}
\begin{document}
\cvdec\myrenderlayout\mycfoot{Last update: \today}
\end{document}
\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}.
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}{}}
% include layouts components
\input{model-layouts}
[...]
\end{latexcode}
\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 page layout, since \LaTeX{} would automatically
break the section contents. Unfortunately, with a double page layout the behavior is substantially
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
page margins.
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{latexcode}[firstnumber=1,label=lst:split-contents-example,
caption=workaround example]
% ---------------------------------------------------------
% file with the section contents: i.e. <section_skills.tex>
% ---------------------------------------------------------
% increases the counter 'cnt': it's defined outside this file
\stepcounter{cnt}
% selects the appropriate part of the file contents
\newcommand{\condblock}[2]{\ifthenelse{\value{cnt}<2}{#1}{#2}}
\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
$section_skills@$,
[...]
|SubBodyPageEnd|,
|SubBodyPageBegin|:<0.48>, % right page
% include part B in the right page
$section_skills@$,
[...]
|SubBodyPageEnd|
}
\end{latexcode}
Of course the proposed workaround is not the best we could wish for, since it requires manual
operations.
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}.
\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=6>:<postcmd:mcend>,%
}
\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.
\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)
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=Split contents example,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}
\bigskip
\fbox{That's all, {\color{brown}happy \LaTeX{}ing!}}
\hfill\Large\calligra{AndreaGhersi}
\ifparchment\end{parchment}\fi
\end{document}
|