-
Notifications
You must be signed in to change notification settings - Fork 1
/
nusletter.sty
88 lines (77 loc) · 1.96 KB
/
nusletter.sty
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
\ProvidesPackage{nusletter}[NUS letterhead]
% Michael Yoshitaka Erlewine (mitcho), [email protected]
% Dedicated to the public domain, 2018--2023
\RequirePackage{kvoptions,etoolbox}
\SetupKeyvalOptions{prefix=nusletter@}
\DeclareBoolOption{blue}
\DeclareBoolOption{black}
\ProcessKeyvalOptions*
% font for
\RequirePackage{sourcesanspro}
% just set \sfdefault locally
\RequirePackage{afterpage}
\RequirePackage{geometry}
\geometry{margin=25mm}
% positioning
\RequirePackage{calc}
\RequirePackage[absolute]{textpos}
% graphics
\RequirePackage{graphicx}
\RequirePackage{xcolor}
\definecolor{nusblue}{HTML}{163C78} % Pantone 294U
\definecolor{nusorange}{HTML}{f07d08} % Pantone 152U
\AtBeginDocument{
% color block
\notbool{nusletter@black}{% only if not black
\begin{textblock*}{\paperwidth}(0mm,0mm)
\ifbool{nusletter@blue}{%
\noindent\textcolor{nusblue}{\rule{\paperwidth}{25mm}}%
}{%
\noindent\textcolor{nusorange}{\rule{\paperwidth}{25mm}}%
}
\end{textblock*}
}{}
% logo
\begin{textblock*}{33mm}(\paperwidth - 33mm - 10mm,6mm)
\ifbool{nusletter@blue}{%
\noindent\includegraphics[width=33mm]{logo-blue-trim}%
}{%
\ifbool{nusletter@black}{%
\noindent\includegraphics[width=33mm]{logo-black-trim}%
}{
\noindent\includegraphics[width=33mm]{logo-orange-trim}%
}
}
\end{textblock*}
% first page geometry
\enlargethispage{-10mm}
\vspace*{5mm}
}
\newcommand{\nushead}[1]{
\begin{textblock*}{\paperwidth - 50mm}(25mm,6mm)
\begingroup
\notbool{nusletter@black}{\color{white}}{}%
\ifxetex%
\sourcesanspro%
\else%
\renewcommand{\sfdefault}{SourceSansPro-LF}\sffamily%
\fi%
\parindent=0pt
#1
\endgroup
\end{textblock*}
}
\newcommand{\nusfoot}[1]{
\begin{textblock*}{\paperwidth - 50mm}(25mm, \paperheight - 25mm)
\begingroup
\notbool{nusletter@black}{\color{nusblue}}{}\footnotesize%
\ifxetex%
\sourcesanspro%
\else%
\renewcommand{\sfdefault}{SourceSansPro-LF}\sffamily%
\fi%
\parindent=0pt
#1
\endgroup
\end{textblock*}
}