This repository has been archived by the owner on Mar 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsta-letter.cls
151 lines (130 loc) · 4.67 KB
/
sta-letter.cls
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
% ----------------------------------------------------------- [ sta-letter.cls ]
% Module : sta-letter.cls
% Copyright : (c) Jan de Muijnck-Hughes
% License : see LICENSE
% Version : v2016.03.09
% ---------------------------------------------------------------------- [ EOH ]
%%
%% This work may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3c of this
%% license or (at your option) any later version.
%%
%% The latest version of this license can be found at:
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Jan de Muijnck-Hughes
%%
%% This work consists of the file: sta-letter.cls
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{sta-letter}[2016/03/09 v2016.03.09 sta-letter]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LaTeX class for writing letters, adhereing to the University of St
%% Andrews corporate guidelines.
\LoadClass[pdftex, 10pt, article, oneside, final]{memoir}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProcessOptions
% ------------------------------------ [ Fix LaTex Packages ]
\RequirePackage[l2tabu,orthodox]{nag}
\RequirePackage{fixltx2e}
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage[british]{babel}
\RequirePackage[strict=true]{csquotes}
\RequirePackage[british,cleanlook]{isodate}
\RequirePackage{xspace}
\RequirePackage{environ}
\RequirePackage[colorlinks=true]{hyperref}
% ----------------------------------------- [ Font PackageWithOptionss ]
\RequirePackage[sc]{mathpazo}
\RequirePackage{helvet}
\linespread{1.05}
\RequirePackage[protrusion=true, expansion=true]{microtype}
% ---------------------------------------- [ Style PackageWithOptionss ]
\RequirePackage[usenames,dvipsnames,svgnames]{xcolor}
\RequirePackage{graphicx}
%% ---------------------------------------------------------------- [ Commands ]
\newcommand{\department}[1]{\gdef\STACS@department{#1}}
\newcommand{\address}[1]{\gdef\STACS@address{#1}}
\newcommand{\jobtitle}[1]{\gdef\STACS@jobtitle{#1}}
\newcommand{\email}[1]{\gdef\STACS@email{#1}}
\newcommand{\logo}[1]{\gdef\STACS@logo{#1}}
\newcommand{\tel}[1]{\gdef\STACS@tel{#1}}
\newcommand{\fax}[1]{\gdef\STACS@fax{#1}}
\newcommand{\www}[1]{\gdef\STACS@www{#1}}
\newcommand{\emailTo}[1]{\href{mailto:#1}{#1}}
\newcommand{\charityline}{The University of St Andrews is a charity registered in Scotland. No: SC013532AD}
\newcommand{\recipient}[1]{\gdef\STACS@recipient{#1}}
\newcommand{\opening}[1]{\gdef\STACS@opening{#1}}
\newcommand{\closing}[1]{\gdef\STACS@closing{#1}}
\newcommand{\subject}[1]{%
\vspace{-2em}\begin{center}\bfseries#1\end{center}}
%% -------------------------------------------------------------- [ Paper Size ]
\setulmarginsandblock{55mm}{50mm}{*}
\setlrmarginsandblock{25mm}{25mm}{*}
\setheadfoot{17mm}{30mm}
\setheaderspaces{10mm}{*}{*}
\checkandfixthelayout
% Paragraph Spacing
\setlength{\parskip}{1.75ex plus 0.2ex minus 0.42ex}
\setlength{\parindent}{0pt}
\fixpdflayout
%% ------------------------------------------------------- [ Header and Footer ]
\definecolor{sta-grey-print}{cmyk}{0.0, 0.2, 0.0, 0.68}
\definecolor{sta-blue}{RGB}{0,83,155}
\origdate
\hypersetup{%
linkcolor=sta-blue,
anchorcolor=sta-blue,
citecolor=sta-blue,
urlcolor=sta-grey-print
}
\makepagestyle{sta-frontpage}
\makeoddhead{sta-frontpage}{%
\includegraphics[width=65mm]{\STACS@logo}
\\[7mm]
\hspace*{9mm}
\Large
\begin{tabular}{l}
\STACS@department{}\\
\@author, \STACS@jobtitle\\
\end{tabular}
}{}{}
\makeevenhead{sta-frontpage}{}{}{}
\makefootrule{sta-frontpage}{\textwidth}{1pt}{1.5mm}
\makeoddfoot{sta-frontpage}{\color{sta-grey-print}
\hspace{14mm}
\begin{tabular}{l}
\STACS@address\\
T:~\STACS@tel~F:\xspace\STACS@fax~E:~\href{mailto:\STACS@email}{\STACS@email}\\
W:~\STACS@www\\[0.5em]
\scriptsize\charityline\\
\end{tabular}
}{}{}
\makeheadfootruleprefix{sta-frontpage}
{\color{sta-grey-print}}
{\color{sta-grey-print}}
\makepagestyle{sta-normalpage}
\copypagestyle{sta-normalpage}{sta-frontpage}
\makeoddhead{sta-normalpage}{\@author}{Page-\thepage}{{\origdate\@date}}
\makeevenhead{sta-normalpage}{}{}{}
\pagestyle{sta-normalpage}
%% ------------------------------------------------------------- [ Letter Body ]
\NewEnviron{letter}{%
\thispagestyle{sta-frontpage}
\sffamily
\pagestyle{sta-normalpage}
\begin{raggedright}
\STACS@recipient\\[2em]
Date:~{\@date}\\[2em]
\end{raggedright}
\STACS@opening\newline
\BODY
\vspace{2em}
\STACS@closing
}
\endinput