-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.tex
152 lines (119 loc) · 4.05 KB
/
main.tex
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
152
% main.tex - an example LaTeX file to demonstrate the usage of Tongjiletter.cls
%
% Template originally created by Brian Wood ([email protected]). Please feel free to send suggestions for improvements; this template/cls may not be perfectly optimized.
% Modified by Shaozuo Yu ([email protected]) to suit the requirements of Tongji students.
% Further modifications and maintenance by Rizhong Lin ([email protected]) as of May 22, 2023.
\documentclass[12pt]{Tongjiletter}
\usepackage{fontspec}
\usepackage{tikz}
\usepackage{xcolor}
\definecolor{tongjiblue}{rgb}{0, 0.372, 0.643}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{graphicx}
\usepackage{eso-pic}
% Set custom font here. Tongji uses Source Serif Pro.
% Comment this line out if you do not have Source Serif Pro installed;
% computer modern (or your default font) will be substituted.
\setmainfont{Source Serif Pro}
% Set up fancy page style for page numbering
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\rhead{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\newcommand{\watermark}[3]{\AddToShipoutPictureBG{
\parbox[b][\paperheight]{\paperwidth}{
\vfill%
\centering%
\begin{tikzpicture}
\path (0,0) -- (\paperwidth,\paperheight);
\node[opacity=.1] at (current page.center)
{\includegraphics[width=0.55\textwidth]{logo.pdf}};
\end{tikzpicture}
\vfill}}}
% Define custom coordinate system for \tikz
\makeatletter
\def\parsecomma#1,#2\endparsecomma{\def\page@x{#1}\def\page@y{#2}}
\tikzdeclarecoordinatesystem{page}{
\parsecomma#1\endparsecomma
\pgfpointanchor{current page}{north east}
\pgf@xc=\pgf@x%
\pgf@yc=\pgf@y%
\pgfpointanchor{current page}{south west}
\pgf@xb=\pgf@x%
\pgf@yb=\pgf@y%
\pgfmathparse{(\pgf@xc-\pgf@xb)/2.*\page@x+(\pgf@xc+\pgf@xb)/2.}
\expandafter\pgf@x\expandafter=\pgfmathresult pt
\pgfmathparse{(\pgf@yc-\pgf@yb)/2.*\page@y+(\pgf@yc+\pgf@yb)/2.}
\expandafter\pgf@y\expandafter=\pgfmathresult pt
}
\makeatother
%%%%%%%%%%% Put Personal Information Here %%%%%%%%%%%
\def\name{Allen Turing,\\
Associate Professor,\\
Department of Computer Science and Technology, \\
Tongji University
}
%%%%%%%%%%%% Additional Contact Information %%%%%%%%%%%
\def\Where{%
\textbf{\color{tongjiblue}Department of Computer Science, \\
Tongji University}
}
\def\Address{
4800 Cao'an Hwy.,\\
Jiading Dist.,
}
\def\CityZip{Shanghai, 201804}
\def\TEL{\textbf{\color{tongjiblue}Phone}: 541-555-5555}
\def\Email{\textbf{\color{tongjiblue}E-mail}: [email protected]}
\def\URL{\textbf{\color{tongjiblue}URL}: https://www.tongji.edu.cn/}
%%%%%%%%%%%%%%%% Footer information %%%%%%%%%%%%%%%%%%
\def\school{\small{
Tongji Univ. $\cdot$
Dept. of Comp. Sci. \& Tech. $\cdot$
Zhixin Bldg., 4800 Cao'an Hwy. $\cdot$
Shanghai, 201804}
}
\cfoot{\school}
%%%%%%%%%%%%%%%%%%%%% Signature line %%%%%%%%%%%%%%%%%%%%%
\signature{
\vspace{-12mm}\includegraphics[scale=0.40]{signature_block.pdf}\\\vspace{-2mm}
\name
}
% This block sets up the address on the right-hand side of the header.
\address{}
\def\newaddress{%
\Where\\
\Address\\
\CityZip\\
\TEL\\
\Email\\
\URL
}
%%%%%%%%%%% DATE %%%%%%%%%%%%%%%%%%%%%%%%%
\date{\vspace{10mm} \today}
%%%%%%%%%%% Set the subject here if there is one %%%%
% \subject{Letter of Recommendation} % optional subject line
\begin{document}
\begin{letter}{
Some University\\
Some Address\\
SomeTown, SomeState SomeZip
}
\begin{tikzpicture}[remember picture,overlay,,every node/.style={anchor=center}]
\node[text width=7cm] at (page cs:0.5,0.73){\small \newaddress};
\end{tikzpicture}
\opening{Dear Application Committee,}
% Remove it if you do not want the Tongji logo watermark
\watermark{}{}{}
\lipsum[1-6]
\closing{Sincerely,}
% Comment out/in the lines below as necessary
%\encl{If an enclosure is provided, let them know what it is.}
%\ps{A postscript if that is a thing you do.}
%\cc{Someone Who Cares (and is copied).}
\end{letter}
\end{document}