summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/timbreicmc/timbreicmc.sty
blob: 17fd21cb72ea233858038e4ea879ffaaae12a730 (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
%%
%% This is file `timbreicmc.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% timbreicmc.dtx 
%% 
%% Copyright (C) 2017 Miguel V. S. Frasson (mvsfrasson@gmail.com)
%% 
%% This file is part of the `timbreicmc' package.
%% 
%% This package may be distributed under the terms of the LaTeX
%% Project Public License, as described in lppl.txt in the base
%% LaTeX distribution, either version 1.2 or (at your option)
%% any later version.
%% 
%% This program is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%% 
%% \CheckSum{0}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{timbreicmc}[2017/12/12 v1.0 Timbres do ICMC-USP (alguns)]
\RequirePackage{xwatermark,xcolor,tikz}
\newlength{\timbreICMCmargem}
\setlength{\timbreICMCmargem}{1.25cm}
\DeclareOption{icmc}{\def\TimbreICMCdepto{0}}
\DeclareOption{scc} {\def\TimbreICMCdepto{1}}
\DeclareOption{sma} {\def\TimbreICMCdepto{2}}
\DeclareOption{sme} {\def\TimbreICMCdepto{3}}
\DeclareOption{ssc} {\def\TimbreICMCdepto{4}}
\ExecuteOptions{icmc}
\ProcessOptions \relax
\definecolor{c5c7a99}{RGB}{92,122,153}
\definecolor{c00006a}{RGB}{0,0,106}
\definecolor{cfefefe}{RGB}{254,254,254}
\definecolor{c9c316a}{RGB}{156,49,106}
\definecolor{c6666cc}{RGB}{102,102,204}
\definecolor{c319c63}{RGB}{49,156,99}
\newsavebox{\timbreICMClogo}
\savebox{\timbreICMClogo}{\input{timbreicmclogoicmc}}
\def\timbreICMCfonterodape{\fontsize{9}{12}\sffamily}

\def\timbreICMCtexto{%
  \ifcase\TimbreICMCdepto\relax % 0 = basico
  \or Departamento de Ci\^encias de Computa\c c\~ao\\ % 1 = scc
  \or Departamento de Matem\'atica\\ % 2 = sma
  \or Departamento de Matem\'atica Aplicada e Estat\'istica\\ % 3 = sme
  \or Departamento de Sistemas de Computa\c c\~ao\\ % 4 = ssc
  \fi
  Instituto de Ci\^encias Matem\'aticas e de Computa\c c\~ao \textbar{}
  Universidade de S\~ao Paulo \textbar\\ Av.\ Trabalhador S\~ao-carlense,
  400 \textbullet{} Centro \textbullet{} S\~ao Carlos/SP \textbullet{}
  CEP 13566-590 \textbullet{} Brasil \textbullet{} www.icmc.usp.br}

\newsavebox{\timbreICMCendereco}

\savebox{\timbreICMCendereco}{%
  \makebox[0pt][c]{%
    \begin{tikzpicture}
      \node[c5c7a99] {\parbox{19cm}{%
          \timbreICMCfonterodape\centering\timbreICMCtexto}};
    \end{tikzpicture}}}
\newlength{\timbreICMCskip}

\newsavebox{\timbreICMCmarcadagua}

\newcommand{\timbreICMCsetwatermark}{%
  \setlength{\timbreICMCskip}{\paperheight}%
  \addtolength{\timbreICMCskip}{-2\timbreICMCmargem}%
  \settoheight{\timbreICMCmargem}{\usebox{\timbreICMClogo}}%
  \addtolength{\timbreICMCskip}{-\timbreICMCmargem}%
  \settoheight{\timbreICMCmargem}{\usebox{\timbreICMCendereco}}%
  \addtolength{\timbreICMCskip}{-\timbreICMCmargem}%
  \savebox{\timbreICMCmarcadagua}{\parbox{10cm}{%
      \centering
      \usebox{\timbreICMClogo}\par
      \vspace{\timbreICMCskip}\par
      \usebox{\timbreICMCendereco}}}%
  \newwatermark[allpages]{\usebox{\timbreICMCmarcadagua}}}

\AtBeginDocument{\timbreICMCsetwatermark}
%%
%% End of file `timbreicmc.dtx'.
\endinput
%%
%% End of file `timbreicmc.sty'.