xetexCV.cls 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. % This example document class is based on the Typesetting your
  2. % academic CV in LaTeX by Dario Taraborelli. The original article
  3. % is avaiable at http://nitens.org/taraborelli/cvtex
  4. %
  5. % Additional modifications made by Robert Oakes. Copyright 2009.
  6. \NeedsTeXFormat{LaTeX2e}
  7. \ProvidesClass{xetexCV}[2009/11/15 - Modern looking resume which
  8. uses the xetex typesetting system.]
  9. % Load the Base Class
  10. \LoadClassWithOptions{article}
  11. % Begin Requirements
  12. \RequirePackage{ifthen}
  13. \RequirePackage{fontspec}
  14. \RequirePackage{xunicode}
  15. \RequirePackage{xltxtra}
  16. \RequirePackage{graphicx}
  17. \RequirePackage[colorlinks,unicode=true,xetex,unicode=true]{hyperref}
  18. \hypersetup{linkcolor=blue,citecolor=blue,filecolor=black,urlcolor=blue}
  19. % Fonts
  20. \defaultfontfeatures{Mapping=tex-text}
  21. \setromanfont [Ligatures={Common}, BoldFont={Fontin Bold}, ItalicFont={Fontin Italic}]{Fontin}
  22. \setsansfont [Ligatures={Common}, BoldFont={Fontin Sans Bold}, ItalicFont={Fontin Sans Italic}]{Fontin Sans}
  23. % Custom Document Formatting
  24. \newcommand\decorativeline[1][1pt]{%
  25. \par\noindent%
  26. \rule[0.5ex]{\linewidth}{#1}\par}
  27. \pagestyle{empty}
  28. \hyphenpenalty=5000
  29. \tolerance=1000
  30. % CV and Contact Information
  31. \def\@cvname{\relax}
  32. \newcommand{\cvname}[1]{\gdef\@cvname{#1}}
  33. \def\@cvimage{\relax}
  34. \newcommand{\cvimage}[1]{\gdef\@cvimage{#1}}
  35. \def\@institution{\relax}
  36. \newcommand{\institution}[1]{\gdef\@institution{#1}}
  37. \def\@contactaddress{\relax}
  38. \newcommand{\contactaddress}[1]{\gdef\@contactaddress{#1}}
  39. \def\@phonenumber{\relax}
  40. \newcommand{\phonenumber}[1]{\gdef\@phonenumber{#1}}
  41. \def\@faxnumber{\relax}
  42. \newcommand{\faxnumber}[1]{\gdef\@faxnumber{#1}}
  43. \def\@email{\relax}
  44. \newcommand{\email}[1]{\gdef\@email{#1}}
  45. \newcommand\@website{\relax}
  46. \newcommand{\website}[1]{\gdef\@website{#1}}
  47. % Set the Paper Size and Margins
  48. \RequirePackage{geometry}
  49. \geometry{letterpaper, textwidth=5.5in, textheight=8.5in, marginparsep=1.0pt, marginparwidth=2.0in, margin=1.0in}
  50. \setlength\parindent{0in}
  51. % Spcial Commands for Fancy Characters and Years
  52. \newcommand{\amper}{{\fontspec[Scale=.95]{Hoefler Text}\selectfont\itshape\&}}
  53. \newcommand{\years}[1]{\marginpar{\hspace{5.13cm}\parbox{3.0cm}{\emph{#1}}}}
  54. % Headings and Heading Fonts
  55. \RequirePackage[normalem]{ulem}
  56. \renewcommand\section{\@startsection{section}{1}{\z@}%
  57. {-3.5ex \@plus -1ex \@minus -.2ex \vspace{1mm}}%
  58. {0.5mm}%
  59. {\sffamily\large\bfseries}}
  60. \renewcommand\subsection{\@startsection{subsection}{1}{\z@}%
  61. {-3.5ex \@plus -1ex \@minus -.2ex}%
  62. {3.0mm}%
  63. {\sffamily\mdseries}}
  64. \newcommand{\cvsection}[1]{\leftskip 0cm
  65. \section*{#1}\decorativeline\marginpar{\vspace{0.3ex}}
  66. \leftskip 116pt}
  67. \newcommand{\cvsubsection}[1]{\leftskip 0cm \vspace{-0.2cm}
  68. \subsection*{#1}\vspace{1.0mm} \leftskip 116pt}
  69. \reversemarginpar
  70. \newcommand\makecvtitle{
  71. \ifthenelse{\equal{\@cvimage}{\relax}}
  72. { % Create Without Image
  73. \ifthenelse{\equal{\@cvname}{\relax}}{}
  74. {\textsf{\LARGE\bfseries \@cvname}\decorativeline\vspace{0.3cm}}
  75. \leftskip 116pt
  76. % Contact Information and Other Details
  77. \ifthenelse{\equal{\@institution}{\relax}}{}
  78. {\bfseries{\@institution}\\}
  79. \ifthenelse{\equal{\@contactaddress}{\relax}}{}
  80. {\mdseries \@contactaddress\\[0.2cm]}
  81. \ifthenelse{\equal{\@phonenumber}{\relax}}{}
  82. {Phone: \texttt{\@phonenumber}\\}
  83. \ifthenelse{\equal{\@faxnumber}{\relax}}{}
  84. {Fax: \texttt{\@faxnumber}\\[0.2cm]}
  85. \ifthenelse{\equal{\@email}{\relax}}{}
  86. {Email: \href{mailto:\@email}{\@email}\\}
  87. \ifthenelse{\equal{\@website}{\relax}}{}
  88. {Website: \href{\@website}{\@website}}}
  89. {% Create With Image
  90. \ifthenelse{\equal{\@cvname}{\relax}}{}
  91. {\textsf{\LARGE\bfseries \@cvname}\decorativeline\vspace{0.3cm}}
  92. \begin{minipage}{6in}
  93. \begin{minipage}{114pt}
  94. \resizebox*{100pt}{!}{\includegraphics{\@cvimage}}
  95. \end{minipage}
  96. \begin{minipage}{4in}
  97. \ifthenelse{\equal{\@institution}{\relax}}{}{\bfseries\@institution\\}
  98. \mdseries\@contactaddress\\[0.2cm]
  99. \ifthenelse{\equal{\@phonenumber}{\relax}}{}{Phone: \texttt{\@phonenumber}\\}
  100. \ifthenelse{\equal{\@faxnumber}{\relax}}{}{Fax: \texttt{\@faxnumber}\\[0.2cm]}
  101. \ifthenelse{\equal{\@email}{\relax}}{}{Email: \href{mailto:\@email}{\@email}\\}
  102. \ifthenelse{\equal{\@website}{\relax}}{}{Website: \href{\@website}{\@website}\\}
  103. \end{minipage}
  104. \end{minipage}
  105. }}