-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tex
166 lines (145 loc) · 4.02 KB
/
main.tex
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
153
154
155
156
157
158
159
160
161
162
163
164
165
\documentclass[a4paper]{article}
\input{setup.tex}
\input{fonts/fonts.tex}
\ifdefined\cvlang\else\def\cvlang{da}\fi
\directlua{ LANG = \cvlang }
\directlua{ CONFIG = require'./index.lua'.config }
\directlua{ GET_VAR = require'./config/get-var.lua' }
\def\cvvar#1{
\directlua{
tex.sprint(GET_VAR(CONFIG.#1, "\cvlang"))
}
}
\def\cventranceloop#1{%
\directlua{
for _,v in pairs(CONFIG.#1) do tex.sprint(
"\\cventrance{" ..
GET_VAR(v.where, "\cvlang" ) ..
"}{" ..
GET_VAR(v.from, "\cvlang" ) ..
"}{" ..
GET_VAR(v.to, "\cvlang" ) ..
"}{" ..
GET_VAR(v.description, "\cvlang" ) ..
"}"
)
end
}%
}
\def\cventrance#1#2#3#4{
\vspace{3mm}
\begin{minipage}{0.7\textwidth}
{\Large#1}\\#4
\end{minipage}\hfill
\begin{minipage}{0.2\textwidth}
\flushright
#2\\#3
\end{minipage}
\par
}
\def\cvlanguageloop#1{
\directlua{
for _,v in pairs(CONFIG.#1) do tex.sprint(
"\\cvlanguage{"
.. GET_VAR(v.language, "\cvlang")
.. "}{"
.. GET_VAR(v.level, "\cvlang")
.. "}"
)
end
}
}
\def\cvlanguage#1#2{
#1 | #2 \\
}
\def\cvprogrammingloop#1{
\begin{multicols}{2}
\directlua{%
for _,v in pairs(CONFIG.#1) do tex.sprint(
"\\cvprogrammingbox{"
.. v.language
.. "}{"
.. v.level
.. "}"
)
end
}%
\end{multicols}
}
\def\cvprogrammingbox#1#2{
\begin{tikzpicture}
\node[draw, fill = green!#20!red, rounded corners](level){
#2
};
\node[right = 0pt of level]{#1};
\end{tikzpicture}
\\
}
\def\cveducation{
\cvtextmoveout{\Huge\cvvar{education.title}}\\
\cventranceloop{education.entrances}
}
\def\cvexperience{
\cvtextmoveout{\Huge\cvvar{experience.title}}\\
\cventranceloop{experience.entrances}
}
\def\cvinformation{
\cvtextmoveout{\Huge\cvvar{information.title}}\\
\cvvar{information.text}
}
\def\cvcontact{
\cvtextmoveout{\Large\cvvar{contact.title}}\\
\cvvar{contact.email.title}:\cvvar{contact.email.value}\\
\cvvar{contact.phone.title}:\cvvar{contact.phone.value}\\
}
\def\cvlanguages {
\cvtextmoveout{\Large\cvvar{languages.title}}\\
\cvlanguageloop{languages.entrances}
}
\def\cvprogramming {
\cvtextmoveout{\Large\cvvar{programming.title}}\\
\cvvar{programming.description}\\
\cvprogrammingloop{programming.entrances}
}
\def\cvsplit{\pagewidth / 1.618}
\def\cvmargin{8mm}
\def\cvtextmovein{\hspace{5pt}}
\def\cvtextmoveout{\hspace{-5pt}}
\begin{document}
\pagestyle{empty}
\tikzset{
cv text right/.style = { text width = \cvsplit - \cvmargin, inner xsep = .33cm },
cv text left/.style = { text width = \pagewidth - \cvsplit - \cvmargin}
}
\begin{tikzpicture}[remember picture, overlay]
%% Initialize
\coordinate (split-north) at ($ (current page.north east) - (\cvsplit, 0)$);
\coordinate (split-south) at ($ (current page.south east) - (\cvsplit, 0)$);
%% Background
\fill[red!10!white] (current page.north west)
rectangle (split-south);
%% Draw right
\node[anchor = north west, cv text right](name) at ($(split-north) - (0, \cvmargin)$){\cvtextmoveout\Huge\bf\cvvar{name}};
\node[below = of name.south west, anchor = north west, cv text right](experience){\cvexperience};
\node[below = of experience.south west, anchor = north west, cv text right](education){\cveducation};
%\node[below = of education.south west, anchor = north west, cv text right](information){\cvinformation};
%% Draw left
\node[anchor = north east, cv text left, rounded corners](picture) at ($(split-north) - (0, \cvmargin)$){
\begin{center}
\includegraphics[width=\textwidth, angle=-90]{./img/me.jpg}
\end{center}
};
\node[below = 0pt of picture.south west, anchor = north west, cv text left](contact information){\cvcontact};
\node[anchor = north west, cv text left](languages) at (contact information.south west){\cvlanguages};
\node[anchor = north west, cv text left](programming) at (languages.south west){
\cvprogramming
};
%% Draw footer
\node[below = of education.south west, anchor = north west, cv text right](experience)
{\small\cvtextmoveout\cvvar{link}};
%% Finish
\draw [ultra thick]
(split-north)
-- (split-south);
\end{tikzpicture}
\end{document}