LaTeX Custom Letter Template (German)


/ Published in: LaTeX
Save to your folder(s)



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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.