Advertisement
argui

SJTU Recommendation Letter Template

Mar 18th, 2024
1,559
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 ([email protected]).  Please feel free to send suggestions for changes; this template/cls is not exactly elegantly done!
  4. % Modified by Xiang Chen ([email protected]) 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. }
  78. % \def\name{Yue Wu,\\
  79. % Researcher,\\
  80. % School of Cyber Science and Engineering, SJTU \\
  81. % }
  82. %
  83. % List your degree(s), licences, etc. here if you like.
  84. %\def\What{, Your degrees, etc.}
  85. %
  86. % Set the name of your Department or School here
  87. % 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.
  88. %%%%%%%%%%%%%%%%%%  School or Department %%%%%%%%%%%%%%%
  89. \def\Where{\hspace{-1.2mm}\textbf{\color{sjtured}%{sjtured}
  90. School of xxx \\ Shanghai Jiao Tong University
  91. }}
  92. %%%%%%%%%%%%  Additional Contact Information %%%%%%%%%%%
  93. %
  94. % Set your preferred primary contact address here.
  95. \def\Address{800 Dongchuan RD. \\
  96. Minhang District}
  97. %
  98. \def\CityZip{Shanghai, 200240}
  99. %
  100. % Set your SJTU e-mail here
  101. \def\Email{\textbf{\color{sjtured}E-mail}: [email protected]}
  102. %
  103. % Set your preferred contact number here
  104. \def\TEL{\textbf{\color{sjtured}Phone}: +86 21 54740000}
  105. %
  106. % Set your department or personal website here
  107. \def\URL{\textbf{\color{sjtured}URL}: http://www.sjtu.edu.cn}
  108. %
  109. %%%%%%%%%%%%%%%%  Footer information  %%%%%%%%%%%%%%%%%%
  110. %
  111. %  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
  112. % \def\school{\small{
  113. %   SJTU $\cdot$
  114. %      ~School of Computer Science $\cdot$
  115. %      ~No.220 Handan RD $\cdot$
  116. %      ~Shanghai, China P.R} }
  117. \def\school{~}  % [[Alternate]]
  118. %
  119. %%%%%%%%%%%%%%%%%%%%%  Signature line  %%%%%%%%%%%%%%%%%%%%%
  120. %
  121. % Set your signature line here.
  122. % 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.
  123. %
  124. \signature{
  125. \vspace{-12mm}\includegraphics[scale=0.40]{assets/signature.pdf}\\\vspace{-2mm}
  126. \name}
  127. % \signature{\name}  % [[Alternate]]
  128.  
  129. % This block sets up the address on the right-hand side of the header.
  130. %
  131. % The following lines just compile the information you set up into the LaTex letter variable "address" for later use.
  132. %
  133. %The following command "clears out" the default address so that it can be better set using \tikz
  134. \address{}
  135.  
  136. \def\newaddress{
  137. \Where\\
  138. \Address\\
  139. \CityZip\\
  140. \TEL\\
  141. % \Email\\
  142. \URL
  143. }
  144. %
  145. %%%%%%%%%%%  DATE  %%%%%%%%%%%%%%%%%%%%%%%%%
  146. % 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.
  147. %
  148. \date{\vspace{10mm} \today}
  149. %\date{\vspace{10mm} 20 September 2020}  %[[Alternate]]
  150. %
  151. %%%%%%%%%%% Set the subject here if there is one  %%%%
  152. %\subject{Stuff} % optional subject line
  153.  
  154. \begin{document}
  155. %
  156. %
  157. %%%%%%%%  The "To" address goes here.
  158. %
  159. \begin{letter}{
  160.               Recipient School Name \\
  161.               Recipient School Address
  162.               }
  163. % 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)''
  164. %
  165. \begin{tikzpicture}[remember picture,overlay,every node/.style={anchor=center}]
  166. \node[text width=6cm] at (page cs:0.5, 0.73){\small \newaddress};
  167. \end{tikzpicture}
  168.  
  169. %%%%%%  The ``opening'' is just the method of address you would like to use at the start of the letter.
  170. %
  171. \opening{Dear Application Committee,}
  172.  
  173. %%%%%%%%%% Body of letter   %%%%%%%%%%%%%%
  174. % Remove it if you do not want watermark
  175. \watermark{}{}{}
  176.  
  177. % 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:
  178. %
  179. \lipsum[1-8]
  180.  
  181. %%%%%%% ``closing'' sets the sign-off line.
  182. \closing{Sincerely,}
  183.  
  184. % Comment out/in the lines below as necessary
  185. %\encl{If an enclosure is provided, let them know what it is.}
  186.  
  187. %\ps{A postscript if that is a thing you do.}
  188.  
  189. %\cc{Someone Who Cares (and is copied).}
  190.  
  191. \end{letter}
  192.  
  193. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement