1

Package:

\ProvidesFile{jobapp}
\special{papersize=8.5in,11in}

%----------------------------------------------
%   Dependencies 
%----------------------------------------------
\usepackage{array}
\usepackage{xcolor}
\usepackage[margin=1.5cm,top=50pt]{geometry}
\usepackage{parskip}
\usepackage{setspace}
\usepackage{tgpagella} % TG Pagella font
\usepackage{textcomp} % Needed for pagella font bullet points
\usepackage[T1]{fontenc}
%\usepackage[sc]{mathpazo}
%\usepackage{lmodern}
%\usepackage[urw-garamond]{mathdesign}
\usepackage{titlesec}
\usepackage{enumitem}
\usepackage{ifthen}
\usepackage[hidelinks]{hyperref}
\usepackage{fancyhdr}
\usepackage{xparse}
%----------------------------------------------
%   Debugging utilities (uncomment to enable)
%----------------------------------------------
%\overfullrule=1mm % Show overfull hboxes
%\usepackage{layout} % Insert graphic of page layout using \layout in body

%----------------------------------------------
%   Custom things
%----------------------------------------------
\definecolor{lightgray}{gray}{0.8}
\newcommand\VRule{\color{lightgray}\vrule width 1pt}
\newcommand\HRule{\color{lightgray}\hrule height 0.4pt} 
\newcolumntype{L}{>{\raggedleft}p{0.11\textwidth}}
\newcolumntype{R}{p{0.83\textwidth}}

\makeatletter
\newcommand{\DoIfNoText}[1]{% Thanks to http://tex.stackexchange.com/a/44938
  \begingroup
  \sbox0{#1}%
  \ifdim\wd0=\z@
    \endgroup
    \expandafter\@gobble
  \else
    \endgroup
    \expandafter\@firstofone
  \fi}
\makeatother

%----------------------------------------------
%   Document Variables
%----------------------------------------------
\newcommand\Name{}
\newcommand\Address{}
\newcommand\Phone{}
\newcommand\Email{}
\newcommand\Company{}
\newcommand\CompanyAddress{}
\newcommand\Encl{}
\newcommand\Skype{}
%----------------------------------------------
%   Setters
%----------------------------------------------
\newcommand{\SetName}[1]{\renewcommand{\Name}{#1}}
\newcommand{\SetAddress}[1]{\renewcommand{\Address}{#1}}
\newcommand{\SetPhone}[1]{\renewcommand{\Phone}{#1}}
\newcommand{\SetEmail}[1]{\renewcommand{\Email}{#1}}
\newcommand{\SetSkype}[1]{\renewcommand{\Skype}{#1}}

\newcommand{\OptionalCompany}[1]{%
  \DoIfNoText{#1}
    {\renewcommand{\Company}{\ignorespaces#1}}%
  }

\newcommand{\OptionalCompanyAddress}[1]{%
  \DoIfNoText{#1}
    {\renewcommand{\CompanyAddress}{\ignorespaces#1}}%
  }

\newcommand{\OptionalEncl}[1]{%
  \DoIfNoText{#1}
    {\renewcommand{\Encl}{\ignorespaces#1}}%
  }

%----------------------------------------------
%   Helpers \href{mailto:e.xmaple@example.com}{\nolinkurl{e.xmaple@example.com}}
%----------------------------------------------
\newcommand{\emailhref}{\href{mailto:\Email}{\Email}}
\newcommand{\contactblock}{\Address \\ \Phone \\ \emailhref \\ \Skype}
\newcommand{\first}{1\textsuperscript{st}}
\newcommand{\second}{2\textsuperscript{nd}}
\newcommand{\third}{3\textsuperscript{rd}}
\newcommand{\nth}[1]{#1\textsuperscript{th}}

%----------------------------------------------
%   Page customizations
%----------------------------------------------
\pagestyle{fancy}
\setlength{\headheight}{56pt}
\setlength{\headsep}{32pt}
\setlength{\textheight}{668pt}
\setlength{\footskip}{10pt}
\setlength{\parskip}{10pt}
\renewcommand{\arraystretch}{1.2}
\renewcommand{\headrule}{\vspace{5pt}\HRule}
\renewcommand{\footrule}{}
\titleformat*{\section}{\bfseries\Large\uppercase}
\titlespacing{\section}
  {0pt} % left
  {5pt} % before
  {-2pt} % after
  [0pt] % right

%----------------------------------------------
%   Header & footer definitions
%----------------------------------------------

%% Header Left - Show large name on first page
\fancyhead[LH]{% 
  \ifthenelse{\value{page}=1}{%
    \raisebox{0.5\height}{\Huge\scshape{\Name}}%
  }{}
}

%% Header Right - Show contact info on first page; name otherwise.
\fancyhead[RH]{% 
  \ifthenelse{\value{page}=1}{%
    \contactblock%
  }{%
    \Large\scshape{\Name}%
  }
}

%% Footer - Empty Footer
\fancyfoot[CF]{}

%----------------------------------------------
%   Macros & other
%----------------------------------------------

%% Table style used by resume including vertical divider
\newenvironment{CvTable}
  {\begin{tabular}{L!{\VRule}R}}
  {\end{tabular}}

%% Formats resume item blocks
\NewDocumentEnvironment
  {CvBlockEnv}
  {m >{\SplitArgument{1}{\\}} m}
  {%
    \begin{CvTable} %
      #1 & \CvBlockSplitTitle#2 % Set year/title/subtitle
  }{%
    \end{CvTable} % End block detail
  }

%% Splits the second argument to CvBlockEnv into Title & Subtitle
\def\CvBlockSplitTitle#1#2{%
  \parbox[t]{0.8\textwidth}{\textbf{#1}%
    \IfValueTF {#2} { \\ \textit{#2} } { }%
  }
}

%% Create compact itemize
\newenvironment{citemize}
  { \vspace{0.2em}\begin{itemize}[leftmargin=12pt, itemsep=0.2em] }
  { \vspace{-1em}\end{itemize} }

%----------------------------------------------
%   Cover Letter
%----------------------------------------------
\newenvironment{CoverLetter}
  {%
    \today \par \vspace{20pt}%
    \DoIfNoText{\CompanyAddress} {%
      \DoIfNoText{\Company}%
        {\Company \\}
      \CompanyAddress \par \vspace{30pt}
    }
  }
  {
    \par 
    %\vspace{0pt}%
    \Name{} \par \vspace{10pt}%
    \DoIfNoText{\Encl} {\par\noindent\textbf{Encl:}~\Encl{}}%
  }

MWE:

\documentclass[10pt]{article}
    \usepackage{jobapp}
    \usepackage{amsmath}%symbols
    \usepackage{fontawesome} % add skype, FB and Gtalk symbol :)
    \providecommand\faSkype{{\FA\symbol{"F17E}}} % add skype symbol.
    \usepackage[export]{adjustbox} % left align the figure
    \usepackage{graphicx}%graphicx package
    \usepackage{lipsum} % Used only for this example.

%----------------------------------------------
%   Document information
%----------------------------------------------
\usepackage{color,hyperref}
\definecolor{darkblue}{rgb}{0.0,0.0,0.3}%0.0,0.0,0.3
\hypersetup{colorlinks,breaklinks,
            linkcolor=darkblue,urlcolor=darkblue,
            anchorcolor=darkblue,citecolor=darkblue}
%------------------------------------------------------------
\usepackage{fontspec} % use package for cambria font
\setmainfont{Cambria} %set font

%------------------------------------------------------------
\SetName{First Last}
\SetEmail{\faEnvelope{}~example@email.com} % email address

%----------------------------------------------
%   Document
%----------------------------------------------
\begin{document}

\end{document}

MWE OUTPUT: This is the email Link I get when I get on it from the compiled PDF. Why does it show like this. It was working fine.

MWE Output

  • My guess is that the non-breaking space (~) in \faEnvelope{}~example@email.com confuses your PDF viewer. Try substituting a real space character for it. – jub0bs Aug 9 '14 at 18:12
  • @Jubobs : No I tried that, and I got the same result. – Rene Duchamp Aug 9 '14 at 18:13
4

The package jobapp expects to run pdflatex but your main file expects xelatex

Comment these three lines in jobapp.sty out:

%\usepackage{tgpagella} % TG Pagella font
%\usepackage{textcomp} % Needed for pagella font bullet points
%\usepackage[T1]{fontenc}

and use

\renewcommand\emailhref{\faEnvelope{}~\href{mailto:\Email}{\Email}}
\SetName{First Last}
\SetEmail{example@email.com} % email address

Then run the document with xelatex and it shoiuld work. At least for me :-)

  • It seems to work fine if I remove \faEnvelope{}~ from the main file. And add that in the jobapp. It works absolutely fine now. Thank you. – Rene Duchamp Aug 9 '14 at 19:01
  • 1
    See my edited answer for the added \renewcommand. You should now use only \setEmail{example@email.com} – user2478 Aug 9 '14 at 19:07
  • Excellent. This did work and this is the right way to approach it. – Rene Duchamp Aug 9 '14 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.