Commits

Panagiotis Mavrogiorgos committed 5b28470

Added a \typesetEnclosures command.

  • Participants
  • Parent commits e8f9524

Comments (0)

Files changed (3)

File cover-letter-example.pdf

Binary file modified.

File cover-letter-example.tex

 %
 % textwidth = 2.042 * alphabet_length + 33.41
 %
-\usepackage[a4paper,xetex,width=335pt]{geometry} \usepackage{parskip}
+% For 12pt sized "Linux Libertine O" and "Minion Pro" textwidth of 335pt is the
+% "correct" value, but if you use this value with A4 papers then the margins are
+% very big. If you intend mail the cover letter by post you could consider using
+% b5paper which matches quite nicely.
+
+\usepackage[
+    a4paper,
+    xetex,
+    width=435pt,
+    top=3cm,
+    bottom=3cm,
+]{geometry}
+\usepackage{parskip}
 
 %%----------------------------------------------------
 % fonts
     /recipient/AddressA={You may use up to 3 lines},
     /recipient/AddressB={for the Addresses.},
     /recipient/AddressC={Don't forget the braces!},
+    %
+    /enclosures/name=Attachments,
+    /enclosures/itemA={Curriculum Vit\ae},
+    /enclosures/itemB={Item 1},
+    /enclosures/itemC={Item 2},
+    %/enclosures/itemD={Item 3},
+    %/enclosures/itemE={Item 4},
 ]{cover-letter}
 
+
 \begin{document}
 
 \typesetSender
 % And this is where it ends...
 \typesetSignature
 
+\typesetEnclosures
+
 \end{document}

File cover-letter.sty

 \RequirePackage{xspace}
 \RequirePackage{etoolbox}
 \RequirePackage{marvosym}
+\RequirePackage{paralist}
 
 % Key definition
 \pgfqkeys{/recipient}{
     Homepage/.store in = \senderHomepage,
 }
 
+\pgfqkeys{/enclosures}{
+    name/.store in = \enclosureName,
+    itemA/.store in = \enclosureA,
+    itemB/.store in = \enclosureB,
+    itemC/.store in = \enclosureC,
+    itemD/.store in = \enclosureD,
+    itemE/.store in = \enclosureE,
+}
+
 \ProcessPgfOptions{/sender}
 \ProcessPgfOptions{/recipient}
+\ProcessPgfOptions{/enclosures}
 
 
 \newcommand{\typesetSender}{
     \textbf{\senderFullname}
     \ifdefvoid{\senderTitle}{}{{\newline \small \itshape \senderTitle}}
 }
+
+
+\newcommand{\typesetEnclosures}{
+    \vfill
+    \textit{
+        \ifdefvoid{\enclosureA}{}{%
+            \textbf{\enclosureName}:
+            \begin{compactitem}
+                \item \enclosureA
+                \ifdefvoid{\enclosureB}{}{\item \enclosureB}
+                \ifdefvoid{\enclosureC}{}{\item \enclosureC}
+                \ifdefvoid{\enclosureD}{}{\item \enclosureD}
+                \ifdefvoid{\enclosureE}{}{\item \enclosureE}
+            \end{compactitem}
+        }
+    }
+}