moderncvbodyiv.sty 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. %% start of file `moderncvbodyiv.sty'.
  2. %% Copyright 2006-2015 Xavier Danaux (xdanaux@gmail.com).
  3. %
  4. % This work may be distributed and/or modified under the
  5. % conditions of the LaTeX Project Public License version 1.3c,
  6. % available at http://www.latex-project.org/lppl/.
  7. %-------------------------------------------------------------------------------
  8. % identification
  9. %-------------------------------------------------------------------------------
  10. \NeedsTeXFormat{LaTeX2e}
  11. \ProvidesPackage{moderncvbodyiv}[2015/07/28 v2.0.0 modern curriculum vitae and letter body variant: 4]
  12. %-------------------------------------------------------------------------------
  13. % required packages
  14. %-------------------------------------------------------------------------------
  15. %-------------------------------------------------------------------------------
  16. % overall body definition
  17. %-------------------------------------------------------------------------------
  18. % fonts
  19. \renewcommand*{\sectionfont}{\Large\bfseries\upshape}
  20. \renewcommand*{\subsectionfont}{\large\bfseries\itshape}
  21. \renewcommand*{\hintfont}{\bfseries}
  22. % styles
  23. \renewcommand*{\sectionstyle}[1]{{\sectionfont\textcolor{color1}{#1}}}
  24. \renewcommand*{\subsectionstyle}[1]{{\subsectionfont\textcolor{color1}{#1}}}
  25. \renewcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}
  26. %-------------------------------------------------------------------------------
  27. % resume body definition
  28. %-------------------------------------------------------------------------------
  29. % lengths
  30. % used by \cvitem (and all children command)
  31. \@initializelength{\hintscolumnwidth} \setlength{\hintscolumnwidth}{0.3\textwidth}
  32. \@initializelength{\separatorcolumnwidth} \setlength{\separatorcolumnwidth}{0.025\textwidth}
  33. \@initializelength{\maincolumnwidth}
  34. % used by \cvdoubleitem
  35. \@initializelength{\doubleitemcolumnwidth}
  36. % used by \cvlistitem
  37. \@initializelength{\listitemsymbolwidth} \settowidth{\listitemsymbolwidth}{\listitemsymbol}
  38. \@initializelength{\listitemcolumnwidth}
  39. % used by \cvlistdoubleitem
  40. \@initializelength{\listdoubleitemcolumnwidth}
  41. % commands
  42. \renewcommand*{\recomputecvbodylengths}{%
  43. % body lengths
  44. \setlength{\maincolumnwidth}{\textwidth-\leftskip-\rightskip}%
  45. \setlength{\listitemcolumnwidth}{\maincolumnwidth-\listitemsymbolwidth}%
  46. \setlength{\doubleitemcolumnwidth}{\maincolumnwidth-\separatorcolumnwidth}%
  47. \setlength{\doubleitemcolumnwidth}{0.5\doubleitemcolumnwidth}%
  48. \setlength{\listdoubleitemcolumnwidth}{\maincolumnwidth-\listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}%
  49. \setlength{\listdoubleitemcolumnwidth}{0.5\listdoubleitemcolumnwidth}%
  50. % regular lengths
  51. \setlength{\parskip}{0\p@}}
  52. \RenewDocumentCommand{\section}{sm}{%
  53. \par\addvspace{2.5ex}%
  54. \phantomsection{}% reset the anchor for hyperrefs
  55. \addcontentsline{toc}{section}{#2}%
  56. \strut\sectionstyle{#2}%
  57. \par\nobreak\addvspace{1ex}\@afterheading}
  58. \RenewDocumentCommand{\subsection}{sm}{%
  59. \par\addvspace{1ex}%
  60. \phantomsection{}%
  61. \addcontentsline{toc}{subsection}{#2}%
  62. \strut\subsectionstyle{#2}%
  63. \par\nobreak\addvspace{0.5ex}\@afterheading}
  64. \renewcommand*{\cvitem}[3][.25em]{%
  65. \ifthenelse{\equal{#2}{}}{}{\hintstyle{#2}: }{#3}%
  66. \par\addvspace{#1}}
  67. \renewcommand*{\cvdoubleitem}[5][.25em]{%
  68. \begin{minipage}[t]{\doubleitemcolumnwidth}\hintstyle{#2}: #3\end{minipage}%
  69. \hfill% fill of \separatorcolumnwidth
  70. \begin{minipage}[t]{\doubleitemcolumnwidth}\ifthenelse{\equal{#4}{}}{}{\hintstyle{#4}: }#5\end{minipage}%
  71. \par\addvspace{#1}}
  72. \renewcommand*{\cvlistitem}[2][.25em]{%
  73. \cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listitemcolumnwidth}#2\end{minipage}}}
  74. \renewcommand*{\cvlistdoubleitem}[3][.25em]{%
  75. \cvitem[#1]{}{\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#2\end{minipage}%
  76. \hfill% fill of \separatorcolumnwidth
  77. \ifthenelse{\equal{#3}{}}%
  78. {}%
  79. {\listitemsymbol\begin{minipage}[t]{\listdoubleitemcolumnwidth}#3\end{minipage}}}}
  80. \@initializebox{\cventryyearbox}
  81. \@initializelength{\cventrytitleboxwidth}
  82. \renewcommand*{\cventry}[7][.25em]{%
  83. \savebox{\cventryyearbox}{%
  84. \hspace*{2\separatorcolumnwidth}%
  85. \hintstyle{#2}}%
  86. \setlength{\cventrytitleboxwidth}{\widthof{\usebox{\cventryyearbox}}}%
  87. \setlength{\cventrytitleboxwidth}{\maincolumnwidth-\cventrytitleboxwidth}%
  88. \begin{minipage}{\maincolumnwidth}%
  89. \parbox[t]{\cventrytitleboxwidth}{%
  90. \strut%
  91. {\bfseries#3}%
  92. \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
  93. \ifthenelse{\equal{#5}{}}{}{, #5}%
  94. \ifthenelse{\equal{#6}{}}{}{, #6}%
  95. .\strut}%
  96. \usebox{\cventryyearbox}%
  97. \end{minipage}\strut%
  98. \ifx&#7&%
  99. \else{%
  100. \newline{}%
  101. \strut%
  102. \begin{minipage}[t]{\maincolumnwidth}%
  103. \small%
  104. #7%
  105. \end{minipage}}\fi%
  106. \par\addvspace{#1}}
  107. \@initializebox{\cvitemwithcommentmainbox}
  108. \@initializelength{\cvitemwithcommentmainlength}
  109. \@initializelength{\cvitemwithcommentcommentlength}
  110. \renewcommand*{\cvitemwithcomment}[4][.25em]{%
  111. \savebox{\cvitemwithcommentmainbox}{\ifthenelse{\equal{#2}{}}{}{\hintstyle{#2}: }#3}%
  112. \setlength{\cvitemwithcommentmainlength}{\widthof{\usebox{\cvitemwithcommentmainbox}}}%
  113. \setlength{\cvitemwithcommentcommentlength}{\maincolumnwidth-\separatorcolumnwidth-\cvitemwithcommentmainlength}%
  114. \begin{minipage}[t]{\cvitemwithcommentmainlength}\usebox{\cvitemwithcommentmainbox}\end{minipage}%
  115. \hfill% fill of \separatorcolumnwidth
  116. \begin{minipage}[t]{\cvitemwithcommentcommentlength}\raggedleft\small\itshape#4\end{minipage}%
  117. \par\addvspace{#1}}
  118. \renewenvironment{thebibliography}[1]%
  119. {%
  120. \bibliographyhead{\refname}%
  121. % \small%
  122. \begin{list}{\bibliographyitemlabel}%
  123. {%
  124. \setlength{\topsep}{0pt}%
  125. \setlength{\labelwidth}{\hintscolumnwidth}%
  126. \setlength{\labelsep}{\separatorcolumnwidth}%
  127. \leftmargin\labelwidth%
  128. \advance\leftmargin\labelsep%
  129. \@openbib@code%
  130. \usecounter{enumiv}%
  131. \let\p@enumiv\@empty%
  132. \renewcommand\theenumiv{\@arabic\c@enumiv}}%
  133. \sloppy%
  134. \clubpenalty4000%\@clubpenalty \clubpenalty%
  135. \widowpenalty4000%
  136. \sfcode`\.\@m%
  137. \sfcode `\=1000\relax}%
  138. {%
  139. \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
  140. \end{list}}
  141. %-------------------------------------------------------------------------------
  142. % letter style definition
  143. %-------------------------------------------------------------------------------
  144. % commands
  145. \renewcommand*{\recomputeletterbodylengths}{%
  146. \recomputecvbodylengths%
  147. \setlength{\parskip}{6\p@}}
  148. \renewcommand*{\makeletterclosing}{
  149. \@closing\\[3em]%
  150. {\bfseries\@firstname~\@lastname}%
  151. \ifthenelse{\isundefined{\@enclosure}}{}{%
  152. \\%
  153. \vfil%
  154. {\color{color2}\itshape\enclname: \@enclosure}}%
  155. \vfil}
  156. \endinput
  157. %% end of file `moderncvbodyiv.sty'.