summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pas-cv/macro-univers.tex
blob: f190e5215bbc883450b541260a17e06d728f7587 (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
\def\modele@univers{univers}
\def\cv@h@univers{5}

% =============== FOND ===============
\newcommand*\fond@univers{%
	\ifx\cmdPAS@bg@pic\@empty%
	\else
		\ifx\cmdPAS@bg@borderpic\@empty
			\node[circle,fill=\cmdPAS@bg@bordercolor,inner sep=5pt] (photo) at (2.5,-.5*\cv@h@univers) {\includegraphics[scale=\cmdPAS@bg@scalepic]{\cmdPAS@bg@pic}};
		\else
			\node[circle,fill=\cmdPAS@bg@bordercolor,inner sep=5pt] (photo) at (2.5,-.5*\cv@h@univers) {\phantom{\includegraphics[scale=\cmdPAS@bg@scalepic]{\cmdPAS@bg@pic}}};
			\node[draw=\cmdPAS@bg@borderpic,very thick,inner sep=1pt] at (2.5,-.5*\cv@h@univers) {\includegraphics[scale=\cmdPAS@bg@scalepic]{\cmdPAS@bg@pic}};
		\fi
	\fi
	\draw[decorate,decoration={random steps,segment length=2mm},fill=\cmdPAS@bg@bgcolor] (-.5,-\cv@h@univers+.5) rectangle +(1.1\paperwidth,-2);
	\foreach \i in {1,...,100}
	{
		\pgfmathparse{21*rnd}\let\x\pgfmathresult
		\pgfmathparse{-\cv@h@univers+.5-2*rnd}\let\y\pgfmathresult
		\pgfmathparse{2*rnd}\let\r\pgfmathresult
		\fill[white] (\x,\y) circle (\r pt);
	}
	\node[color=\cmdPAS@bg@postecolor] at (.5\paperwidth,-.5-\cv@h@univers) {\scshape\cmdPAS@bg@postesize\bfseries\cmdPAS@bg@poste};
	% etoiles
	\pgfdeclaredecoration{stars}{initial}
	{
		\state{initial}[width=15pt]
		{
			\pgfmathparse{round(rnd*100)}
			\pgfsetfillcolor{\cmdPAS@bg@bgcolor!\pgfmathresult!white}
			\pgfsetstrokecolor{\cmdPAS@bg@bgcolor!\pgfmathresult!gray}
			\pgfnode{star}{center}{}{}{\pgfusepath{stroke,fill}}
		}
		\state{final}
		{
			\pgfpathmoveto{\pgfpointdecoratedpathlast}
		}
	}
	\path[decorate, decoration=stars, star point ratio=2, star points=5,inner sep=0, minimum size=rnd*10pt+2pt] (.99\paperwidth,-.97\paperheight) .. controls (.5\paperwidth,-.93\paperheight) and (.25\paperwidth,-\paperheight) .. (-1,-.98\paperheight);
}

%=============== INFO GAUCHE ===============
\newcommand*\infoLeft@univers[1]{%
	\AddToShipoutPicture{%
		\put(\LenToUnit{5cm},\LenToUnit{.97\paperheight})
			{%
				\rlap{
					\begin{minipage}[t]{0.5\paperwidth}
						#1
					\end{minipage}
				}
			}
	}
}

%=============== INFO DROITE ===============
\newcommand*\infoRight@univers[1]{%
	\AddToShipoutPicture{%
		\put(\LenToUnit{.97\paperwidth},\LenToUnit{.97\paperheight}){%
			\llap{%
			\begin{minipage}[t]{.5\paperwidth}
				\begin{flushright}#1\end{flushright}
			\end{minipage}
			}
		}
	}
}

%=============== TITRE ===============
\newcommand*\title@univers[1]{%
	\noindent
	\begin{tikzpicture}
		\node[fill=\cmdPAS@title@bordercolor,shape=star,rotate=20] (etoile) {};
		\node[right,text=\cmdPAS@title@color] at (.33,0) {\scshape\bfseries #1};
		\shade[left color=\cmdPAS@title@bordercolor,right color=white,very thick] ($(etoile.south west)+(0,-0.03)$) rectangle +(.9\paperwidth,-.02);
	\end{tikzpicture}
}

%=============== MARGES ===============
\newcommand*\margins@univers{%
\FPeval\result{clip(\cv@h@univers+2)}
\newgeometry{tmargin=\result cm,bmargin=1.5cm,lmargin=1cm,rmargin=1cm}
}

%=============== CLEARPAGE ===============
\newcommand*\clearpage@univers{%
	% etoiles
	\pgfdeclaredecoration{stars}{initial}
	{
		\state{initial}[width=15pt]
		{
			\pgfmathparse{round(rnd*100)}
			\pgfsetfillcolor{\cmdPAS@bg@bgcolor!\pgfmathresult!white}
			\pgfsetstrokecolor{\cmdPAS@bg@bgcolor!\pgfmathresult!gray}
			\pgfnode{star}{center}{}{}{\pgfusepath{stroke,fill}}
		}
		\state{final}
		{
			\pgfpathmoveto{\pgfpointdecoratedpathlast}
		}
	}
	\path[decorate, decoration=stars, star point ratio=2, star points=5,inner sep=0, minimum size=rnd*10pt+2pt] (.99\paperwidth,-.97\paperheight) .. controls (.5\paperwidth,-.93\paperheight) and (.25\paperwidth,-\paperheight) .. (-1,-.98\paperheight);
}
\newcommand*\clearmargins@univers{%
	\newgeometry{tmargin=2cm,bmargin=1.5cm,lmargin=1cm,rmargin=1cm}
}