diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-30 22:38:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-30 22:38:11 +0000 |
commit | bcf694a0835cc008732c04f517813ab94f02963e (patch) | |
tree | 242e42751669b0d411e969f6c2678502e3218033 /Master/texmf-dist/tex/latex/moderncv/moderncv.cls | |
parent | c8840db08daf67f916ca0e0613031351add227dc (diff) |
moderncv (30jul12)
git-svn-id: svn://tug.org/texlive/trunk@27250 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/moderncv/moderncv.cls')
-rw-r--r-- | Master/texmf-dist/tex/latex/moderncv/moderncv.cls | 125 |
1 files changed, 80 insertions, 45 deletions
diff --git a/Master/texmf-dist/tex/latex/moderncv/moderncv.cls b/Master/texmf-dist/tex/latex/moderncv/moderncv.cls index 55fff7b754b..f3afd48de33 100644 --- a/Master/texmf-dist/tex/latex/moderncv/moderncv.cls +++ b/Master/texmf-dist/tex/latex/moderncv/moderncv.cls @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{moderncv}[2012/03/26 v1.0 modern curriculum vitae and letter document class] +\ProvidesClass{moderncv}[2012/07/30 v1.1.1 modern curriculum vitae and letter document class] %------------------------------------------------------------------------------- @@ -51,15 +51,15 @@ \DeclareOption{12pt}{\renewcommand\@ptsize{2}} % font type options -\DeclareOption{sans}{\renewcommand{\familydefault}{\sfdefault}} -\DeclareOption{roman}{\renewcommand{\familydefault}{\rmdefault}} +\DeclareOption{sans}{\AtBeginDocument{\renewcommand{\familydefault}{\sfdefault}}} +\DeclareOption{roman}{\AtBeginDocument{\renewcommand{\familydefault}{\rmdefault}}} % draft/final option \DeclareOption{draft}{\setlength\overfullrule{5pt}} \DeclareOption{final}{\setlength\overfullrule{0pt}} % execute default options -\ExecuteOptions{a4paper,11pt,sans,final} +\ExecuteOptions{a4paper,11pt,final} % process given options \ProcessOptions\relax @@ -78,40 +78,69 @@ % if... then... else... constructs \RequirePackage{ifthen} +% TODO: move to xifthen and \isempty{<arg>} instead of \equal{<arg>}{} + +% TODO: replace \newcommand by \NewDocumentCommand (LaTeX 3) % color \RequirePackage{xcolor} -% automatic loading of latin modern fonts if present on the system -\IfFileExists{lmodern.sty} - {\RequirePackage[T1]{fontenc}\RequirePackage{lmodern}} - {} - -% symbols like \Telefon, \Mobilefone, \Letter and \Email -\RequirePackage{marvosym} +% font loading +%\usepackage{ifxetex,ifluatex} +%\newif\ifxetexorluatex +%\ifxetex +% \xetexorluatextrue +%\else +% \ifluatex +% \xetexorluatextrue +% \else +% \xetexorluatexfalse +% \fi +%\fi +% automatic loading of latin modern fonts +%\ifxetexorluatex +% \RequirePackage{fontspec} +% \defaultfontfeatures{Ligatures=TeX} +% \RequirePackage{unicode-math} +% \setmainfont{Latin Modern} +% \setsansfont{Latin Modern Sans} +% \setmathfont{Latin Modern Math} +%\else + \RequirePackage[T1]{fontenc} + \IfFileExists{lmodern.sty}% + {\RequirePackage{lmodern}}% + {} +%\fi + +% MarVoSym font for symbols +%\RequirePackage{marvosym} +\newcommand*{\marvosymbol}[1]{} +%\ifxetexorluatex +% \renewcommand*{\marvosymbol}[1]{{\fontspec{MarVoSym}\char#1}} +%\else + \renewcommand*{\marvosymbol}[1]{{\fontfamily{mvs}\fontencoding{U}\fontseries{m}\fontshape{n}\selectfont\char#1}} +%\fi % hyper links (hyperref is loaded at the end of the preamble to pass options required by loaded packages such as CJK) \RequirePackage{url} \urlstyle{tt} \AtEndPreamble{ - \@ifpackageloaded{CJK} - {\RequirePackage[unicode]{hyperref}} - {\RequirePackage{hyperref}} - \hypersetup{ - breaklinks, - baseurl = http://, - pdfborder = 0 0 0, - pdfpagemode = UseNone,% do not show thumbnails or bookmarks on opening - pdfpagelabels = false,% to avoid a warning setting it automatically to false anyway, because hyperref detects \thepage as undefined (why?) - pdfstartpage = 1, - pdfcreator = {\LaTeX{} with `moderncv' package}, -% pdfproducer = {\LaTeX{}},% will/should be set automatically to the correct TeX engine used - bookmarksopen = true, - bookmarksdepth= 2,% to show sections and subsections - pdfauthor = {\@firstname{}~\@familyname{}}, - pdftitle = {\@firstname{}~\@familyname{} -- \@title{}}, - pdfsubject = {Resum\'{e} of \@firstname{}~\@familyname{}}, - pdfkeywords = {\@firstname{}~\@familyname{}, curriculum vit\ae{}, resum\'{e}}} + \RequirePackage[unicode]{hyperref} + \hypersetup{ + breaklinks, + baseurl = http://, + pdfborder = 0 0 0, + pdfpagemode = UseNone,% do not show thumbnails or bookmarks on opening + pdfpagelabels = false,% to avoid a warning setting it automatically to false anyway, because hyperref detects \thepage as undefined (why?) + pdfstartpage = 1, + pdfcreator = {\LaTeX{} with 'moderncv' package}, +% pdfproducer = {\LaTeX{}},% will/should be set automatically to the correct TeX engine used + bookmarksopen = true, + bookmarksdepth= 2,% to show sections and subsections + pdfauthor = {\@firstname{}~\@familyname{}}, + pdftitle = {\@firstname{}~\@familyname{} -- \@title{}}, + pdfsubject = {Resum\'{e} of \@firstname{}~\@familyname{}}, + pdfkeywords = {\@firstname{}~\@familyname{}, curriculum vit\ae{}, resum\'{e}}} \pagenumbering{arabic}% has to be issued after loading hyperref } @@ -135,7 +164,7 @@ \newlength{\pagenumberwidth}% \settowidth{\pagenumberwidth}{\color{color2}\addressfont\itshape\strut\thepage/\pageref{lastpage}}% \fancypagestyle{plain}{% - \fancyfoot[r]{\parbox{\pagenumberwidth}{\color{color2}\addressfont\itshape\strut\thepage/\pageref{lastpage}}}}% the parbox is required to ensure alignment with a possible center footer (e.g., as in the casual style) + \fancyfoot[r]{\parbox[b]{\pagenumberwidth}{\color{color2}\addressfont\itshape\strut\thepage/\pageref{lastpage}}}}% the parbox is required to ensure alignment with a possible center footer (e.g., as in the casual style) \pagestyle{plain}}{}}% \AtEndDocument{\label{lastpage}}\else\fi}} \pagestyle{plain} @@ -167,7 +196,7 @@ \setlength\fboxsep{3\p@} \setlength\fboxrule{.4\p@} -% Not required +% not required %\setlength\arraycolsep{5\p@} %\setlength\tabcolsep{6\p@} %\setlength\arrayrulewidth{.4\p@} @@ -188,7 +217,7 @@ \newcommand*{\address}[2]{\def\@addressstreet{#1}\def\@addresscity{#2}} \newcommand*{\mobile}[1]{\def\@mobile{#1}} \newcommand*{\phone}[1]{\def\@phone{#1}} -\renewcommand*{\fax}[1]{\def\@fax{#1}} +\newcommand*{\fax}[1]{\def\@fax{#1}} \newcommand*{\email}[1]{\def\@email{#1}} \newcommand*{\homepage}[1]{\def\@homepage{#1}} @@ -200,10 +229,10 @@ % symbols % itemize labels (the struts were added to correct inter-item spacing (works for single line items, until a solution is found for multi-line ones...) -\newcommand*{\labelitemi}{\strut\textcolor{color1}{\Neutral}}% alternative" \fontencoding{U}\fontfamily{ding}\selectfont\tiny\symbol{'102} +\newcommand*{\labelitemi}{\strut\textcolor{color1}{\marvosymbol{123}}}% equivalent to \Neutral from marvosym package; alternative: \fontencoding{U}\fontfamily{ding}\selectfont\tiny\symbol{'102} \newcommand*{\labelitemii}{\strut\textcolor{color1}{\large\bfseries-}} -\newcommand*{\labelitemiii}{\strut\textcolor{color1}{\textperiodcentered}}% alternative: \textasteriskcentered; both force the use of the CMSY font, even when lmodern fonts are used :( -\newcommand*{\labelitemiv}{\strut\textcolor{color1}{\textperiodcentered}} +\newcommand*{\labelitemiii}{\strut\textcolor{color1}{\rmfamily\textperiodcentered}}% alternative: \textasteriskcentered; the \rmfamily is required to force Latin Modern fonts when using sans serif, as OMS/lmss/m/n is not defined and gets substituted by OMS/cmsy/m/n +\newcommand*{\labelitemiv}{\labelitemiii} % enumerate labels \renewcommand{\theenumi}{\@arabic\c@enumi} \renewcommand{\theenumii}{\@alph\c@enumii} @@ -212,15 +241,19 @@ % other symbols \newcommand*{\listitemsymbol}{\labelitemi~} \newcommand*{\addresssymbol}{} -\newcommand*{\mobilesymbol}{\Mobilefone~} -\newcommand*{\phonesymbol}{\Telefon~} -\newcommand*{\faxsymbol}{\FAX~} -\newcommand*{\emailsymbol}{\Letter~} -\newcommand*{\homepagesymbol}{{\Large\ComputerMouse}~} +\newcommand*{\mobilesymbol}{} +\newcommand*{\phonesymbol}{} +\newcommand*{\faxsymbol}{} +\newcommand*{\emailsymbol}{} +\newcommand*{\homepagesymbol}{} % fonts \AtBeginDocument{\normalfont\color{color0}} +% strings for internationalisation +\newcommand*{\refname}{Publications} +\newcommand*{\enclname}{Enclosure} + % makes the footer (normally used both for the resume and the letter) % usage: \makefooter \newcommand*{\makefooter}{}% @@ -337,7 +370,6 @@ {\href{mailto:#2}{#1}}} % thebibliography environment, for use with BibTeX and possibly multibib -\newcommand*{\refname}{Publications} \newlength{\bibindent} \setlength{\bibindent}{1.5em} % bibliography item label @@ -405,22 +437,25 @@ \renewcommand*{\date}[1]{\def\@date{#1}} \newcommand*{\opening}[1]{\def\@opening{#1}} \newcommand*{\closing}[1]{\def\@closing{#1}} -\newcommand*{\enclosure}[1]{\def\@enclosure{#1}} +\newcommand*{\enclosure}[2][]{% + % if an optional argument is provided, use it to redefine \enclname + \ifthenelse{\equal{#1}{}}{}{\renewcommand*{\enclname}{#1}}% + \def\@enclosure{#2}} % recompute all letter lengths \newcommand*{\recomputeletterlengths}{} % makes the letter title % usage: \makelettertitle -\newcommand*{\makelettertitle}{}% +\newcommand*{\makelettertitle}{} % makes the letter footer % usage: \makeletterfooter -\newcommand*{\makeletterfooter}{\makefooter}% +\newcommand*{\makeletterfooter}{\makefooter} % makes the letter closing % usage: \makeletterclosing -\newcommand*{\makeletterclosing}{}% +\newcommand*{\makeletterclosing}{} \endinput |