~xdanaux/moderncv/trunk

« back to all changes in this revision

Viewing changes to moderncvstylebanking.sty

  • Committer: Xavier Danaux
  • Date: 2014-02-01 14:48:24 UTC
  • Revision ID: xdanaux@gmail.com-20140201144824-hzb1bdelo6h2jcbo
Added the "centeredrule" variant to the banking style

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
%                identification
11
11
%-------------------------------------------------------------------------------
12
12
\NeedsTeXFormat{LaTeX2e}
13
 
\ProvidesPackage{moderncvstylebanking}[2013/04/29 v1.5.1 modern curriculum vitae and letter style scheme: bank]
 
13
\ProvidesPackage{moderncvstylebanking}[2013/04/29 v1.5.1 modern curriculum vitae and letter style scheme: banking]
14
14
 
15
 
\newcommand*{\sectionrule}{}
16
 
\newcommand*{\subsectionrule}{}
17
 
\DeclareOption{fullrules}{
18
 
  \renewcommand*{\sectionrule}{\par\nobreak\vspace*{-.7\baselineskip}\leavevmode{\color{color1}\leaders\hbox{\rule{1pt}{0.4pt}}\hfill\kern0pt}}
19
 
  \renewcommand*{\subsectionrule}{\par\nobreak\vspace*{-.7\baselineskip}\leavevmode{\color{color1}\xleaders\hbox to 0.35em{\scriptsize.}\hfill}}}% different subsectionrules will not be perfectly aligned, but remaining space at the end of the fill will be distributed evenly between leaders, so it will be barely visible}
20
 
\DeclareOption{shortrules}{
21
 
  \renewcommand*{\sectionrule}{\leavevmode{\color{color1}\leaders\hbox{\rule{1pt}{0.4pt}}\hfill\kern0pt}}
22
 
  \renewcommand*{\subsectionrule}{\leavevmode{\color{color1}\xleaders\hbox to 0.35em{\scriptsize.}\hfill}}}% different subsectionrules will not be perfectly aligned, but remaining space at the end of the fill will be distributed evenly between leaders, so it will be barely visible}}
23
 
\DeclareOption{mixedrules}{
24
 
  \renewcommand*{\sectionrule}{\par\nobreak\vspace*{-.7\baselineskip}\leavevmode{\color{color1}\leaders\hbox{\rule{1pt}{0.4pt}}\hfill\kern0pt}}
25
 
  \renewcommand*{\subsectionrule}{\leavevmode{\color{color1}\xleaders\hbox to 0.35em{\scriptsize.}\hfill}}}% different subsectionrules will not be perfectly aligned, but remaining space at the end of the fill will be distributed evenly between leaders, so it will be barely visible}}
26
 
\DeclareOption{norules}{
27
 
  \renewcommand*{\sectionrule}{}
28
 
  \renewcommand*{\subsectionrule}{}}
 
15
\newif\if@fullrules\@fullrulesfalse
 
16
\DeclareOption{fullrules}{\@fullrulestrue\@mixedrulesfalse}
 
17
\newif\if@shortrules\@shortrulesfalse
 
18
\DeclareOption{shortrules}{\@shortrulestrue\@mixedrulesfalse}
 
19
\newif\if@mixedrules\@mixedrulesfalse
 
20
\DeclareOption{mixedrules}{\@mixedrulestrue}
 
21
\newif\if@centeredrules\@centeredrulesfalse
 
22
\DeclareOption{centeredrules}{\@centeredrulestrue\@mixedrulesfalse}
 
23
\newif\if@norules\@norulesfalse
 
24
\DeclareOption{norules}{\@norulestrue\@mixedrulesfalse}
29
25
 
30
26
\ExecuteOptions{mixedrules}
31
27
\ProcessOptions\relax
123
119
\renewcommand*{\titlefont}{\Huge\mdseries\upshape}
124
120
\renewcommand*{\addressfont}{\normalsize\mdseries\upshape}
125
121
\renewcommand*{\quotefont}{\large\slshape}
126
 
\renewcommand*{\sectionfont}{\Large\bfseries\upshape}
127
 
\renewcommand*{\subsectionfont}{\large\upshape\fontseries{sb}\selectfont}
 
122
\renewcommand*{\sectionfont}{%
 
123
  \if@norules%
 
124
    \Large\bfseries\scshape%
 
125
  \else%
 
126
    \Large\bfseries\upshape\fi}
 
