Advertisement
argui

SJTU Recommendation Letter Template

Mar 18th, 2024
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 7.40 KB | None | 0 0
  1. % SJTUletter_example.tex - an example latex file to illustrate SJTUletter.cls
  2. %
  3. % Template by Brian Wood (brian.wood@oregonstate.edu).  Please feel free to send suggestions for changes; this template/cls is not exactly elegantly done!
  4. % Modified by Xiang Chen (cascades@sjtu.edu.cn) to fit the need of SJTU students.
  5.  
  6.  
  7. \documentclass[12pt]{SJTUletter}
  8. \usepackage{fontspec}
  9. \usepackage{tikz}
  10. \usepackage{xcolor}
  11.     \definecolor{sjtured}{rgb}{0.73, 0, 0.09}
  12. \usepackage{lipsum}
  13. \usepackage{fancyhdr}
  14. \usepackage{lastpage}
  15. \usepackage{eso-pic}
  16. %
  17. % This section is just a bunch of busywork so that the second and following pages read ``Page X of Y''
  18. \pagestyle{fancy}
  19. \fancyhf{}
  20. \renewcommand{\headrulewidth}{0pt}
  21. \renewcommand{\footrulewidth}{0pt}
  22. \rhead{Page \thepage \hspace{1pt} of \pageref{LastPage}}
  23. %
  24. %
  25. % Set custom font here. Comment this line out if you do not have a Cambria font (originally included with this template) installed; computer modern (or whatever your current default font is) will be substituted.
  26. %
  27. % \defaultfontfeatures{Path=./fonts}
  28. \setmainfont[Path=fonts/, BoldFont=CambriaBold.ttf, ItalicFont=CambriaItalic.ttf, BoldItalicFont=CambriaBoldItalic.ttf]{Cambria.ttf}
  29.  
  30. \newcommand{\watermark}[3]{\AddToShipoutPictureBG{
  31. \parbox[b][\paperheight]{\paperwidth}{
  32. \vfill%
  33. \centering%
  34. \begin{tikzpicture}
  35.    \path (0,0) -- (\paperwidth,\paperheight);
  36.    \node[opacity=.06] at (current page.center)
  37.    {\includegraphics[width=0.55\textwidth]{assets/background.png}};
  38.    \end{tikzpicture}
  39. \vfill}}}
  40.  
  41. % The material below is a whole big dang thing whose purpose is just to set up a fixed coordinate system for \tikz so that you can put the Department or School address in the upper right-hand side without it moving all around every time you change something in the page.  I think it works.
  42. % Defining a new coordinate system for the page:
  43. %
  44. % --------------------------
  45. % |(-1,1)    (0,1)    (1,1)|
  46. % |                        |
  47. % |(-1,0)    (0,0)    (1,0)|
  48. % |                        |
  49. % |(-1,-1)   (0,-1)  (1,-1)|
  50. % --------------------------
  51. \makeatletter
  52. \def\parsecomma#1,#2\endparsecomma{\def\page@x{#1}\def\page@y{#2}}
  53. \tikzdeclarecoordinatesystem{page}{
  54.    \parsecomma#1\endparsecomma
  55.    \pgfpointanchor{current page}{north east}
  56.     % Save the upper right corner
  57.     \pgf@xc=\pgf@x%
  58.     \pgf@yc=\pgf@y%
  59.     % save the lower left corner
  60.     \pgfpointanchor{current page}{south west}
  61.     \pgf@xb=\pgf@x%
  62.     \pgf@yb=\pgf@y%
  63.     % Transform to the correct placement
  64.     \pgfmathparse{(\pgf@xc-\pgf@xb)/2.*\page@x+(\pgf@xc+\pgf@xb)/2.}
  65.    \expandafter\pgf@x\expandafter=\pgfmathresult pt
  66.    \pgfmathparse{(\pgf@yc-\pgf@yb)/2.*\page@y+(\pgf@yc+\pgf@yb)/2.}
  67.    \expandafter\pgf@y\expandafter=\pgfmathresult pt
  68. }
  69. \makeatother
  70. %
  71. %
  72. %%%%%%%%%%% Put Personal Information Here %%%%%%%%%%%
  73. %
  74. \def\name{xxx,\\
  75. Professor,\\
  76. School of xxx, SJTU \\
  77. xxx@sjtu.edu.cn
  78. }
  79. % \def\name{Yue Wu,\\
  80. % Researcher,\\
  81. % School of Cyber Science and Engineering, SJTU \\
  82. % yuewu@sjtu.edu.cn
  83. % }
  84. %
  85. % List your degree(s), licences, etc. here if you like.
  86. %\def\What{, Your degrees, etc.}
  87. %
  88. % Set the name of your Department or School here
  89. % I honestly don't know why the negative spacing is necessary to get the alignment of the first line correct.  This must be a ``\tikz'' thing.
  90. %%%%%%%%%%%%%%%%%%  School or Department %%%%%%%%%%%%%%%
  91. \def\Where{\hspace{-1.2mm}\textbf{\color{sjtured}%{sjtured}
  92. School of xxx \\ Shanghai Jiao Tong University
  93. }}
  94. %%%%%%%%%%%%  Additional Contact Information %%%%%%%%%%%
  95. %
  96. % Set your preferred primary contact address here.
  97. \def\Address{800 Dongchuan RD. \\
  98. Minhang District}
  99. %
  100. \def\CityZip{Shanghai, 200240}
  101. %
  102. % Set your SJTU e-mail here
  103. \def\Email{\textbf{\color{sjtured}E-mail}: yuewu@sjtu.edu.cn}
  104. %
  105. % Set your preferred contact number here
  106. \def\TEL{\textbf{\color{sjtured}Phone}: +86 21 54740000}
  107. %
  108. % Set your department or personal website here
  109. \def\URL{\textbf{\color{sjtured}URL}: http://www.sjtu.edu.cn}
  110. %
  111. %%%%%%%%%%%%%%%%  Footer information  %%%%%%%%%%%%%%%%%%
  112. %
  113. %  The next line is for your college, used as a footer.  If you prefer not to have this, just comment out these lines in favor of the line labeled "[[Alternate]]" below
  114. % \def\school{\small{
  115. %   SJTU $\cdot$
  116. %      ~School of Computer Science $\cdot$
  117. %      ~No.220 Handan RD $\cdot$
  118. %      ~Shanghai, China P.R} }
  119. \def\school{~}  % [[Alternate]]
  120. %
  121. %%%%%%%%%%%%%%%%%%%%%  Signature line  %%%%%%%%%%%%%%%%%%%%%
  122. %
  123. % Set your signature line here.
  124. % One can add a signature image in a PDF file using the following code; this requires a file called "signature_block.pdf" to be installed in the same folder as the .tex file.  The vertical spacing (\vspace) and the scaling will have to be adjusted to get things to look correct for your particular signature image. Alternatively, comment out the following line in favor of the one labeled "[[Alternate]]" if you want to sign a paper copy of the letter.
  125. %
  126. \signature{
  127. \vspace{-12mm}\includegraphics[scale=0.40]{assets/signature.pdf}\\\vspace{-2mm}
  128. \name}
  129. % \signature{\name}  % [[Alternate]]
  130.  
  131. % This block sets up the address on the right-hand side of the header.
  132. %
  133. % The following lines just compile the information you set up into the LaTex letter variable "address" for later use.
  134. %
  135. %The following command "clears out" the default address so that it can be better set using \tikz
  136. \address{}
  137.  
  138. \def\newaddress{
  139. \Where\\
  140. \Address\\
  141. \CityZip\\
  142. \TEL\\
  143. % \Email\\
  144. \URL
  145. }
  146. %
  147. %%%%%%%%%%%  DATE  %%%%%%%%%%%%%%%%%%%%%%%%%
  148. % If you want a date different from the current date, comment out the next line in favor of the line labeled "[[Alternate]]".  The ``\vspace{10mm}'' just moves the date down a tiny bit so it doesn't interfere with the header.  This can be adjusted to your preference.
  149. %
  150. \date{\vspace{10mm} \today}
  151. %\date{\vspace{10mm} 20 September 2020}  %[[Alternate]]
  152. %
  153. %%%%%%%%%%% Set the subject here if there is one  %%%%
  154. %\subject{Stuff} % optional subject line
  155.  
  156. \begin{document}
  157. %
  158. %
  159. %%%%%%%%  The "To" address goes here.
  160. %
  161. \begin{letter}{
  162.               Recipient School Name \\
  163.               Recipient School Address
  164.               }
  165. % This line sets up the return address to the right-side of the OSU logo.  The location is set with absolute node addresses using ``\tikz''.  It can still be a bit fussy, and you may need to alter this a little to get things to look right.  The bit that changes the position are the numbers in parentheses ``at (14.2,2.7)''
  166. %
  167. \begin{tikzpicture}[remember picture,overlay,every node/.style={anchor=center}]
  168. \node[text width=6cm] at (page cs:0.5, 0.73){\small \newaddress};
  169. \end{tikzpicture}
  170.  
  171. %%%%%%  The ``opening'' is just the method of address you would like to use at the start of the letter.
  172. %
  173. \opening{Dear Application Committee,}
  174.  
  175. %%%%%%%%%% Body of letter   %%%%%%%%%%%%%%
  176. % Remove it if you do not want watermark
  177. \watermark{}{}{}
  178.  
  179. % The ``\lipsum[1-8]" command just fills the letter with 8 paragraphs of Latin for the purposes of filler.  Unless you really want to send filler Latin to someone, you will replace this command with actual text.  Do that here:
  180. %
  181. \lipsum[1-8]
  182.  
  183. %%%%%%% ``closing'' sets the sign-off line.
  184. \closing{Sincerely,}
  185.  
  186. % Comment out/in the lines below as necessary
  187. %\encl{If an enclosure is provided, let them know what it is.}
  188.  
  189. %\ps{A postscript if that is a thing you do.}
  190.  
  191. %\cc{Someone Who Cares (and is copied).}
  192.  
  193. \end{letter}
  194.  
  195. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement