1

If I want to L-Align the contact info in the (right) header block. How can one align the contents in a header ?

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{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
%----------------------------------------------
\newcommand{\emailhref}{\faEnvelope{}~ \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}
\SetAddress{Street name, Apt Number, \\City, St~123455~-~1234,~~~USA} % Address
\SetPhone{\faPhone{}~+1~-~123~-~456~-~7890~} % phone number
\SetEmail{firstlast@email.com}

%----------------------------------------------
%   Document
%----------------------------------------------
\begin{document}
Dear Hiring Manager,

Enter context here.

Closing statement.

Signature (Pic)
Signature (Text)
\end{document}

Output:

Output1

**UPDATE: Adding tabular I can achieve what I need, but **

   \fancyhead[RH]{% 
\scshape
  \ifthenelse{\value{page}=1}{%
    %\contactblock% display elements in contact block.
          \begin{tabular}[t]{@{}l@{}}
              \contactblock
                 \end{tabular}
    }{%
    \Large\scshape{\Name}% Subsequent pages will have your name as the R-Header.
  }
}

Output after the update makes the left header and right header mis-align. 2

1

Converting comment in to answer, just to close things, noting that jobapp.sty is not included in miktex (atleast).

Use [b] instead of [t] in \begin{tabular}[t]{@{}l@{}}. This will align First Last (name) to the table's bottom.

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.