Advertisement
Guest User

letter-classic.cls

a guest
Mar 28th, 2015
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 4.70 KB | None | 0 0
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. % BOF letter-classic.cls
  3.  
  4. \NeedsTeXFormat{LaTeX2e}
  5. \ProvidesClass{letter-classic}[2003/03/04 v1.1]
  6.  
  7. \RequirePackage{ifthen}
  8. \newboolean{@german}\setboolean{@german}{false}
  9. \DeclareOption{german}{\setboolean{@german}{true}}
  10.  
  11. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{letter}}
  12. \ProcessOptions
  13. \LoadClass[a4paper]{letter}
  14.  
  15. \newcommand{\letterenglish}{
  16.  \newcommand{\emailname}{email}
  17.  \newcommand{\phonename}{phone}
  18.  \newcommand{\faxname}{fax}
  19.  \newcommand{\mobilename}{mobile}
  20.  \newcommand{\subjectname}{\textsl{subject:}}}
  21. \newcommand{\lettergerman}{
  22.  \newcommand{\emailname}{E-Mail}
  23.  \newcommand{\phonename}{Telefon}
  24.  \newcommand{\faxname}{Telefax}
  25.  \newcommand{\mobilename}{Handy}
  26.  \newcommand{\subjectname}{}}
  27. \ifthenelse{\boolean{@german}}
  28.  {\RequirePackage{german}\lettergerman}{\letterenglish}
  29.  
  30. \setlength{\hoffset}{-1in}       \setlength{\voffset}{-1in}
  31. \setlength{\textwidth}{160mm}    \setlength{\textheight}{252mm}
  32. \setlength{\topmargin}{5mm}
  33. \setlength{\oddsidemargin}{25mm} \setlength{\evensidemargin}{25mm}
  34. \setlength{\headheight}{15mm}    \setlength{\headsep}{5mm}
  35. \setlength{\marginparwidth}{20mm}
  36.  
  37. \newdimen\leftfield  \setlength{\leftfield}{100mm}
  38. \newdimen\rightfield \setlength{\rightfield}{50mm}
  39.  
  40. \let\name\@undefined      \let\fromname\@undefined
  41. \let\address\@undefined   \let\fromaddress\@undefined
  42. \let\location\@undefined  \let\fromlocation\@undefined
  43. \let\telephone\@undefined \let\telephonenum\@undefined
  44. \let\signature\@undefined
  45. \let\@texttop=\relax
  46.  
  47. \newcommand{\@subject}{}
  48. \newcommand{\subject}[1]{\renewcommand{\@subject}{#1}}
  49. \newcommand{\@fromname}{}
  50. \newcommand{\fromname}[1]{\renewcommand{\@fromname}{#1}}
  51. \newcommand{\@fromstreet}{}
  52. \newcommand{\fromstreet}[1]{\renewcommand{\@fromstreet}{#1}}
  53. \newcommand{\@fromtown}{}
  54. \newcommand{\fromtown}[1]{\renewcommand{\@fromtown}{#1}}
  55. \newcommand{\@fromemail}{}
  56. \newcommand{\fromemail}[1]{\renewcommand{\@fromemail}{#1}}
  57. \newcommand{\@fromphone}{}
  58. \newcommand{\fromphone}[1]{\renewcommand{\@fromphone}{#1}}
  59. \newcommand{\@fromfax}{}
  60. \newcommand{\fromfax}[1]{\renewcommand{\@fromfax}{#1}}
  61. \newcommand{\@frommobile}{}
  62. \newcommand{\frommobile}[1]{\renewcommand{\@frommobile}{#1}}
  63. \newcommand{\@fromtownshort}{}
  64. \newcommand{\fromtownshort}[1]{\renewcommand{\@fromtownshort}{#1}}
  65. \newcommand{\@fromsignature}{}
  66. \newcommand{\fromsignature}[1]{\renewcommand{\@fromsignature}{#1}}
  67.  
  68. \fromname{}
  69. \fromstreet{}
  70. \fromtown{}
  71. \fromemail{}
  72. \fromphone{}
  73. \fromfax{}
  74. \frommobile{}
  75. \fromtownshort{}
  76. \fromsignature{}
  77.  
  78. \DeclareFixedFont{\bsf}{OT1}{cmss}{m}{n}{17.28}
  79. \DeclareFixedFont{\nsf}{OT1}{cmss}{m}{n}{10}
  80. \DeclareFixedFont{\ssf}{OT1}{cmss}{m}{n}{7}
  81.  
  82. \def\ps@firstpage{
  83.  \setlength{\headheight}{40mm} \setlength{\headsep}{0mm}
  84.  \def\@oddhead{\usebox{\letterhead}\\[-6mm]}
  85.  \def\@oddfoot{}
  86.  \def\@evenhead{}
  87.  \def\@evenfoot{}}
  88.  
  89. \def\ps@headings{
  90.  \def\@oddhead{\parbox{\textwidth}{
  91.    \nsf \@fromname \hfill \@date \hfill \pagename\ \thepage\\[-8pt]
  92.    \rule{\textwidth}{.4pt}}}
  93.  \let\@evenhead=\oddhead
  94.  \def\@oddfoot{} \let\@evenfoot=\oddfoot}
  95. \ps@headings
  96.  
  97. \renewcommand{\opening}[1]{
  98.  \newsavebox{\letterhead}
  99.  \sbox{\letterhead}{\parbox[b]{\textwidth}{
  100.    \parbox[b][10mm][t]{\textwidth}{}\\
  101.    \parbox[b]{\leftfield}{\bsf\@fromname}\hfill
  102.    \parbox[b]{\rightfield}{}\\[-6pt]
  103.    \rule{\textwidth}{.4pt}\\[6pt]
  104.    \parbox[b]{\leftfield}{}\hfill
  105.    \parbox[b]{\rightfield}{\nsf
  106.      \begin{tabbing}
  107.        \@fromstreet\\
  108.        \@fromtown\\
  109.    \hspace{12mm}\=\kill
  110.    \ifthenelse{\equal{\@fromemail}{}}{\kill}{\emailname\>\@fromemail\\}
  111.    \ifthenelse{\equal{\@fromphone}{}}{\kill}{\phonename\>\@fromphone\\}
  112.    \ifthenelse{\equal{\@fromfax}{}}{\kill}{\faxname\>\@fromfax\\}
  113.    \ifthenelse{\equal{\@frommobile}{}}{\kill}{\mobilename\>\@frommobile\\}
  114.      \end{tabbing}\hfill}}}
  115.  
  116.  \thispagestyle{firstpage}
  117.  {\reversemarginpar\marginpar{\vspace{51mm}\rule{5mm}{.4pt}}}
  118.  \parbox[b][40mm][t]{80mm}{
  119.    \ssf\@fromname, \@fromstreet, \@fromtown\\[-9pt]
  120.    \rule{80mm}{.4pt}\vspace{3mm}
  121.    \nsf\toname\\
  122.    \toaddress}\\
  123.  \parbox[b][20mm][t]{\leftfield}{}\hfill
  124.  \parbox[b][20mm][t]{\rightfield}{
  125.    \nsf\ifthenelse{\equal{\@fromtownshort}{}}{}{\@fromtownshort,\ } \@date}\\
  126.  \ifthenelse{\equal{\@subject}{}}{}{\subjectname\
  127.  {\bfseries \@subject}\vspace{2\parskip}\\} #1\par\nobreak
  128.  \enlargethispage{-25mm}}
  129.  
  130. \renewcommand{\closing}[1]{
  131.  \par\nobreak\vspace{\parskip}
  132.  \ignorespaces #1\\[8\medskipamount]
  133.  \ifthenelse{\equal{\@fromsignature}{}}{\@fromname}{\@fromsignature}
  134.  \strut\par\vspace{\parskip}}
  135.  
  136. % EOF letter-classic.cls
  137. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement