summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/third/letter/style/modern.nrs
blob: cceb25deaa03d55355d9bf9851ab20ac24701104 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
%D \module
%D   [       file=modern,
%D        version=2009.02.13,
%D          title=\CONTEXT\ Resume Style,
%D       subtitle=Modern Style,
%D         author=Wolfgang Schuster,
%D           date=\currentdate,
%D      copyright=Wolfgang Schuster,
%D          email=schuster.wolfgang@googlemail.com,
%D        license=Public Domain]

\unprotect

\useresumestyle[default]

\setupcolors[\c!state=\v!start]

\definemeasure[quotewidth]                   [.65\textwidth]
\definemeasure[separatorcolumnwidth]         [.025\textwidth]
\definemeasure[hintscolumnwidth]             [.15\textwidth]
\definemeasure[maincolumnwidth]              [\dimexpr\textwidth-\measure{separatorcolumnwidth}-\measure{hintscolumnwidth}\relax]
\definemeasure[doubleitemmaincolumnwidth]    [\dimexpr(\measure{maincolumnwidth}-\measure{hintscolumnwidth}-\measure{separatorcolumnwidth})/2\relax]
\definemeasure[listitemsymbolwidth]          [2em] % LaTeX assingnment is not possible in ConTeXt
\definemeasure[listitemmaincolumnwidth]      [\dimexpr\measure{maincolumnwidth}-\measure{listitemsymbolwidth}\relax]
\definemeasure[listdoubleitemmaincolumnwidth][\dimexpr.475\measure{listitemmaincolumnwidth}\relax]

\def\ModerncvSectionCommand#1#2%
  {\hbox to \hsize
     {\blackrule[\c!width=\measure{hintscolumnwidth},\c!height=1ex,\c!depth=-.5ex,\c!color=resume:6]%
      \hskip\measure{separatorcolumnwidth}%
      \vtop{\hsize\measure{maincolumnwidth}#2}}}

\setuphead
  [\v!section]
  [\c!color=resume:7,
   \c!incrementnumber=\v!no,
   \c!before={\blank[2*\v!medium]},
   \c!after={\blank[\v!medium]},
   \c!command=\ModerncvSectionCommand]

\def\ModerncvSubsectionCommand#1#2%
  {\hbox to \hsize
     {\hskip\dimexpr\measure{hintscolumnwidth}+\measure{separatorcolumnwidth}\relax
      \vtop{\hsize\measure{maincolumnwidth}#2}}}

\setuphead
  [\v!subsection]
  [\c!color=resume:8,
   \c!incrementnumber=\v!no,
   \c!before={\blank[2*\v!medium]},
   \c!after={\blank[\v!medium]},
   \c!command=\ModerncvSubsectionCommand]

%D Moderncv compatible commands for the user data.

\def\cvline
  {\dosingleempty\docvline}

\def\docvline[#1]#2#3%
  {\starttable[s0|s0rp(\measure{hintscolumnwidth})|s0w(\measure{separatorcolumnwidth})|s0p(\measure{maincolumnwidth})|]
   \NC\doifelsenothing{#2}{~}{#2}\NC\NC#3\NC\NR
   \stoptable
   \doifelsenothing{#1}{\blank[.25em]}{\blank[#1]}}

\def\cvdoubleitem#1#2#3#4%
  {\cvline{#1}
     {\hbox\bgroup
        \vtop{\hsize\measure{doubleitemmaincolumnwidth}#2}%
        \hfill
        \vtop{\hsize\measure{hintscolumnwidth}\raggedleft#3}%
        \hskip\measure{separatorcolumnwidth}%
        \vtop{\hsize\measure{doubleitemmaincolumnwidth}#4}%
      \egroup}}

\def\cvlistitem
  {\dosingleempty\docvlistitem}

\def\docvlistitem[#1]#2% default symbol is \textbullet and not \endash
  {\cvline[none]{}{\doifelsenothing{#1}{--}{#1}~\vtop{\hsize\measure{listitemmaincolumnwidth}#2}}}

\def\cvlistdoubleitem
  {\dosingleempty\docvlistdoubleitem}

\def\docvlistdoubleitem[#1]#2#3%
  {\cvline[none]{}%
     {\hbox\bgroup
        \doifelsenothing{#1}{--}{#1}~\vtop{\hsize\measure{listdoubleitemmaincolumnwidth}#2}%
        \hfill
        \doifsomething{#3}{\doifelsenothing{#1}{--}{#1}~\vtop{\hsize\measure{listdoubleitemmaincolumnwidth}#3}}%
      \egroup}}

\def\cventry#1#2#3#4#5#6%
  {\cvline{#1}
     {{\bf#2}%
      \doifsomething{#3}{, {\it#3}}%
      \doifsomething{#4}{, {#4}}%
      \doifsomething{#5}{, {#5}}%
      .%
      %\doifsomething{#6}{\crlf\vtop{\hsize\measure{maincolumnwidth}\tx#6}}}}% should also work without the box
      \doifsomething{#6}{\crlf\tx#6}}}

\def\cvlanguage#1#2#3%
  {\cvline{#1}
     {\hbox\bgroup
        \vtop{\hsize\dimexpr.225\measure{maincolumnwidth}\relax\bf#2}%
        \hfill
        \vtop{\hsize\dimexpr.725\measure{maincolumnwidth}\relax\raggedleft\itx#3}%
      \egroup}}

\def\cvcomputer#1#2#3#4%
  {\cvdoubleitem{#1}{\tx#2}{#3}{\tx#4}}

%D Page optimation, change the topspace to produce a distance of 2.5em
%D between the bottom of the header and the first line of text.

\newdimen\resume!height!head

\startsetups[\v!resume:\v!optimize]

  \setbox\scratchbox\vbox{\getvalue{\v!resume:\v!head:\@@@@rsheadalternative}}

  \ifdim\htdp\scratchbox>\zeropoint

    \global\resume!height!head\htdp\scratchbox

    \setupresumestyle
      [\v!firstpage]
      [\c!topspace=\dimexpr\resume!height!head+\resumestylevalue{\v!head\v!layer}\c!voffset+2.5em\relax]

  \fi

\stopsetups

\setupresumestyle
  [\v!firstpage,\v!secondpage]
  [\c!backspace=20mm,
   \c!width=168mm,
   \c!header=0pt,
   \c!footer=0pt,
   \c!topspace=30mm,
   \c!bottomspace=40mm,
   \c!height=\v!fit]

\setupresumestyle
  [\v!head,\v!foot]
  [\c!state=\v!start]

\setupresumestyle
  [\v!nexthead,\v!nextfoot]
  [\c!state=\v!next]

\protect \endinput