Posted By

latsnip on 05/11/10


Tagged

mac LaTeX letter


Versions (?)

LaTeX Custom Letter Template (German)


 / Published in: LaTeX
 

  1. % LaTeX Custom Letter Template (German)
  2.  
  3. % typeset using TeXShop & MacTeX package (http://www.tug.org/mactex/)
  4.  
  5. % For alternatives please see:
  6. % - http://en.wikibooks.org/wiki/LaTeX/Letters
  7. % - http://lifeisallabout.wordpress.com/2009/02/10/letter-writing-in-latex/
  8. % - http://snipplr.com/view/19910/latex-standard-letter-german/
  9.  
  10. \listfiles
  11. \documentclass[11pt, a4paper]{article}
  12. \usepackage[top=1.6cm, bottom=3.2cm, left=2.54cm, right=3.2cm]{geometry}
  13. \usepackage[utf8]{inputenc}
  14. \usepackage[T1]{fontenc}
  15. \usepackage{textcomp}
  16. \usepackage{ngerman}
  17. \usepackage[ngerman]{babel}
  18.  
  19. \newcommand{\senderadresse}{
  20. Herr\hspace{\stretch{1}}Wohnort, den \todayiso\\
  21. Heinz Mustermann\\
  22. Meine Strasse 10\\
  23. 12345 Wohnort\\
  24. \Telefon~01234-56789
  25.  
  26. \vspace{0.2cm}
  27. {\scriptsize\underline{Heinz Mustermann $\ast$ Meine Str. 10 $\ast$ 12345 Wohnort}}
  28.  
  29. \vspace{-0.4cm}
  30. }
  31.  
  32. \newcommand{\empfaengeradresse} {
  33. Firma XYZ\\
  34. Abteilung C\\
  35. Brieffach 1234
  36.  
  37. \vspace{-0.3cm}
  38. 12345 Stadt
  39. }
  40.  
  41.  
  42. % get custom date format
  43. \usepackage[nodayofweek]{datetime}
  44. \renewcommand{\dateseparator}{.}
  45. \newcommand{\todayiso}{\twodigit\day \dateseparator \twodigit\month \dateseparator \the\year}
  46.  
  47. % disable all underfull hbox & vbox warnings
  48. \hbadness = 10000
  49. \vbadness = 10000
  50.  
  51. % get phone symbols, etc.
  52. % cf. http://detexify.kirelabs.org/classify.html
  53. \usepackage{marvosym}
  54. \usepackage{wasysym}
  55. \usepackage{amssymb}
  56.  
  57. % http://www.theiling.de/eurosym.html.en#usage
  58. % The eurosym package must not precede the marvosym package.
  59. %\usepackage[official]{eurosym}
  60. \usepackage[gen]{eurosym}
  61.  
  62. \usepackage{pdfsync}
  63. \usepackage{microtype}
  64. \usepackage{csquotes}
  65. \usepackage{hyphenat} % \hyp{} command
  66. \usepackage{pdfpages} % \includepdf[pages=1-4]{file2include.pdf}
  67.  
  68. %\usepackage[Center]{ragged2e} % \RaggedRight, \FlushRight, \Centering
  69.  
  70. %\lccode`\-=`\-
  71. %\defaulthyphenchar=127
  72.  
  73. % Die Einrueckung der ersten Zeile eines Absatzes wird auf 0pt gesetzt
  74. \setlength{\parindent}{0pt}
  75.  
  76. % Der Abstand zwischen Absaetzen wird erhoeht
  77. \setlength{\parskip}{3ex plus 0.5ex minus 0.2ex}
  78.  
  79. % Disable single lines at the start of a paragraph (Schusterjungen)
  80. \clubpenalty = 10000
  81.  
  82. % Disable single lines at the end of a paragraph (Hurenkinder)
  83. \widowpenalty = 10000
  84. \displaywidowpenalty = 10000
  85.  
  86. % enable: \doublespacing, \onehalfspacing, \singlespacing
  87. \usepackage{setspace}
  88.  
  89. % needed for conditional compilation to suppress pagination for single page documents
  90. \usepackage{calc}
  91. \usepackage{ifthen}
  92. \usepackage{lastpage}
  93.  
  94. % needed for creating a left margin paper-fold mark (for the correct address placement for windowed envelopes)
  95. \usepackage{eso-pic}
  96.  
  97. \usepackage{blindtext}
  98.  
  99. % http://tug.ctan.org/tex-archive/macros/latex/contrib/footmisc/footmisc.pdf
  100. \usepackage[flushmargin,hang,stable]{footmisc}
  101.  
  102. % Cf. "Fussnoten: Abstand zwischen Ziffer und Text",
  103. % http://www.mrunix.de/forums/showthread.php?t=43620 (rais on page 2)
  104. \makeatletter
  105. \renewcommand{\@makefntext}[1]{\setlength{\parindent}{0pt}%
  106. \begin{list}{}{%
  107. \setlength{\topsep}{0pt}
  108. \setlength{\partopsep}{0pt}
  109. \setlength{\labelwidth}{0.43em}%
  110. \setlength{\labelsep}{0.2em}%
  111. \setlength{\leftmargin}{\labelwidth}
  112. \addtolength{\leftmargin}{\labelsep}
  113. \footnotesize}\item[{\makebox[\labelwidth][r]{\@makefnmark}}]#1%
  114. \end{list}}
  115. \makeatother
  116.  
  117.  
  118. % "how to number pages: Page # of n",
  119. % http://happymutant.com/latex/misce/misce2.php
  120. %\usepackage{fancyhdr,lastpage}
  121. %\pagestyle{fancy}
  122. %\fancyhf{}
  123. %\cfoot{\scriptsize{Seite \thepage\ von \pageref{LastPage}}}
  124. %\renewcommand\headrulewidth{0pt} % Removes funny header line
  125.  
  126. % must be last command in preamble
  127. % hyperfootnotes: cf. http://www.mrunix.de/forums/showthread.php?t=42676
  128. %\usepackage[pdftex,bookmarks,colorlinks,urlcolor=blue]{hyperref}
  129. \usepackage[pdftex,bookmarks,colorlinks,urlcolor=blue,hyperfootnotes=false]{hyperref}
  130.  
  131.  
  132. \begin{document}
  133.  
  134. % conditional compilation to suppress pagination for single page documents
  135. % Note: "When you use references, you have to compile your document twice to see the proper output",
  136. % cf. http://en.wikibooks.org/wiki/LaTeX/Labels_and_Cross-referencing
  137. % \ifthenelse {<test>}{<true>} {<false>}
  138. \ifthenelse{\pageref{LastPage} = 1}{\thispagestyle{empty}}{}
  139. %\ifthenelse{\pageref{LastPage} = 1}{\thispagestyle{empty}}{\cfoot{\scriptsize{Seite \thepage\ von \pageref{LastPage}}}}
  140.  
  141. % 1.
  142. % create a left margin paper-fold mark at 10 cm (cf. http://mrunix.de/forums/showthread.php?t=65411)
  143. % 2.
  144. % write additional information into the right margin of the first page using a minipage inside a minipage
  145.  
  146. \AddToShipoutPicture*{
  147.  
  148. \AtPageUpperLeft{
  149. \parbox[t][4.5cm][b]{1cm}{
  150. \hspace*{0mm}
  151. \rule{3mm}{0.25pt}
  152. }
  153. }
  154.  
  155. \AtPageUpperLeft{
  156. \parbox[t][8.5cm][b]{1cm}{
  157. \hspace*{0mm}
  158. \rule{3mm}{0.25pt}
  159. }
  160. }
  161.  
  162. \AtPageUpperLeft{
  163. \parbox[t][10cm][b]{1.5cm}{
  164. \hspace*{7mm}
  165. \rule{3mm}{0.25pt}
  166. }
  167. }
  168.  
  169. \AtPageUpperLeft{
  170. \noindent
  171. \begin{minipage}[t][1.9cm][b]{3cm} % cm values have to be adjusted manually
  172. \hspace*{18cm} % causes message: "Overfull \hbox (xxx pt too wide) has occurred while \output is active"
  173. \raggedleft
  174. % use the longest line of the minipage for \widthof{}
  175. %\begin{minipage}[t]{\widthof{Meine Bankverbindung}}
  176. % ... or just specify the minipage width explicitly
  177. \begin{minipage}[t]{3cm}
  178. \tiny{
  179. \textbf{Meine \\Bankverbindung}:\\
  180. Meine Bank AG\\
  181. BLZ: 12345678\\
  182. Konto: 1234567\\
  183.  
  184. \textbf{Weitere\footnote{\tiny{minipage Fussnote \\aaa bbb ccc ddd \label{refnoteMinipage}}} \\Informationen}:\footref{refnoteMinipage}\\
  185. \ldots
  186. } % tiny
  187. \end{minipage}
  188. \end{minipage}
  189. }
  190.  
  191.  
  192. } % AddToShipoutPicture
  193.  
  194.  
  195. \senderadresse
  196.  
  197. \empfaengeradresse
  198.  
  199. \vspace{1cm}
  200.  
  201. % subject line(s)
  202. %\begin{list}{\textbf{--}}{\leftmargin1em}
  203. \begin{list}{\textbf{}}{\leftmargin-0em}
  204. \item \textbf{Betreff Zeile 1}
  205. \item \textbf{Betreff Zeile 2}
  206. \end{list}
  207.  
  208. \vspace{1.3cm}
  209.  
  210. % enable flexible inter-word spacing to avoid 'overfull hbox' due to over-long lines;
  211. % restore default spacing with \fussy
  212. %\sloppy
  213.  
  214. Sehr geehrte Damen und Herren,
  215.  
  216. \onehalfspacing
  217.  
  218. % requires texcomp package
  219. \euro ~\verb+\euro+
  220.  
  221. \phone~\verb+\phone+
  222.  
  223. \Telefon~\verb+\Telefon+
  224.  
  225. \Mobilefone~\verb+\Mobilefone +
  226.  
  227. \Faxmachine~\verb+\Faxmachine +
  228.  
  229. \Email~\verb+\Email +
  230.  
  231. \Ecommerce~\verb+\Ecommerce+
  232.  
  233. $@$~\verb+$@$+
  234.  
  235. \texttt{[utf8]} ~\verb+\texttt{[utf8]}+
  236.  
  237. \ldots~\verb+\ldots+
  238.  
  239. $\lbrace$ $\vert$ \lbrack
  240.  
  241. \blindtext[1]
  242.  
  243. \blindtext[1]
  244.  
  245. \onehalfspacing
  246.  
  247. %\newpage
  248.  
  249. \vspace{1cm}
  250. Mit freundlichen Gruessen
  251.  
  252. \vspace{3.5cm}
  253. Heinz Mustermann
  254.  
  255. \end{document}

Report this snippet  

You need to login to post a comment.