127
\renewcommand*{\subsectionfont}{%
 
128
  \if@norules%
 
129
    \large\mdseries\itshape%
 
130
  \else%
 
131
    \large\upshape\fontseries{sb}\selectfont\fi}
128
132
\renewcommand*{\hintfont}{\bfseries}
129
133
 
130
134
% styles
132
136
\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2!85}{#1}}}
133
137
\renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}}
134
138
\renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}}
135
 
\renewcommand*{\sectionstyle}[1]{{\sectionfont\textcolor{color1}{#1}}}
136
 
\renewcommand*{\subsectionstyle}[1]{{\subsectionfont\textcolor{color1}{#1}}}
 
139
\renewcommand*{\sectionstyle}[1]{%
 
140
  \if@centeredrules%
 
141
    {\centering\sectionfont\textcolor{color1}{#1}\par}%
 
142
  \else
 
143
    {\sectionfont\textcolor{color1}{#1}}\fi}
 
144
\renewcommand*{\subsectionstyle}[1]{%
 
145
  \if@centeredrules%
 
146
    {\centering\subsectionfont\textcolor{color1}{#1}\par}%
 
147
  \else
 
148
    {\subsectionfont\textcolor{color1}{#1}}\fi}
137
149
\renewcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}
138
150
 
139
151
% lengths
193
205
  \subsectionrule%
194
206
  \par\nobreak\addvspace{0.5ex}\@afterheading}
195
207
 
 
208
\newcommand*{\sectionrule}{}
 
209
\newcommand*{\subsectionrule}{}
 
210
\if@fullrules%
 
211
  \renewcommand*{\sectionrule}{\par\nobreak\vspace*{-.7\baselineskip}\leavevmode{\color{color1}\leaders\hbox{\rule{1pt}{0.4pt}}\hfill\kern0pt}}
 
212
  \renewcommand*{\subsectionrule}{\par\nobreak\vspace*{-.7\baselineskip}\leavevmode{\color{color1}\xleaders\hbox to 0.35em{\scriptsize.}\hfill}}\fi% different subsectionrules will not be perfectly aligned, but remaining space at the end of the fill will be distributed evenly between leaders, so it will be barely visible}
 
213
\if@shortrules%
 
214
  \renewcommand*{\sectionrule}{\leavevmode{\color{color1}\leaders\hbox{\rule{1pt}{0.4pt}}\hfill\kern0pt}}
 
215
  \renewcommand*{\subsectionrule}{\leavevmode{\color{color1}\xleaders\hbox to 0.35em{\scriptsize.}\hfill}}\fi% different subsectionrules will not be perfectly aligned, but remaining space at the end of the fill will be distributed evenly between leaders, so it will be barely visible}}
 
216
\if@mixedrules%
 
217
  \renewcommand*{\sectionrule}{\par\nobreak\vspace*{-.7\baselineskip}\leavevmode{\color{color1}\leaders\hbox{\rule{1pt}{0.4pt}}\hfill\kern0pt}}
 
218
  \renewcommand*{\subsectionrule}{\leavevmode{\color{color1}\xleaders\hbox to 0.35em{\scriptsize.}\hfill}}\fi% different subsectionrules will not be perfectly aligned, but remaining space at the end of the fill will be distributed evenly between leaders, so it will be barely visible}}
 
219
\if@centeredrules%
 
220
  \renewcommand*{\sectionrule}{\par\nobreak\vspace*{-.7\baselineskip}\leavevmode{\color{color1}\leaders\hbox{\rule{1pt}{0.4pt}}\hfill\kern0pt}}
 
221
  \renewcommand*{\subsectionrule}{\par\nobreak\vspace*{-.7\baselineskip}\leavevmode{\color{color1}\xleaders\hbox to 0.35em{\scriptsize.}\hfill}}\fi% similar to full rules
 
222
\if@norules%
 
223
  \renewcommand*{\sectionrule}{}
 
224
  \renewcommand*{\subsectionrule}{}\fi
 
225
 
196
226
\renewcommand*{\cvitem}[3][.25em]{%
197
227
  \ifthenelse{\equal{#2}{}}{}{\hintstyle{#2}: }{#3}%
198
228
  \par\addvspace{#1}}