summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/uvaletter/uvaletter.sty
blob: b2f864592d2a990cc18df00c0163fbe17a4f10a9 (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
107
108
109
110
111
112
113
114
115
116
117
% uvaletter v1.1.1
% Author: Michele Piazzai
% Contact: michele.piazzai@uc3m.es
% License: MIT

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{uvaletter}[2023/03/30 UvA Letter]

\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage[a4paper,margin=3.05cm]{geometry}
\RequirePackage{times}
\RequirePackage{microtype}
\RequirePackage{fancyhdr}
\RequirePackage{setspace}
\RequirePackage{graphicx}
\RequirePackage{ifthen}
\RequirePackage{soul}
\RequirePackage{lastpage}

\pagestyle{fancy}
\fancyhf{}
\DeclareOption{pageno}{\rfoot{\tabentry Page~\thepage~of~\pageref{LastPage}}}

\newenvironment{letterhead}{%
    \ifthenelse{\equal{\@logo}{}}{}{%
        \IfFileExists{\@logo}{%
            \begin{minipage}{\textwidth}
                \vspace{-2cm}\hspace{-1.31cm}\includegraphics[width=.65\textwidth]{\@logo}
            \end{minipage}
        }{}}
    \begin{minipage}[b]{.4975\textwidth}
        \raggedright\@recipient
    \end{minipage}
    \begin{minipage}[b]{.4975\textwidth}
        \raggedleft\small\sffamily
        {\bfseries\@department} \\
        \ifthenelse{\equal{\@visiting}{}}{}{\medskip\@visiting \\}
        \ifthenelse{\equal{\@postal}{}}{}{\medskip\@postal \\}
        \medskip\@website
    \end{minipage}

    \bigskip\bigskip\bigskip\bigskip
    \begin{minipage}{.3\textwidth}
        {\tabentry Date}
        \newline\@date
    \end{minipage}
    \begin{minipage}{.3\textwidth}
        {\tabentry Your reference}
        \newline\@yourreference
    \end{minipage}
    \begin{minipage}{.3\textwidth}
        {\tabentry Our reference}
        \newline\@ourreference
    \end{minipage}

    \begin{minipage}{.3\textwidth}
        {\tabentry Contact person}
        \newline\@contactperson
    \end{minipage}
    \begin{minipage}{.3\textwidth}
        {\tabentry Telephone}
        \newline\@phone
    \end{minipage}
    \begin{minipage}{.3\textwidth}
        {\tabentry Email}
        \newline\@email
    \end{minipage}

    \begin{minipage}{\textwidth}
        {\tabentry Subject}
        \newline\@subject
    \end{minipage}

    \ifthenelse{\equal{\@enclosed}{}}{\bigskip}{%
        \begin{minipage}{\textwidth}
            {\tabentry Enclosed}
            \newline\@enclosed
        \end{minipage}
        \bigskip
    }
    \raggedright
}{}

\ProcessOptions
\setlength{\parindent}{0pt}
\setlength{\parskip}{1em plus 0.2em minus 0.2em}
\renewcommand{\headrulewidth}{0pt}
\newcommand\tabentry{\scriptsize\sffamily}
\newcommand\logo[1]{\renewcommand\@logo{#1}}
\newcommand\@logo{}
\newcommand\recipient[1]{\renewcommand\@recipient{#1}}
\newcommand\@recipient{}
\newcommand\department[1]{\renewcommand\@department{#1}}
\newcommand\@department{}
\newcommand\visiting[1]{\renewcommand\@visiting{#1}}
\newcommand\@visiting{}
\newcommand\postal[1]{\renewcommand\@postal{#1}}
\newcommand\@postal{}
\newcommand\website[1]{\renewcommand\@website{#1}}
\newcommand\@website{}
\newcommand\yourreference[1]{\renewcommand\@yourreference{#1}}
\newcommand\@yourreference{}
\newcommand\ourreference[1]{\renewcommand\@ourreference{#1}}
\newcommand\@ourreference{}
\newcommand\contactperson[1]{\renewcommand\@contactperson{#1}}
\newcommand\@contactperson{}
\newcommand\phone[1]{\renewcommand\@phone{#1}}
\newcommand\@phone{}
\newcommand\email[1]{\renewcommand\@email{#1}}
\newcommand\@email{}
\newcommand\subject[1]{\renewcommand\@subject{#1}}
\newcommand\@subject{}
\newcommand\enclosed[1]{\renewcommand\@enclosed{#1}}
\newcommand\@enclosed{}

\endinput