From: adin Date: Wed, 5 Jul 2017 13:10:45 +0000 (-0300) Subject: Refactoring to support extension to style based no biblatex styles X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=8870b2b570ef35fd69ebde140639a53a20b871f3;p=mcv-academic Refactoring to support extension to style based no biblatex styles --- diff --git a/academic.sty b/academic.sty new file mode 100644 index 0000000..8194394 --- /dev/null +++ b/academic.sty @@ -0,0 +1,410 @@ +%% start of file `academic.sty'. + + +%------------------------------------------------------------------------------- +% identification +%------------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{academic}[2017/07/01 v1 modern curriculum vitae and letter style scheme: academic] + +%------------------------------------------------------------------------------- +% Definitions +%------------------------------------------------------------------------------- + +%switches for information +\newif\ifdetails\detailsfalse +\newif\if@citeall + +%------------------------------------------------------------------------------- +% Options +%------------------------------------------------------------------------------- +\RequirePackage{pgfkeys} +\RequirePackage{pgfopts} + +% Package options +\def\unknown@packageoptions{} +\def\@load@style{} + +\pgfkeys{% + /academic/.cd, + citeall/.is if={@citeall}, + citeall/.default=true, + % + details/.is if={details}, + details/.default=true, + % + style/.store in=\@load@style, + style/.default=academic, + % + % unknown keys are assumed to be options to be passed to the amc package + .unknown/.code={\edef\unknown@packageoptions{\unknown@packageoptions,\pgfkeyscurrentname=#1}}, +} + +% defaults +\pgfkeys{% + /academic/.cd, + % put defaults here + citeall, + details = false, +} + +% process options key-value +\ProcessPgfPackageOptions{/academic} +\ifdefempty{\unknown@packageoptions}% + {}% + {\PackageWarning{academic}{Unknown options: '\unknown@packageoptions'}} + + +%https://tex.stackexchange.com/a/131413/7561 +\newcommand*\csnewcommand{\@star@or@long\csnew@command} +\newcommand*\csnew@command[1]{\expandafter\new@command\csname#1\endcsname} +\newcommand*\recsnewcommand{\@star@or@long\recsnew@command} +\newcommand*\recsnew@command[1]{\expandafter\renew@command\csname#1\endcsname} + +%------------------------------------------------------------------------------- +% Load style +%------------------------------------------------------------------------------- + +% We need to load before patching the definitions +\ifdefempty{\@load@style}{\PackageWarning{academic}{No style to load}}{ + \moderncvstyle{\@load@style} +} + + +%------------------------------------------------------------------------------- +% Multilanguage support +%------------------------------------------------------------------------------- + +% http://tex.stackexchange.com/a/42791/7561 +\newcommand{\newlcommand}[1]{% + \newcommand#1{% + \@ifundefined{\string#1\languagename} + {``No def of \texttt{\string#1} for \languagename''} + {\@nameuse{\string#1\languagename}}% + }% +} +\newcommand{\addtolanguagecommand}[3]{% + \@namedef{\string#1#2}{#3}} + +\pgfkeys{ + /mlcommands/.is family, /mlcommands, + command/.code={\def\langcmd{#1}}, + .unknown/.code = {% + \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\addtolanguagecommand\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter + {\expandafter\expandafter\expandafter\langcmd\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter{\expandafter\pgfkeyscurrentname\expandafter}\expandafter + {#1} + }% +} + +\newcommand{\newmlcommand}[2][]{% + \newlcommand#2% + \pgfkeys{/mlcommands, command=#2, #1}% +} + +% How to use +%\newlanguagecommand{\uno} +%\addtolanguagecommand{\uno}{english}{one} +%\addtolanguagecommand{\uno}{french}{une} +% or +% \newmlcommand[english=one, french=une]{\uno} + +% Create long names for languages, this reuses the code from cv.bbx +% fixme: merge both definitions (here and cv.bbx) +\pgfkeys{ + /shortlan/.is family, /shortlan, + .unknown/.code = { + \expandafter\edef\csname @cv@short@#1\endcsname{\pgfkeyscurrentname} + \expandafter\expandafter\expandafter\edef\expandafter\csname @cv@long@\pgfkeyscurrentname\endcsname{#1} + } +} +%\pgfkeys{ +% /shortlan/.is family, /shortlan, +% .unknown/.code = { +% \expandafter\edef\csname @cv@short@#1\endcsname{\pgfkeyscurrentname} +% } +%} +% handler to create the keys +\def\babelshortnames#1{\pgfkeys{/shortlan, #1}} +% directly obtain the short name +\newcommand{\shortlanguagename}{\csname @cv@short@\languagename\endcsname} +\newcommand{\longlanguagename}[1]{\csname @cv@long@#1\endcsname} + +% declare default languages +% \babelshortnames{en=english, es=spanish} +% or imported to be in sync with cv.bbx +\input{setlanguages.sty} + +% use a select language with short name instead of default long one +\newcommand{\selectshortlanguage}[1]{% + \edef\mylang{\longlanguagename{#1}}% + \expandafter\selectlanguage\expandafter{\mylang}% +} + +%------------------------------------------------------------------------------- +% Academic drivers and sorting to use with this style +%------------------------------------------------------------------------------- + +%\RequirePackage[tools={study, position, course, thesis, project, cvmisc}, bibstyle=numeric-comp]{biblatex-multiple-dm} +%\RequirePackage[tools={cv, numeric-comp}, bibstyle=numeric-comp]{biblatex-multiple-dm} + +% bibliography with mutiple entries + +% If there is no custom datamodel, load defaul cv.dbx +\IfFileExists{cv-\@load@style.dbx}% + {\def\@load@datamodel{cv-\@load@style}}% + {\def\@load@datamodel{cv}} + +\IfFileExists{cv-\@load@style.bbx}% +{\def\@load@bibstyle{cv-\@load@style}}% +{% + \def\@load@bibstyle{cv}% + \PackageWarning{academic}{The bibstyle 'cv-\@load@style.bbx' wasn't found. I'm loading the default 'cv.bbx' instead.}% +} + + +\RequirePackage[backend=biber, citestyle=numeric-comp, bibstyle=\@load@bibstyle, datamodel=\@load@datamodel, sorting=ymdtn, maxbibnames=99, defernumbers=true, giveninits=true, sortcites]{biblatex} + +% Patch endyears that are not declared +% http://tex.stackexchange.com/a/327884/7561 +\DeclareSourcemap{ + \maps[datatype=bibtex]{ + \map{ + \pertype{study} + \pertype{position} + \pertype{project} + \pertype{course} + \pertype{thesis} + \pertype{committee} + \pertype{cvmisc} + \step[fieldsource=date, match=\regexp{\A([0-9]{4}-[0-9]{2}-[0-9]{2})\Z}, replace=\regexp{$1/$1}] + \step[fieldsource=date, match=\regexp{\A([0-9]{4}-[0-9]{2})\Z}, replace=\regexp{$1/$1}] + \step[fieldsource=date, match=\regexp{\A([0-9]{4})\Z}, replace=\regexp{$1/$1}] + } + } +} + +% Custom sort to include month and endyear +\DeclareSortingScheme{ymdtn}{ + \sort{ + \field{presort} + } + \sort[final]{ + \field{sortkey} + } + \sort[direction=descending]{ + \field{sortyear} + \field{endyear} + \literal{9999} + } + \sort[direction=descending]{ + \field{sortyear} + % \field{endyear} + \field{year} + \literal{9999} + } + \sort[direction=descending]{ + \field[padside=left,padwidth=2,padchar=0]{month} + \literal{99} + } + \sort[direction=descending]{ + \field[padside=left,padwidth=2,padchar=0]{day} + \literal{99} + } + \sort{ + \field{sorttitle} + } + \sort[direction=descending]{ + \field[padside=left,padwidth=4,padchar=0]{volume} + \literal{9999} + } + \sort{ + \field{sortname} + \field{author} + \field{editor} + \field{translator} + \field{sorttitle} + \field{title} + } +} + +% patch for bold name in bibliography +\def\makenamesetup{% + \def\bibnamedelima{~}% + \def\bibnamedelimb{ }% + \def\bibnamedelimc{ }% + \def\bibnamedelimd{ }% + \def\bibnamedelimi{ }% + \def\bibinitperiod{.}% + \def\bibinitdelim{~}% + \def\bibinithyphendelim{.-}} +\newcommand*{\makename}[2]{\begingroup\makenamesetup\xdef#1{#2}\endgroup} + +\renewcommand{\mkbibnamegiven}[1]{% + \ifboolexpr{ ( test {\ifdefequal{\bld@firstname}{\namepartgiven}} or test {\ifdefequal{\bld@firstinit}{\namepartgiven}} ) and test {\ifdefequal{\bld@lastname}{\namepartfamily}} } + {\mkbibbold{#1}}{#1}% +} + +\renewcommand{\mkbibnamefamily}[1]{% + \ifboolexpr{ ( test {\ifdefequal{\bld@firstname}{\namepartgiven}} or test {\ifdefequal{\bld@firstinit}{\namepartgiven}} ) and test {\ifdefequal{\bld@lastname}{\namepartfamily}} } + {\mkbibbold{#1}}{#1}% +} + + +\newcommand*{\boldname}[3]{% + \def\bld@lastname{#1}% + \def\bld@firstname{#2}% + \def\bld@firstinit{#3}} + +\boldname{}{}{} + +% We need to tell biblatex to check for all entries +\if@citeall +\nocite{*} +\fi + + +%% Patch the bibliography +% +%% lets remove the brackets +%\DeclareFieldFormat{labelnumberwidth}{#1.} +% +%% http://tex.stackexchange.com/a/123809/7561 +%\defbibenvironment{bibliography}{ +%\list +% {\printtext[labelnumberwidth]{% label format from numeric.bbx +% \printfield{labelprefix}% +% \printfield{labelnumber}}} +% { +% \ifthenelse{\equal{\@load@style}{banking}}{% +% \setlength{\topsep}{0pt}% +%% \setlength{\leftmargin}{2em}% +% \setlength{\labelwidth}{1.5em}% +% \setlength{\labelsep}{\separatorcolumnwidth}% +%% \setlength{\itemindent}{0em}% +% \leftmargin\labelwidth% +% \advance\leftmargin\labelsep% +% }{ +% \setlength{\topsep}{0pt}% +% \setlength{\labelwidth}{\hintscolumnwidth}% +% \setlength{\labelsep}{\separatorcolumnwidth}% +% \leftmargin\labelwidth% +% \advance\leftmargin\labelsep% +% }% +%% \setlength{\topsep}{0pt}% layout parameters from moderncvstyleclassic.sty +%% \setlength{\labelwidth}{\hintscolumnwidth}% +%% \setlength{\labelsep}{\separatorcolumnwidth}% +%% \leftmargin\labelwidth% +%% \advance\leftmargin10pt% +%% \advance\leftmargin\labelsep +% }% +% \sloppy\clubpenalty4000\widowpenalty4000} +%{\endlist} +%{\item} +% +%% New environment withouth the list indent +%\defbibenvironment{nobibenv}{% +% \list{}{% +% \ifboolexpr{ (test{\ifdefstring{\@load@style}{classic}} or test{\ifdefstring{\@load@style}{casual}}) }{% +% \setlength{\topsep}{0pt}% +% \setlength{\labelwidth}{\hintscolumnwidth}% +% \setlength{\labelsep}{\separatorcolumnwidth}% +% \setlength{\leftmargin}{0pt}% +% }{% +% \ifthenelse{\equal{\@load@style}{oldstyle}}{% +% \setlength{\topsep}{0pt}% +% \setlength{\labelwidth}{\hintscolumnwidth}% +% \setlength{\labelsep}{\separatorcolumnwidth}% +% \leftmargin\labelwidth% +% \advance\leftmargin\labelsep% +% }{% +% \ifthenelse{\equal{\@load@style}{banking}}{% +% \setlength{\topsep}{0pt}% +% \setlength{\labelwidth}{0pt}% +% \setlength{\labelsep}{0pt}% +% \setlength{\leftmargin}{0pt}% +% }{ +% \setlength{\topsep}{0pt}% +% \setlength{\labelwidth}{\hintscolumnwidth}% +% \setlength{\labelsep}{\separatorcolumnwidth}% +% \setlength{\leftmargin}{0pt}% +% }% +% }% +% }% +% \setlength{\parsep}{0pt}% +% }% +%}% +%{\endlist} +%{\item} + +%------------------------------------------------------------------------------- +% Factory for the printbibliography replacements +%------------------------------------------------------------------------------- + +\newcommand{\defprint}[3][env=nobibenv]{% + \csdef{print#3}[##1]{% + \letcs\refname{\abx@str @#3}% + \letcs\bibname{\abx@str @#3}% + \printbibliography[#1, type=#2, ##1]% + \letcs\refname{\abx@str @references}% + \letcs\bibname{\abx@str @bibliography} + }% +} + +\defprint{course}{courses} +\defprint{study}{studies} +\defprint{position}{positions} +\defprint{thesis}{theses} +\defprint[resetnumbers=true]{project}{projects} +\defprint{cvmisc}{cvmiscs} + +%------------------------------------------------------------------------------- +% Patching moderncv +%------------------------------------------------------------------------------- + +%\RequirePackage{xpatch} +%% Patch blank printing +%\newcommand{\ifnoprint}[3]{% +% \setbox0=\hbox{#1\unskip}\ifdim\wd0=0pt% +% #2\else#3\fi% +%} + +% Patch cventry for better blank support +%\xpatchcmd{\cventry}% +%{\ifthenelse{\equal{#4}{}}}% +%{\ifnoprint{#4}}% +%{}{\PackageWarning{academic}{Error patching \noexpand\cventry}}% +% +%\xpatchcmd{\cventry}% +%{\ifthenelse{\equal{#5}{}}}% +%{\ifnoprint{#5}}% +%{}{\PackageWarning{academic}{Error patching \noexpand\cventry}}% +% +%\xpatchcmd{\cventry}% +%{\ifthenelse{\equal{#6}{}}}% +%{\ifnoprint{#6}}% +%{}{\PackageWarning{academic}{Error patching \noexpand\cventry}}% +% +%% Patch the comments on the entries to avoid spurious white space +%\xpatchcmd{\cventry}% +%{\ifx}% +%{\ifdetails\ifx}% +%{}{\PackageWarning{academic}{Error patching \noexpand\cventry}}% +% +%\xpatchcmd{\cventry}% +%{\fi}% +%{\fi\fi}% +%{}{\PackageWarning{academic}{Error patching \noexpand\cventry}}% + +% Patch socials +\RenewDocumentCommand{\social}{O{}O{}m}{% + \ifthenelse{\equal{#2}{}}% + {% + \ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httplink[#3]{www.linkedin.com/in/#3}}}{}% + \ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httplink[#3]{www.twitter.com/#3}}} {}% + \ifthenelse{\equal{#1}{github}} {\collectionadd[github]{socials} {\protect\httplink[#3]{www.github.com/#3}}} {}% + \ifthenelse{\equal{#1}{scholar}} {\collectionadd[scholar]{socials} {\protect\httplink[Google Scholar]{http://scholar.google.com/citations?user=#3}}} {}% + } + {\collectionadd[#1]{socials}{\protect\httplink[#3]{#2}}}} + +\endinput \ No newline at end of file diff --git a/cv-academic.bbx b/cv-academic.bbx new file mode 100644 index 0000000..49fee7a --- /dev/null +++ b/cv-academic.bbx @@ -0,0 +1,5 @@ +\ProvidesFile{cv-academic.bbx} + +\RequireBibliographyStyle{cv} + +\endinput \ No newline at end of file diff --git a/cv-banking.bbx b/cv-banking.bbx new file mode 100644 index 0000000..8913d82 --- /dev/null +++ b/cv-banking.bbx @@ -0,0 +1,98 @@ +\ProvidesFile{cv-banking.bbx} + +\RequireBibliographyStyle{cv} + +%------------------------------------------------------------------------------- +% MCV Macros +%------------------------------------------------------------------------------- + +\renewcommand*{\cventry}[7][.25em]{% + \begin{tabular*}{\maincolumnwidth}{p{0.8\maincolumnwidth}@{\extracolsep{\fill}}r}% + #4 & #5\\% + {\begin{minipage}[t]{\linewidth}#3\end{minipage}} & #2\\% + \end{tabular*}% + #7% + \par\addvspace{#1}} + +\renewcommand*{\cvitem}[3][.25em]{% + \begin{tabular*}{\maincolumnwidth}{p{0.8\maincolumnwidth}@{\extracolsep{\fill}}r}% + {\begin{minipage}[t]{\linewidth}#3\end{minipage}} & {#2}\\% + \end{tabular*}% + \par\addvspace{#1}} + +%------------------------------------------------------------------------------- +% Drivers +%------------------------------------------------------------------------------- + +\DeclareBibliographyDriver{cventry}{% + \usebibmacro{begentry}% + \usebibmacro{cventry}% + {\usebibmacro{range-date}}% + {% + \ifnameundef{author}{}{\usebibmacro{author}\newunitpunct}% + \printmlfield{title}% + \newunitpunct + \ifmlfieldundef{level}{}{\usebibmacro{level}\newunitpunct}% + \usebibmacro{note}% + }% + {\printmlfield{organization}}% + {\printmlfield{country}}% + {}% + {\usebibmacro{description}} + \usebibmacro{cvfinentry}% +} + +\DeclareBibliographyDriver{cvmisc}{% + \usebibmacro{begentry}% + \usebibmacro{cvitem}% + {\usebibmacro{range-date}}% + {% + \ifnameundef{author}{}{\usebibmacro{author}\newunit}% + \printmlfield{title}% + \newunitpunct% + \printmlfield{organization}% + \setunit*{\addcomma\space}% + \printmlfield{country} + \newunit% + \ifmlfieldundef{level}{}{\usebibmacro{level}\newunit}% + \usebibmacro{note}% + \phantom{\printtext{)}} + } + \usebibmacro{cvfinentry}% +} + +%------------------------------------------------------------------------------- +% Patch the bibliography +%------------------------------------------------------------------------------- + +\defbibenvironment{bibliography}{ +\list + {\printtext[labelnumberwidth]{% label format from numeric.bbx + \printfield{labelprefix}% + \printfield{labelnumber}}} + {% + \setlength{\topsep}{0pt}% + \setlength{\labelwidth}{1.5em}% + \setlength{\labelsep}{\separatorcolumnwidth}% + \leftmargin\labelwidth% + \advance\leftmargin\labelsep% + }% + \sloppy\clubpenalty4000\widowpenalty4000} +{\endlist} +{\item} + +% New environment withouth the list indent +\defbibenvironment{nobibenv}{% + \list{}{% + \setlength{\topsep}{0pt}% + \setlength{\labelwidth}{0pt}% + \setlength{\labelsep}{0pt}% + \setlength{\leftmargin}{0pt}% + \setlength{\parsep}{0pt}% + }% +}% +{\endlist} +{\item} + + +\endinput \ No newline at end of file diff --git a/cv-casual.bbx b/cv-casual.bbx new file mode 100644 index 0000000..9bb2532 --- /dev/null +++ b/cv-casual.bbx @@ -0,0 +1,5 @@ +\ProvidesFile{cv-casual.bbx} + +\RequireBibliographyStyle{cv} + +\endinput \ No newline at end of file diff --git a/cv-classic.bbx b/cv-classic.bbx new file mode 100644 index 0000000..cc53e8e --- /dev/null +++ b/cv-classic.bbx @@ -0,0 +1,5 @@ +\ProvidesFile{cv-classic.bbx} + +\RequireBibliographyStyle{cv} + +\endinput \ No newline at end of file diff --git a/cv-fancy.bbx b/cv-fancy.bbx new file mode 100644 index 0000000..cb94f07 --- /dev/null +++ b/cv-fancy.bbx @@ -0,0 +1,129 @@ +\ProvidesFile{cv-fancy.bbx} + +\RequireBibliographyStyle{cv} + +%------------------------------------------------------------------------------- +% MCV Macros +%------------------------------------------------------------------------------- +\RenewDocumentCommand{\section}{sm}{% + \addvspace{2.5ex}% + \phantomsection{}% reset the anchor for hyperrefs + \addcontentsline{toc}{section}{#2}% + \noindent\rlap{\@cvitem{\raggedleft\sectionstyle{#2}}{}}% + \nobreak\global\@afterheading\global\@aftersectiontrue\ignorespaces\vspace{-1pt}} + +\RenewDocumentCommand{\subsection}{sm}{% + \if@aftersection% + \par\ignorespaces\else\vspace{5pt}\fi% + \phantomsection{}% reset the anchor for hyperrefs + \addcontentsline{toc}{subsection}{#2}% + \noindent\rlap{\@cvitem{\if@aftersection\else\@moderncvstrut{4pt}{24pt}\fi\raggedleft\subsectionstyle{#2}}{}}% + \nobreak\global\@afterheading\global\@aftersectiontrue\ignorespaces\vspace{-6pt}} + + +\setlength{\cvitemskip}{.5ex} +\renewcommand*{\cventry}[7][\cvitemskip]{% + \savebox{\cventryyearbox}{\hspace*{2\separatorcolumnwidth}#2}% + \setlength{\cventrytitleboxwidth}{\widthof{\usebox{\cventryyearbox}}}% + \setlength{\cventrytitleboxwidth}{\maincolumnwidth-\cventrytitleboxwidth}% + \cvitem[#1]{}{% + \parbox[t]{\cventrytitleboxwidth}{% + #3 #7% + }% + \usebox{\cventryyearbox}}% +} + +% underlying command to implement \cvitem, \subsection and \section +\renewcommand*{\@cvitem}[3][\cvitemskip]{% + \arrayrulecolor{color1}% + \if@aftersection% + \else% + \vspace{-6pt}% + \fi% + \begin{tabular}[t]{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}|@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}% + #2 \vspace{5pt}\\% the spacing needs to be inside the cell for the vertical rule to extend correctly + \end{tabular}% + \if@aftersection% + \vspace{-6pt}% + \fi% + \global\@aftersectionfalse} + +%------------------------------------------------------------------------------- +% Drivers +%------------------------------------------------------------------------------- + +\DeclareBibliographyDriver{cventry}{% + \usebibmacro{begentry}% + \usebibmacro{cventry}% + {\usebibmacro{range-date}}% + {% + \ifnameundef{author}{}{\usebibmacro{author}\newunit}% + \printmlfield{title}% + \newunitpunct% + \printmlfield{organization}% + \iffieldundef{country} + {} + {\setunit*{\addcomma\space}\printmlfield{country}}% + \newunitpunct% + \ifmlfieldundef{level}{}{\usebibmacro{level}\newunitpunct}% + \usebibmacro{note}% + }% + {}% + {}% + {}% + {\usebibmacro{description}}% + \usebibmacro{cvfinentry}% +} + +%------------------------------------------------------------------------------- +% Patch the bibliography +%------------------------------------------------------------------------------- +\defbibenvironment{bibliography}{% +% \bibliographyhead{\refname}% + % \small% + \arrayrulecolor{color1}% + \setlength\arrayrulewidth{\separatorrulewidth}% + \noindent% + \begin{tabular}[t]{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}|@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}% + &% + \list{% + \printtext[labelnumberwidth]{% label format from numeric.bbx + \printfield{labelprefix}% + \printfield{labelnumber}}% + }{% + \setlength{\topsep}{0pt}% + \setlength{\labelwidth}{1.5em}% + \setlength{\labelsep}{.5em}% + \leftmargin\labelwidth% + \advance\leftmargin\labelsep% + }% + \sloppy% + \clubpenalty4000%\@clubpenalty \clubpenalty% + \widowpenalty4000% +}% +{% + \endlist% + \\%[.5ex]% + \end{tabular}% +% \par\@aftersectionfalse\ignorespaces% +}% +{\item} + +% New environment withouth the list indent +\defbibenvironment{nobibenv}{% + \list{}{% + \setlength{\topsep}{0pt}% + \setlength{\labelwidth}{0pt}% + \setlength{\labelsep}{0pt}% + \setlength{\leftmargin}{0pt}% + \setlength{\parsep}{0pt}% + \setlength{\parskip}{0pt}% + \sloppy% + \clubpenalty4000%\@clubpenalty \clubpenalty% + \widowpenalty4000% + }% +}% +{\endlist} +{\item} + +\endinput \ No newline at end of file diff --git a/cv-friggeri.bbx b/cv-friggeri.bbx new file mode 100644 index 0000000..20677c8 --- /dev/null +++ b/cv-friggeri.bbx @@ -0,0 +1,5 @@ +\ProvidesFile{cv-friggeri.bbx} + +\RequireBibliographyStyle{cv-oldstyle} + +\endinput \ No newline at end of file diff --git a/cv-oldstyle.bbx b/cv-oldstyle.bbx new file mode 100644 index 0000000..92fe8b1 --- /dev/null +++ b/cv-oldstyle.bbx @@ -0,0 +1,69 @@ +\ProvidesFile{cv-oldstyle.bbx} + +\RequireBibliographyStyle{cv} + +%------------------------------------------------------------------------------- +% MCV Macros +%------------------------------------------------------------------------------- +\renewcommand*{\cventry}[7][.25em]{% + \savebox{\cventryyearbox}{% + \hspace*{2\separatorcolumnwidth}% + #2}% + \setlength{\cventrytitleboxwidth}{\widthof{\usebox{\cventryyearbox}}}% + \setlength{\cventrytitleboxwidth}{\maincolumnwidth-\cventrytitleboxwidth}% + \begin{minipage}[t]{\maincolumnwidth}% + \parbox[t]{\cventrytitleboxwidth}{% + #3% + }% + \usebox{\cventryyearbox}% + \end{minipage}\strut% + #7% + \par\addvspace{#1}} + +%------------------------------------------------------------------------------- +% Drivers +%------------------------------------------------------------------------------- + +\DeclareBibliographyDriver{cventry}{% + \usebibmacro{begentry}% + \usebibmacro{cventry}% + {\usebibmacro{range-date}}% + {% + \ifnameundef{author}{}{\usebibmacro{author}\newunit}% + \printmlfield{title}% + \newunitpunct% + \printmlfield{organization}% + \iffieldundef{country} + {} + {\setunit*{\addcomma\space}\printmlfield{country}}% + \newunitpunct% + \ifmlfieldundef{level}{}{\usebibmacro{level}\newunitpunct}% + \usebibmacro{note}% +% \setunit{}\printtext{}% + }% + {}% + {}% + {}% + {\usebibmacro{description}} + \usebibmacro{cvfinentry}% +} + +%------------------------------------------------------------------------------- +% Patch the bibliography +%------------------------------------------------------------------------------- + +% New environment withouth the list indent +\defbibenvironment{nobibenv}{% + \list{}{% + \setlength{\topsep}{0pt}% + \setlength{\labelwidth}{\hintscolumnwidth}% + \setlength{\labelsep}{\separatorcolumnwidth}% + \leftmargin\labelwidth% + \advance\leftmargin\labelsep% + \setlength{\parsep}{0pt}% + }% +}% +{\endlist} +{\item} + +\endinput \ No newline at end of file diff --git a/cv.bbx b/cv.bbx index 1559ce5..fa8809b 100755 --- a/cv.bbx +++ b/cv.bbx @@ -1,4 +1,5 @@ \ProvidesFile{cv.bbx}[biblatex bibliography style for CV entries] +\RequireBiber[3] \ifdef{\biblatexmultipledm@bibstyle} {\RequireBibliographyStyle{\biblatexmultipledm@bibstyle}} @@ -7,83 +8,77 @@ % Create short names for languages \RequirePackage{pgfkeys} +%------------------------------------------------------------------------------- +% Language handlers +%------------------------------------------------------------------------------- -\pgfkeys{ - /shortlan/.is family, /shortlan, - .unknown/.code = { - \expandafter\edef\csname @cv@short@#1\endcsname{\pgfkeyscurrentname} -% \expandafter\edef\expandafter\csname @cv@long@\pgfkeyscurrentname\endcsname{#1} - } -} -% handler to create the keys -\def\babelshortnames#1{\pgfkeys{/shortlan, #1}} -% directly obtain the short name -\def\shortlanguagename{\csname @cv@short@\languagename\endcsname} -%\def\longlanguagename[1]{\csname @cv@long@#1\endcsname} - -% declare default languages -% \babelshortnames{en=english, es=spanish} -% or imported to be in sync with moderncvstyleacademic.sty -\input{setlanguages.sty} - -% Bibliography strings -\NewBibliographyString{ - duration,years,year, - pi,ai,professor,researcher, - assisprofessor, assocprofessor, - present,presentabbr} - -\DefineBibliographyStrings{english}{% - duration = {time frame}, - years = {years}, - year = {year}, - pi = {Principal Investigator}, - ai = {Alternating Investigator}, - professor = {Professor}, - assisprofessor = {Assistant Professor}, - assocprofessor = {Associate Professor}, - researcher = {Researcher}, - % - present = {present}, - presentabbr = {pres\adddot}, -} -\DefineBibliographyStrings{spanish}{% - duration = {duraci\'on}, - years = {a\~nos}, - year = {a\~no}, - pi = {Investigador Principal}, - ai = {Investigador Alterno}, - professor = {Profesor}, - assisprofessor = {Profesor Asistente}, - assocprofessor = {Profesor Asociado}, - researcher = {Investigador}, - % - present = {presente}, - presentabbr = {pres\adddot}, -} +\DeclareLanguageMapping{english}{english-cv} +\DeclareLanguageMapping{spanish}{spanish-cv} +%\pgfkeys{ +% /shortlan/.is family, /shortlan, +% .unknown/.code = { +% \expandafter\edef\csname @cv@short@#1\endcsname{\pgfkeyscurrentname} +% } +%} +%% handler to create the keys +%\def\babelshortnames#1{\pgfkeys{/shortlan, #1}} +%% directly obtain the short name +%\def\shortlanguagename{\csname @cv@short@\languagename\endcsname} +%%\def\longlanguagename[1]{\csname @cv@long@#1\endcsname} +% +%%% declare default languages +%%% \babelshortnames{en=english, es=spanish} +%%% or imported to be in sync with moderncvstyleacademic.sty +%\input{setlanguages.sty} + +%% Bibliography strings +%\NewBibliographyString{ +% duration,years,year, +% pi,ai,professor,researcher, +% assisprofessor, assocprofessor, +% present,presentabbr} +% +%\DefineBibliographyStrings{english}{% +% duration = {time frame}, +% years = {years}, +% year = {year}, +% pi = {Principal Investigator}, +% ai = {Alternating Investigator}, +% professor = {Professor}, +% assisprofessor = {Assistant Professor}, +% assocprofessor = {Associate Professor}, +% researcher = {Researcher}, +% % +% present = {present}, +% presentabbr = {pres\adddot}, +%} +%\DefineBibliographyStrings{spanish}{% +% duration = {duraci\'on}, +% years = {a\~nos}, +% year = {a\~no}, +% pi = {Investigador Principal}, +% ai = {Investigador Alterno}, +% professor = {Profesor}, +% assisprofessor = {Profesor Asistente}, +% assocprofessor = {Profesor Asociado}, +% researcher = {Investigador}, +% % +% present = {presente}, +% presentabbr = {pres\adddot}, +%} +% % Extra definitions for languages -\newcommand*{\datesep}{~} -% taken from biblatex/lbx/.lbx -\protected\def\mkbibcvdateshort#1#2#3{% - \iffieldundef{#3} - {} - {\mkyearzeros{\thefield{#3}}% - \iffieldundef{#2}{}{\datesep}}% - \iffieldundef{#2} - {} - {\mkmonthzeros{\thefield{#2}}% - \iffieldundef{#1}{}{\datesep}}% - \iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\mkdayzeros{\thefield{#1}}}}% -\DefineBibliographyExtras{english}{% -% \renewcommand*{\datesep}{\space}% -} -\DefineBibliographyExtras{spanish}{% - \renewcommand*{\bibrangedash}{--} - \renewcommand*{\bibdatedash}{--} -% \renewcommand*{\datesep}{\space} -} +% +%\DefineBibliographyExtras{english}{% +%% \renewcommand*{\datesep}{\space}% +%} +%\DefineBibliographyExtras{spanish}{% +% \renewcommand*{\bibrangedash}{--} +% \renewcommand*{\bibdatedash}{--} +%% \renewcommand*{\datesep}{\space} +%} % Multi language macros \newbibmacro*{langfield}[1]{% @@ -95,43 +90,175 @@ } \newcommand{\ifmlfieldundef}[3]{% -\iffieldundef{\mlfield{#1}}{#2}{#3}% + \iffieldundef{\mlfield{#1}}{#2}{#3}% } \newcommand{\themlfield}[1]{\thefield{\mlfield{#1}}} -\newcommand{\printmlfield}[1]{\printtext[#1]{\themlfield{#1}}} +% print (m)ulti(l)anguage fields +\newcommand{\printmlfield}[2][\empty]{% + \ifx\empty#1\relax\printfield[#2]{\mlfield{#2}}\else\printfield[#1]{\mlfield{#2}}\fi +} -\DeclareFieldFormat{details}{\ifdetails#1\fi} -% CV format macros -\newbibmacro{cvitem}[3][0.25em]{\cvitem{#2}{#3}\par\addvspace{#1}} +%------------------------------------------------------------------------------- +% Drivers +%------------------------------------------------------------------------------- -% make finentry to do nothing -\newbibmacro*{cvfinentry}{} +\DeclareBibliographyDriver{cventry}{% + \usebibmacro{begentry}% + \usebibmacro{cvitem}% + {\usebibmacro{range-date}}% + {% + \ifnameundef{author}{}{\usebibmacro{author}\newunit}% + \printmlfield{title}% + \newunit% + \printmlfield{organization}% + \setunit*{\addcomma\space}% + \printmlfield{country} + \newunit% + \ifmlfieldundef{level}{}{\usebibmacro{level}\newunit}% + \usebibmacro{note}% + \usebibmacro{description}% + } + \usebibmacro{cvfinentry}% +} -\DeclareFieldFormat{parens}{\mkbibparens{#1}} +\DeclareBibliographyAlias{course}{cventry} +\DeclareBibliographyAlias{position}{cventry} -% New environment withouth the list indent -\defbibenvironment{nobibenv}{% - \list{}{% - \setlength{\leftmargin}{\bibhang}% - \setlength{\itemindent}{-\leftmargin+10pt}% - \setlength{\itemsep}{0pt}% - \setlength{\parsep}{0pt}% +\DeclareBibliographyDriver{project}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \printmlfield{role}% + \newunit% + % \setunit*{\addperiod\space}% + \printmlfield{title}% + \newunit% + \usebibmacro{funding-project}% + \setunit*{\addspace}% + \usebibmacro{period}% + \newunit% + \usebibmacro{projdate}% + \usebibmacro{finentry}% +} + +\DeclareBibliographyAlias{study}{cventry} + +\DeclareBibliographyAlias{thesis}{cventry} + +\DeclareBibliographyAlias{cvmisc}{cventry} + +%------------------------------------------------------------------------------- +% Formats +%------------------------------------------------------------------------------- + +% General +\DeclareFieldFormat{title}{\mkbibquote{#1}} +\DeclareFieldFormat{organization}{\mkbibemph{#1}} +\DeclareFieldFormat{note}{\mkbibparens{#1\adddot}} +\DeclareFieldFormat{details}{\ifdetails\small#1\fi} + +% Specific +\DeclareFieldFormat[study]{title}{\mkbibbold{#1}} + +\DeclareFieldFormat[course]{title}{\mkbibbold{#1}} + +\DeclareFieldFormat[position]{title}{\mkbibbold{\usebibmacro{field-bibstring}{#1}}} + +\DeclareFieldFormat[thesis]{level}{\usebibmacro{field-bibstring}{#1}} + + +\DeclareFieldFormat[project]{role}{\mkbibbold{\usebibmacro{field-bibstring}{#1}}} +\DeclareFieldFormat[project]{title}{\mkbibquote{#1}} +\DeclareFieldFormat[project]{funding}{\mkbibemph{#1}} +\DeclareFieldFormat[project]{period}{% + \mkbibparens{% + % convert period into dimension to make float comparisons + \newdimen\dummyDim% + \dummyDim = #1 pt% + \bibstring{duration}\addcolon\addspace #1\addnbspace% + \ifdim\dummyDim > 1pt% + \bibstring{years}% + \else% + \bibstring{year}% + \fi% + } +} +\DeclareListFormat[project]{number}{% + \ifnumequal{\value{listcount}}{1}{% + \ifnumgreater{\value{liststop}}{1}% + {Nos.}{No.}% + }{} + \usebibmacro{list:delim}{#1}% + #1\isdot + \usebibmacro{list:andothers}% +} + +\DeclareFieldFormat[cvmisc]{title}{#1} + +%------------------------------------------------------------------------------- +% Macros +%------------------------------------------------------------------------------- +\newbibmacro*{field-bibstring}[1]{% + \ifbibstring{#1}% + {\bibstring{#1}}% + {#1}% +} + +\newbibmacro*{funding-project}{% + \ifmlfieldundef{funding}% + {}% + {\printmlfield{funding}}% + \setunit*{\space}% + \iflistundef{number}% + {}% + {\printlist[number]{number}}% +} + +\newbibmacro*{period}{% + \iffieldundef{period}% + {}% + {\printmlfield{period}}% +} + +\newbibmacro*{projdate}{% + \mkbibdatelong{year}{month}{}% +} + +\newbibmacro{level}{% + \ifmlfieldundef{level}% + {}% + {% + \printtext{% + \bibstring{degree}: \printmlfield{level}% + }% }% -}% -{\endlist} -{\item} +} + +\newbibmacro*{note}{% + \ifmlfieldundef{note}% + {}% + {\printmlfield{note}}% +} +% CV format macros +\newlength{\cvitemskip} +\setlength{\cvitemskip}{0.25em} +\newbibmacro{cventry}[7][\cvitemskip]{\cventry[#1]{#2}{#3}{#4}{#5}{#6}{#7}} + +\newbibmacro{cvitem}[3][\cvitemskip]{\cvitem{#2}{#3}\par\addvspace{#1}} +% make finentry to do nothing +\newbibmacro*{cvfinentry}{} + % Common formats \newbibmacro*{range-date}{% - \iffieldundef{year} - {} + \iffieldundef{year}% + {}% {\printtext{% - % If the item is in the same year, + % If the item is in the same year, \iffieldsequal{year}{endyear}% % compress {\mkbibcvdateshort{}{month}{}}% @@ -146,13 +273,13 @@ \) }% {}% {\bibdatedash}% - % if a range is given but blank, + % if a range is given but blank, \iffieldequalstr{endyear}{}% % default to "present" {\ifdetails% print long version (we may have room, unless there is no description) - \ifmlfieldundef{description}{\bibstring{presentabbr}}{\bibstring{present}}% + \ifmlfieldundef{description}{\bibsstring{present}}{\bibstring{present}}% \else% print short version - \bibstring{presentabbr}% + \bibsstring{present}% \fi% }% % else, print a range @@ -162,18 +289,66 @@ }% } - -\newbibmacro*{organization}{\printmlfield{organization}} - -\newbibmacro*{country}{\printmlfield{country}} +\newcommand*{\datesep}{~} +% taken from biblatex/lbx/.lbx +\protected\def\mkbibcvdateshort#1#2#3{% + \iffieldundef{#3} + {}% + {\mkyearzeros{\thefield{#3}}% + \iffieldundef{#2}{}{\datesep}}% + \iffieldundef{#2}% + {}% + {\mkmonthzeros{\thefield{#2}}% + \iffieldundef{#1}{}{\datesep}}% + \iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\mkdayzeros{\thefield{#1}}}}% \newbibmacro{description}{% \printtext[details]{% \ifmlfieldundef{description}% {\clearfield{\mlfield{description}}}% {% - \ifblank{\thefield{description}}{}{\newline{}\begin{minipage}[t]{\linewidth}\printmlfield{description}\end{minipage}}% + \ifblank{\thefield{description}}{}{\par\begin{minipage}[t]{\linewidth}\printmlfield{description}\adddot\end{minipage}}% }% }% } + +%------------------------------------------------------------------------------- +% Patch the bibliography +%------------------------------------------------------------------------------- + +% lets remove the brackets +\DeclareFieldFormat{labelnumberwidth}{#1.} + +% http://tex.stackexchange.com/a/123809/7561 +\defbibenvironment{bibliography}{ + \list + {\printtext[labelnumberwidth]{% label format from numeric.bbx + \printfield{labelprefix}% + \printfield{labelnumber}}} + {% + \setlength{\topsep}{0pt}% + \setlength{\labelwidth}{\hintscolumnwidth}% + \setlength{\labelsep}{\separatorcolumnwidth}% + \leftmargin\labelwidth% + \advance\leftmargin\labelsep% + }% + \sloppy\clubpenalty4000\widowpenalty4000} +{\endlist} +{\item} + +% New environment withouth the list indent +\defbibenvironment{nobibenv}{% + \list{}{% + \setlength{\topsep}{0pt}% + \setlength{\labelwidth}{\hintscolumnwidth}% + \setlength{\labelsep}{\separatorcolumnwidth}% + \setlength{\leftmargin}{0pt}% + \setlength{\parsep}{0pt}% + }% +}% +{\endlist} +{\item} + + +\endinput \ No newline at end of file diff --git a/cv.dbx b/cv.dbx new file mode 100644 index 0000000..4849584 --- /dev/null +++ b/cv.dbx @@ -0,0 +1,151 @@ +\ProvidesFile{cv.dbx} + +\DeclareDatamodelFields[type=field, datatype=literal]{ + level,% + period,% + % + organization,% + title,% + country,% + description,% + funding, + role,% + note,% + % + organization-es,% + title-es,% + country-es,% + description-es,% + funding-es, + role-es, + note-es,% + % + organization-en,% + title-en,% + country-en,% + description-en,% + funding-en,% + role-en,% + note-en% +} + + +\DeclareDatamodelFields[type=list, datatype=literal]{ + number +} + +\DeclareDatamodelFields[type=field, datatype=datepart]{ + year,% + endyear,% + month,% + endmonth% +} + +\DeclareDatamodelFields[type=field,datatype=date]{ + date% +} + +% Entries +\DeclareDatamodelEntrytypes{course, cvmisc, position, project, study, thesis} + +% Data models + +\DeclareDatamodelEntryfields[course]{% + date,% + organization,% + title,% + description,% + % + organization-es,% + title-es,% + description-es,% + % + organization-en,% + title-en,% + description-en% +} + +\DeclareDatamodelEntryfields[cvmisc]{% + date,% + title,% + description,% + % + title-es,% + description-es,% + % + title-en,% + description-en% +} + +\DeclareDatamodelEntryfields[position]{% + date,% + organization,% + title,% + country,% + description,% + % + organization-es,% + title-es,% + country-es,% + description-es,% + % + organization-en,% + title-en,% + country-en,% + description-en% +} + +\DeclareDatamodelEntryfields[project]{ + number, + title, + funding, + role, + % + title-en + funding-en, + role-en, + % + title-es, + funding-es, + role-es, + % + number, + period, + month, + year% +} + +\DeclareDatamodelEntryfields[study]{% + date,% + organization,% + title,% + country,% + description,% + % + organization-es,% + title-es,% + country-es,% + description-es,% + % + organization-en,% + title-en,% + country-en,% + description-en% +} + +\DeclareDatamodelEntryfields[thesis]{% + author,% + date,% + organization,% + title,% + note,% + level,% + % + organization-es,% + title-es,% + note-es,% + % + organization-en,% + title-en,% + note-en% +} diff --git a/english-cv.lbx b/english-cv.lbx new file mode 100644 index 0000000..a21c1d5 --- /dev/null +++ b/english-cv.lbx @@ -0,0 +1,60 @@ +\ProvidesFile{english-cv.lbx} +\InheritBibliographyExtras{english} + +% Bibliography strings +\NewBibliographyString{ + duration, + years, + year, + pi, + ai, + professor, + researcher, + assisprofessor, + assocprofessor, + present, + studies,% + positions,% + theses, + undergrad, + master, + doctor, + degree,% + courses,% + cvmiscs% +} + +\DeclareBibliographyStrings{% + inherit = {american}, + duration = {{time frame}{time frame}}, + years = {{years}{years}}, + year = {{year}{year}}, + pi = {{Principal Investigator}{Principal Investigator}}, + ai = {{Alternating Investigator}{Alternating Investigator}}, + professor = {{Professor}{Professor}}, + assisprofessor = {{Assistant Professor}{Assistant Professor}}, + assocprofessor = {{Associate Professor}{Associate Professor}}, + researcher = {{Researcher}{Researcher}}, + % + present = {{present}{pres\adddot}}, + % + studies = {{Education}{Education}}, + positions = {{Positions}{Positions}}, + % + theses = {{Theses}{Theses}}, + degree = {{Degree}{Degree}}, + undergrad = {{Undergraduate}{Undergraduate}}, + master = {{Master}{Master}}, + doctor = {{Ph\adddot D\adddot}{Ph\adddot D\adddot}},% + % + courses = {{Courses}{Courses}},% + % + cvmiscs = {{Miscelaneous}{Miscelaneous}},% +} + + +\DeclareBibliographyExtras{% + \uspunctuation% +} + +\endinput diff --git a/moderncvbodyxliii.sty b/moderncvbodyxliii.sty new file mode 100644 index 0000000..d00891a --- /dev/null +++ b/moderncvbodyxliii.sty @@ -0,0 +1,97 @@ +%------------------------------------------------------------------------------- +% identification +%------------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{moderncvbodyxliii} + + +%------------------------------------------------------------------------------- +% required packages +%------------------------------------------------------------------------------- + +% load oldstyle body +\moderncvbody{4} + +\RequirePackage{tikz} +\RequirePackage{xcolor} + +\definecolor{white}{RGB}{255,255,255} + +\definecolor{darkgray}{HTML}{333333} +\definecolor{gray}{HTML}{4D4D4D} +\definecolor{lightgray}{HTML}{999999} + +\definecolor{green}{HTML}{C2E15F} +\definecolor{orange}{HTML}{FDA333} +\definecolor{purple}{HTML}{D3A4F9} +\definecolor{red}{HTML}{FB4485} +\definecolor{blue}{HTML}{6CE0F1} +\definecolor{yellow}{HTML}{B3B300} +\definecolor{bluegray}{HTML}{669999} +\definecolor{pink}{HTML}{FF9999} +\definecolor{navy}{HTML}{002B80} +\definecolor{lime}{HTML}{66FF66} + + + +\ifdefined\@cv@print +\colorlet{green}{gray} +\colorlet{orange}{gray} +\colorlet{purple}{gray} +\colorlet{red}{gray} +\colorlet{blue}{gray} +\colorlet{fillheader}{white} +\colorlet{header}{gray} +\else +\colorlet{fillheader}{gray} +\colorlet{header}{white} +\fi +\colorlet{textcolor}{gray} +\colorlet{headercolor}{gray} + + +%%%%%%%%%%%%% +% Structure % +%%%%%%%%%%%%% +\RequirePackage{parskip} + +\newcounter{colorCounter} +\def\@sectioncolor#1#2#3{% + {% + \color{% + \ifcase\value{colorCounter}% + blue\or% + red\or% + orange\or% + green\or% + bluegray\or% + pink\or% + yellow\or% + navy\or% + lime\or% + purple\else% + color1\fi% + } #1#2#3% + }% + \stepcounter{colorCounter}% +} + +%------------------------------------------------------------------------------- +% overall body definition +%------------------------------------------------------------------------------- +% fonts +\renewcommand*{\sectionfont}{\Large\bfseries\upshape} +\renewcommand*{\subsectionfont}{\large\bfseries\itshape} +\renewcommand*{\hintfont}{\bfseries} + + +\renewcommand*{\sectionstyle}[1]{% + \begingroup% + \edef\x{\endgroup{\noexpand\sectionfont\noexpand\color{color1}\noexpand\@sectioncolor #1}}% + \x% +} +\renewcommand*{\subsectionstyle}[1]{{\subsectionfont\textcolor{color1}{#1}}} +\renewcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}} + + +\endinput diff --git a/moderncvheadxliii.sty b/moderncvheadxliii.sty new file mode 100755 index 0000000..650d051 --- /dev/null +++ b/moderncvheadxliii.sty @@ -0,0 +1,125 @@ +%% start of file `moderncvheadxliii.sty'. + +%------------------------------------------------------------------------------- +% identification +%------------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{moderncvheadxliii} + +% details options: "details" (default) or "nodetails" +\@initializeif{\if@details}\@detailsfalse +\DeclareOption{details}{\@detailstrue} +\DeclareOption{nodetails}{\@detailsfalse} + +\DeclareOption*{}% avoid choking on unknown options +\ExecuteOptions{details} + +\ProcessOptions*\relax% \ProcessOptions* processes the options in the order provided (i.e., with the later ones possibly overriding the former ones), while \ProcessOptions processes them in the order of the package + + +%------------------------------------------------------------------------------- +% required packages +%------------------------------------------------------------------------------- +\RequirePackage{changepage} +%\moderncvhead[\moderncvstyleheadoptions]{1} + +%------------------------------------------------------------------------------- +% overall head definition +%------------------------------------------------------------------------------- +% fonts +\renewcommand*{\namefont}{\fontsize{34}{36}\mdseries\upshape} +\newcommand*{\boldnamefont}{\fontsize{34}{36}\bfseries\upshape} +\renewcommand*{\titlefont}{\Large\mdseries\slshape} +\renewcommand*{\addressfont}{\small\mdseries} +\renewcommand*{\quotefont}{\large\itshape} + +% styles +\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color0}{#1}}} +\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color0}{#1}}} +\renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}} +\renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}} + +%------------------------------------------------------------------------------- +% resume head definition +%------------------------------------------------------------------------------- + +% lengths +\@initializelength{\quotewidth} +\@initializelength{\makecvheadnamewidth}% optional makecvheadname width to force a certain width (if set/remains to 0pt, the width is calculated automatically) +\setlength{\marginparwidth}{0\p@} +\setlength{\marginparsep}{0\p@} +\renewcommand*{\recomputecvheadlengths}{% + \changepage{}{+\marginparwidth+\marginparsep}{}{}{}{}{}{}{}% if a letter was typeset before the resume, \marginparwidth and \marginparsep will be non-zero; otherwise, this has no effect + \setlength{\marginparwidth}{0\p@}% + \setlength{\marginparsep}{0\p@}% + \setlength{\quotewidth}{0.85\textwidth}} + +% commands +\newcommand*{\makecvheadinfo}[1]{% TODO: use \@initializecommand, which requires modifying its definition to handle mandatory and optional arguments + \newbox{\makecvheadinfobox}% + \savebox{\makecvheadinfobox}{\parbox[t]{\hintscolumnwidth}{#1}}% + \newlength{\makecvheadinfoheight}% + \setlength{\makecvheadinfoheight}{\totalheightof{\usebox{\makecvheadinfobox}}}% the total height of the parbox is the sum of its height (\the\ht\makeinfobox) and its depth (\the\dp\makeinfobox); the \totalheightof command is provided by the "calc" package + \usebox{\makecvheadinfobox}\vspace{-\makecvheadinfoheight}% + % \newlength{\leftcolumnwidth}% + % \setlength{\leftcolumnwidth}{\hintscolumnwidth+\separatorcolumnwidth}% + % \par\vspace{-\baselineskip}\vspace{-\parskip}\leftskip=\leftcolumnwidth% + \par\vspace{-\baselineskip}\vspace{-\parskip}% + \leftskip=\dimexpr\hintscolumnwidth+\separatorcolumnwidth\relax% \dimexpr require e-TeX engine extensions + \recomputecvlengths} % need to recompute the layout lenghts as we just changed \leftskip +\renewcommand*{\makecvhead}{ + % recompute lengths (in case we are switching from letter to resume, or vice versa) + \recomputecvlengths% + % optional picture box + \newbox{\makecvheadpicturebox}% + \savebox{\makecvheadpicturebox}{% + \ifthenelse{\isundefined{\@photo}}% + {}% + {% + \color{color1}% + \setlength\fboxrule{\@photoframewidth}% + \ifdim\@photoframewidth=0pt% + \setlength{\fboxsep}{0pt}\fi% + \framebox{\includegraphics[width=\@photowidth]{\@photo}}}}% + % name and optional title + \newlength{\makecvheadpicturewidth}\settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}% + \ifthenelse{\lengthtest{\makecvheadnamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvheadnamewidth=0pt) + {\setlength{\makecvheadnamewidth}{\textwidth-\makecvheadpicturewidth}}% + {}% + \begin{tikzpicture}[remember picture,overlay] + \node [rectangle, fill=fillheader, anchor=north, minimum width=\paperwidth, minimum height=4cm] (box) at (current page.north){}; + \node [anchor=center] (name) at (box) {% + \fontsize{40pt}{72pt}\color{header}% + {\namefont\@firstname\ }{\boldnamefont\@lastname} + }; + \node [anchor=north] at (name.south) {% + \fontsize{14pt}{24pt}\color{header}% + \titlefont\@title% + }; + \end{tikzpicture} + \vspace{.5cm}% + % optional photo + \usebox{\makecvheadpicturebox}\\[2.5em]% + % optional quote + \ifthenelse{\isundefined{\@quote}}% + {}% + {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}% + % optional details + \if@details% + \makecvheadinfo{% + \raggedleft% + \addressfont\color{color2}% + \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet% + \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty + \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}% + \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number + \makenewline{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}% + \ifthenelse{\isundefined{\@email}}{}{\makenewline{\emailsymbol}~\emaillink{\@email}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makenewline{\homepagesymbol}~\httplink{\@homepage}}% + \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link + \makenewline{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}% + \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi} + + + +\endinput \ No newline at end of file diff --git a/moderncvstyleacademic.sty b/moderncvstyleacademic.sty index 9f11ce3..3ffe88c 100755 --- a/moderncvstyleacademic.sty +++ b/moderncvstyleacademic.sty @@ -5,18 +5,15 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvstyleacademic}[2016/08/28 v1.0.0 modern curriculum vitae and letter style scheme: academic] +\ProvidesPackage{moderncvstyleacademic} -\newif\if@citeall -\@citealltrue % head section alignment options: "left" (default) or "right" \@initializecommand{\moderncvstyleheadoptions}{} \DeclareOption{left} {\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,left}} \DeclareOption{right}{\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,right}} -\DeclareOption{citeall}{\@citealltrue} -\DeclareOption{nocite}{\@citeallfalse} + \DeclareOption*{}% avoid choking on unknown options \ExecuteOptions{left} @@ -50,39 +47,22 @@ % header, body & footer %------------------------------------------------------------------------------- \moderncvhead[\moderncvstyleheadoptions]{42} -\moderncvbody{42} - +\moderncvbody{1} %------------------------------------------------------------------------------- -% Definitions +% Custom lengths %------------------------------------------------------------------------------- - -%switches for information -\newif\ifdetails\detailsfalse - +% if you want to change the width of the column with the dates +\setlength{\hintscolumnwidth}{0.15\linewidth} +\setlength{\separatorcolumnwidth}{0.025\linewidth} %------------------------------------------------------------------------------- % Patch the rest of moderncv %------------------------------------------------------------------------------- -% fix identation for letters -\setlength{\parindent}{10\p@} - - -% patch \cventry -% http://tex.stackexchange.com/a/247329/7561 -\renewcommand*{\cventry}[7][.25em]{% - \cvitem[#1]{#2}{% - {\bfseries#3}% - \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}% - \ifthenelse{\equal{#5}{}}{}{, #5}% - \ifthenelse{\equal{#6}{}}{}{, #6}% - .\strut% - \ifdetails% - \ifblank{#7}{}{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}% - \fi% - } -} +% fix style for sections +\renewcommand*{\sectionfont}{\Large\mdseries\upshape\bfseries} +\renewcommand*{\subsectionfont}{\large\mdseries\upshape\bfseries} % use for special titles @@ -90,211 +70,13 @@ % use for emails in the body, \newcommand{\mail}[1]{\ttfamily\href{mailto:#1}{#1}} -\RenewDocumentCommand{\social}{O{}O{}m}{% - \ifthenelse{\equal{#2}{}}% - {% - \ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httplink[#3]{www.linkedin.com/in/#3}}}{}% - \ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httplink[#3]{www.twitter.com/#3}}} {}% - \ifthenelse{\equal{#1}{github}} {\collectionadd[github]{socials} {\protect\httplink[#3]{www.github.com/#3}}} {}% - \ifthenelse{\equal{#1}{scholar}} {\collectionadd[scholar]{socials} {\protect\httplink[Google Scholar]{http://scholar.google.com/citations?user=#3}}} {}% - } - {\collectionadd[#1]{socials}{\protect\httplink[#3]{#2}}}} - - -%------------------------------------------------------------------------------- -% Multilanguage support -%------------------------------------------------------------------------------- -\RequirePackage{pgfkeys} -% http://tex.stackexchange.com/a/42791/7561 -\newcommand{\newlcommand}[1]{% - \newcommand#1{% - \@ifundefined{\string#1\languagename} - {``No def of \texttt{\string#1} for \languagename''} - {\@nameuse{\string#1\languagename}}% - }% -} -\newcommand{\addtolanguagecommand}[3]{% - \@namedef{\string#1#2}{#3}} - -\pgfkeys{ - /mlcommands/.is family, /mlcommands, - command/.code={\def\langcmd{#1}}, - .unknown/.code = {% - \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\addtolanguagecommand\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter - {\expandafter\expandafter\expandafter\langcmd\expandafter\expandafter\expandafter}% - \expandafter\expandafter\expandafter{\expandafter\pgfkeyscurrentname\expandafter}\expandafter - {#1} - }% -} - -\newcommand{\newmlcommand}[2][]{% - \newlcommand#2% - \pgfkeys{/mlcommands, command=#2, #1}% -} - -% How to use -%\newlanguagecommand{\uno} -%\addtolanguagecommand{\uno}{english}{one} -%\addtolanguagecommand{\uno}{french}{une} -% or -% \newmlcommand[english=one, french=une]{\uno} - -% Create long names for languages, this reuses the code from cv.bbx -% fixme: merge both definitions (here and cv.bbx) -\pgfkeys{ - /shortlan/.is family, /shortlan, - .unknown/.code = { -% \expandafter\edef\csname @cv@short@#1\endcsname{\pgfkeyscurrentname} - \expandafter\expandafter\expandafter\edef\expandafter\csname @cv@long@\pgfkeyscurrentname\endcsname{#1} - } -} -% handler to create the keys -\def\babelshortnames#1{\pgfkeys{/shortlan, #1}} -% directly obtain the short name -%\def\shortlanguagename{\csname @cv@short@\languagename\endcsname} -\newcommand{\longlanguagename}[1]{\csname @cv@long@#1\endcsname} - -% declare default languages -% \babelshortnames{en=english, es=spanish} -% or imported to be in sync with cv.bbx -\input{setlanguages.sty} - -% use a select language with short name instead of default long one -\newcommand{\selectshortlanguage}[1]{% - \edef\mylang{\longlanguagename{#1}}% - \expandafter\selectlanguage\expandafter{\mylang}% -} - -%------------------------------------------------------------------------------- -% Academic drivers and sorting to use with this style -%------------------------------------------------------------------------------- - -\RequirePackage[tools={study, position, course, thesis, project, cvmisc}, bibstyle=numeric-comp]{biblatex-multiple-dm} -% bibliography with mutiple entries -\RequirePackage[backend=biber, citestyle=numeric-comp, bibstyle=multiple-dm, sorting=ymdtn, maxbibnames=99, defernumbers=true, giveninits=true, sortcites]{biblatex} - -% Patch endyears that are not declared -% http://tex.stackexchange.com/a/327884/7561 -\DeclareSourcemap{ - \maps[datatype=bibtex]{ - \map{ - \pertype{study} - \pertype{position} - \pertype{project} - \pertype{course} - \pertype{thesis} - \pertype{committee} - \pertype{cvmisc} - \step[fieldsource=date, match=\regexp{\A([0-9]{4}-[0-9]{2}-[0-9]{2})\Z}, replace=\regexp{$1/$1}] - \step[fieldsource=date, match=\regexp{\A([0-9]{4}-[0-9]{2})\Z}, replace=\regexp{$1/$1}] - \step[fieldsource=date, match=\regexp{\A([0-9]{4})\Z}, replace=\regexp{$1/$1}] - } - } -} - -% Custom sort to include month and endyear -\DeclareSortingScheme{ymdtn}{ - \sort{ - \field{presort} - } - \sort[final]{ - \field{sortkey} - } - \sort[direction=descending]{ - \field{sortyear} - \field{endyear} - \literal{9999} - } - \sort[direction=descending]{ - \field{sortyear} -% \field{endyear} - \field{year} - \literal{9999} - } - \sort[direction=descending]{ - \field[padside=left,padwidth=2,padchar=0]{month} - \literal{99} - } - \sort[direction=descending]{ - \field[padside=left,padwidth=2,padchar=0]{day} - \literal{99} - } - \sort{ - \field{sorttitle} - } - \sort[direction=descending]{ - \field[padside=left,padwidth=4,padchar=0]{volume} - \literal{9999} - } - \sort{ - \name{sortname} - \name{author} - \name{editor} - \name{translator} - \field{sorttitle} - \field{title} - } -} - -% patch for bold name in bibliography -\def\makenamesetup{% - \def\bibnamedelima{~}% - \def\bibnamedelimb{ }% - \def\bibnamedelimc{ }% - \def\bibnamedelimd{ }% - \def\bibnamedelimi{ }% - \def\bibinitperiod{.}% - \def\bibinitdelim{~}% - \def\bibinithyphendelim{.-}} -\newcommand*{\makename}[2]{\begingroup\makenamesetup\xdef#1{#2}\endgroup} - -\renewcommand{\mkbibnamegiven}[1]{% - \ifboolexpr{ ( test {\ifdefequal{\bld@firstname}{\namepartgiven}} or test {\ifdefequal{\bld@firstinit}{\namepartgiven}} ) and test {\ifdefequal{\bld@lastname}{\namepartfamily}} } - {\mkbibbold{#1}}{#1}% -} - -\renewcommand{\mkbibnamefamily}[1]{% - \ifboolexpr{ ( test {\ifdefequal{\bld@firstname}{\namepartgiven}} or test {\ifdefequal{\bld@firstinit}{\namepartgiven}} ) and test {\ifdefequal{\bld@lastname}{\namepartfamily}} } - {\mkbibbold{#1}}{#1}% -} - - -\newcommand*{\boldname}[3]{% - \def\bld@lastname{#1}% - \def\bld@firstname{#2}% - \def\bld@firstinit{#3}} - -\boldname{}{}{} - -% We need to tell biblatex to check for all entries -\if@citeall - \nocite{*} -\fi - - -% Patch the bibliography - -% lets remove the brackets -\DeclareFieldFormat{labelnumberwidth}{#1.} - -% http://tex.stackexchange.com/a/123809/7561 -\defbibenvironment{bibliography} -{\list - {\printtext[labelnumberwidth]{% label format from numeric.bbx - \printfield{labelprefix}% - \printfield{labelnumber}}} - {\setlength{\topsep}{0pt}% layout parameters from moderncvstyleclassic.sty - \setlength{\labelwidth}{\hintscolumnwidth}% - \setlength{\labelsep}{\separatorcolumnwidth}% - \leftmargin\labelwidth% - \advance\leftmargin10pt% - \advance\leftmargin\labelsep}% - \sloppy\clubpenalty4000\widowpenalty4000} -{\endlist} -{\item} +% remove identation to the closure of the letter +\patchcmd{\makeletterclosing}% +{\vfill}% +{\vfill\noindent}% +{}{} \endinput - %% end of file `moderncvstyleacademic.sty'. diff --git a/moderncvstylefriggeri.sty b/moderncvstylefriggeri.sty new file mode 100755 index 0000000..05303c3 --- /dev/null +++ b/moderncvstylefriggeri.sty @@ -0,0 +1,36 @@ +%------------------------------------------------------------------------------- +% identification +%------------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{moderncvstylefriggeri} + +% head section alignment options: "left" (default) or "right" +\@initializecommand{\moderncvstyleheadoptions}{} +\DeclareOption{left} {\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,left}} +\DeclareOption{right}{\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,right}} + + + +\DeclareOption*{}% avoid choking on unknown options +\ExecuteOptions{left} +\ProcessOptions*\relax% \ProcessOptions* processes the options in the order provided (i.e., with the later ones possibly overriding the former ones), while \ProcessOptions processes them in the order of the package + +%------------------------------------------------------------------------------- +% fonts & icons +%------------------------------------------------------------------------------- + + +% symbols +\moderncvicons{fa-academic} + + +%------------------------------------------------------------------------------- +% header, body & footer +%------------------------------------------------------------------------------- +\moderncvhead[\moderncvstyleheadoptions]{43} +\moderncvbody{43} + + +\endinput + +%% end of file `moderncvstyleacademic.sty'. diff --git a/spanish-cv.lbx b/spanish-cv.lbx new file mode 100644 index 0000000..24a9824 --- /dev/null +++ b/spanish-cv.lbx @@ -0,0 +1,61 @@ +\ProvidesFile{spanish-cv.lbx} +\InheritBibliographyExtras{spanish} + +% Bibliography strings +\NewBibliographyString{ + duration, + years, + year, + pi, + ai, + professor, + researcher, + assisprofessor, + assocprofessor, + present, + studies,% + positions,% + theses, + undergrad, + master, + doctor, + degree,% + courses,% + cvmiscs% +} + +\DeclareBibliographyStrings{% + inherit = {spanish}, + duration = {{duraci\'on}{duraci\'on}}, + years = {{a\~nos}{a\~nos}}, + year = {{a\~no}{a\~no}}, + pi = {{Investigador Principal}{Investigador Principal}}, + ai = {{Investigador Alterno}{Investigador Alterno}}, + professor = {{Profesor}{Profesor}}, + assisprofessor = {{Profesor Asistente}{Profesor Asistente}}, + assocprofessor = {{Profesor Asociado}{Profesor Asociado}}, + researcher = {{Investigador}{Investigador}}, + % + present = {{presente}{pres\adddot}}, + % + studies = {{Educaci\'on}{Educaci\'on}}, + positions = {{Posiciones}{Posiciones}}, + % + theses = {{Tesis}{Tesis}}, + degree = {{Grado}{Grado}}, + undergrad = {{Licenciatura}{Licenciatura}}, + master = {{Maestr\'ia}{Maestr\'ia}}, + doctor = {{Doctoral}{Doctoral}}, + % + courses = {{Cursos}{Cursos}},% + % + cvmiscs = {{Miscelanea}{Miscelanea}}, +} + + +\DeclareBibliographyExtras{% + \renewcommand*{\bibrangedash}{--} + \renewcommand*{\bibdatedash}{--} +} + +\endinput \ No newline at end of file