Commits

Panagiotis Mavrogiorgos committed a8394c6

Added support for Secondary Color.

Comments (0)

Files changed (3)

cover-letter-example.pdf

Binary file modified.

cover-letter-example.tex

 % Cover letter
 %%----------------------------------------------------
 \usepackage[
+    %/general/SecondaryColor=black,
+    %
     /sender/Firstname=Charis,
     /sender/Lastname=Papadopoulos,
     /sender/Title={Civil Engineer, M.Sc.},
 
 % By default the footer is empty. If you uncomment the following line, the
 % footer will display the message "Page N of M".
-%\showpagenumbers
+% If it is active, the document must be compiled twice.
+\showpagenumbers
 
 \typesetSender
 \typesetRecipient
 
 %----------------------------------
 % This is where your letter starts!
-Dear Sir or Madam
+Dear Mr. Doe
 
-\lipsum[1-6]
+\lipsum[1-5]
 
 Yours sincerely,
 
 % The symbols are provided by the marvosym package
 
 \RequirePackage{pgfopts}
+\RequirePackage{etoolbox}
+\RequirePackage{xcolor}
 \RequirePackage{xspace}
-\RequirePackage{etoolbox}
 \RequirePackage{marvosym}
 \RequirePackage{paralist}
+\RequirePackage{fancyhdr}
+\RequirePackage{totcount}
 \RequirePackage{hyperref}
 \RequirePackage{url}
-\RequirePackage{fancyhdr}
-\RequirePackage{totcount}
 
 % Page numbering
 \regtotcounter{page}
     \pagestyle{fancy}
     \fancyhead[RCL]{}
     \fancyfoot[RL]{}
-    \fancyfoot[C]{\emph{Page \textbf{\thepage}\ of \textbf{\thetotalpages}}}
+    \fancyfoot[C]{
+        \small\itshape\color{\secondaryColor}%
+        Page \textbf{\thepage}\ of \textbf{\thetotalpages}
+    }
     \renewcommand{\headrulewidth}{0pt}
     \renewcommand{\footrulewidth}{0pt}
 }
 
+% Key definition
+\pgfqkeys{/general}{
+    SecondaryColor/.initial = darkgray,}
 
-% Key definition
 \pgfqkeys{/recipient}{
     Firstname/.store in = \recipFirstname,
     Lastname/.store in = \recipLastname,
     itemE/.store in = \enclosureE,
 }
 
+
+\ProcessPgfOptions{/general}
 \ProcessPgfOptions{/sender}
 \ProcessPgfOptions{/recipient}
 \ProcessPgfOptions{/enclosures}
 
+% store default value into macros.
+\pgfkeysgetvalue{/general/SecondaryColor}{\secondaryColor}
 
+% Typeset Sender data
 \newcommand{\typesetSender}{
     \hfill%
     \begin{minipage}[t]{\textwidth}
         \raggedleft
         \textbf{\senderFirstname \xspace \senderLastname}\\[.35ex]
-        {\small\itshape%
-            \hfill
-            % address lines
-            \ifdefvoid{\senderAddressA}{}{\hfill \senderAddressA \\}
-            \ifdefvoid{\senderAddressB}{}{\hfill \senderAddressB \\}
-            \ifdefvoid{\senderAddressC}{}{\hfill \senderAddressC \\}
-            % rest
-            \ifdefvoid{\senderMobile}{}{\Mobilefone~\senderMobile \\}
-            \ifdefvoid{\senderPhone}{}{\Telefon~\senderPhone \\}
-            \ifdefvoid{\senderFax}{}{\Fax~\senderFax \\}
-            \ifdefvoid{\senderEmail}{}{\Letter~\href{mailto:\senderEmail}{\senderEmail} \\}
-            %\ifdefvoid{\senderHomepage}{}{\Homepage~\url{\senderHomepage} \\}
-        }
-    \end{minipage}
+        \small\itshape\color{\secondaryColor}%
+        \hfill
+        % address lines
+        \ifdefvoid{\senderAddressA}{}{\hfill \senderAddressA \\}
+        \ifdefvoid{\senderAddressB}{}{\hfill \senderAddressB \\}
+        \ifdefvoid{\senderAddressC}{}{\hfill \senderAddressC \\}
+        % rest
+        \ifdefvoid{\senderMobile}{}{\Mobilefone~\senderMobile \\}
+        \ifdefvoid{\senderPhone}{}{\Telefon~\senderPhone \\}
+        \ifdefvoid{\senderFax}{}{\Fax~\senderFax \\}
+        \ifdefvoid{\senderEmail}{}{\Letter~\href{mailto:\senderEmail}{\senderEmail} \\}
+        %\ifdefvoid{\senderHomepage}{}{\Homepage~\url{\senderHomepage} \\}
+    \end{minipage}\newline
 }
 
+% Typeset Recipient data
 \newcommand{\typesetRecipient}{
     \begin{minipage}[t]{.4\textwidth}
         \raggedright%
         \textbf{\recipFirstname \xspace \recipLastname}\\[.35ex]
-        {\small\itshape%
-            % address line
-            \ifdefvoid{\recipAddressA}{}{\recipAddressA \hfill \\}
-            \ifdefvoid{\recipAddressB}{}{\recipAddressB \hfill \\}
-            \ifdefvoid{\recipAddressC}{}{\recipAddressC \hfill \\}
-        }
-    \end{minipage}
+        \small\itshape\color{\secondaryColor}%
+        % address line
+        \ifdefvoid{\recipAddressA}{}{\recipAddressA \hfill \\}
+        \ifdefvoid{\recipAddressB}{}{\recipAddressB \hfill \\}
+        \ifdefvoid{\recipAddressC}{}{\recipAddressC \hfill \\}
+    \end{minipage}\newline
 }
 
+% Typeset Date
 \newcommand{\typesetDate}{
     \begin{minipage}[t]{\textwidth}
         \raggedleft \hfill \today
-        \newline
-    \end{minipage}
+    \end{minipage}\newline
 }
 
+% Typeset Signature
 \newcommand{\senderFullname}{\senderFirstname \xspace \senderLastname}
-
 \newcommand{\typesetSignature}{%
-    \textbf{\senderFullname}
-    \ifdefvoid{\senderTitle}{}{{\newline \small \itshape \senderTitle}}
+    \textbf{\senderFullname}\newline
+    \ifdefvoid{\senderTitle}
+        {}
+        {\small\itshape\color{\secondaryColor} \senderTitle}
 }
 
-
+% Typeset Enclosures
 \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}
-        }
+    \ifdefvoid{\enclosureA}{}{%
+        \vfill
+        \small\itshape\color{\secondaryColor}%
+        \textbf{\enclosureName}:
+        \begin{compactitem}
+            \item \enclosureA
+            \ifdefvoid{\enclosureB}{}{\item \enclosureB}
+            \ifdefvoid{\enclosureC}{}{\item \enclosureC}
+            \ifdefvoid{\enclosureD}{}{\item \enclosureD}
+            \ifdefvoid{\enclosureE}{}{\item \enclosureE}
+        \end{compactitem}
     }
 }