[Tex/LaTex] Alignment problem in resume

horizontal alignmentresume

This question uses the suggestions given here. I am formatting my resume for which the following in a basic construct (minimum working example):

\documentclass[letterpaper,9pt]{article}
\newlength{\outerbordwidth}
\usepackage[empty]{fullpage}
\usepackage{color}
\usepackage{hyperref}
\definecolor{mygrey}{gray}{0.85}
\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}
\usepackage{tabularx}

\setlength{\paperwidth}{8.5in}
\setlength{\hoffset}{3pt}
\addtolength{\oddsidemargin}{-0.6in}
\addtolength{\topmargin}{-.7in}
\addtolength{\textheight}{1.0in}
\setlength{\textwidth}{7.488in}

\newcommand{\resitem}[1]{\item #1 \vspace{-3pt} }
\newcommand{\resheading}[1]{{\colorbox{mygrey}{\begin{minipage}{\textwidth}   {\textbf{#1 \vphantom{p\^{e}}}}\end{minipage}}} \vspace{2pt}}
\newcommand{\ressubheading}[4]{%
\item \vspace{-.2cm} \textbf{#1} \hfill #2\null\\
#3 \hfill #4%
\vspace{-0.2cm}}

\begin{document}

\begin{center}
\textbf{\LARGE Rohit Bahl}
\end{center}
\begin{tabular*}{7in}{l@{\extracolsep{3.95in}}l}
My Address Comes Here, Apt \#x& \hfill Phone: 215-xxx-xxxx \\
City, State & \hfill Email: \href{mailto:rbahl@xxxx.edu}{rbahl@xxxx.edu}  \\
\end{tabular*}
\\
\vspace{0.1cm}

\resheading{Education}
\vspace{-.35cm}

\begin{itemize}
\ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}
\begin{itemize}
    \resitem{\textbf{Major}: }
    \resitem{\textbf{Research Focus}}:          
    \resitem{\textbf{Courses}}:         
    \resitem{\textbf{GPA}: x.xx/4.00}
\end{itemize}
    
\ressubheading{Undergrad College }{City}{Bachelor of Technology in Electronics and Communication}{2005 -- 2009}    
\end{itemize}
\end{document}

The issue is, although I have tried to align everything on the right side but its always off the mark. As demonstrated in the figure, the credentials and personal information on the right side (city/phone/email/year etc) are not aligning with the title box (Education):example
What is the best method to do this automatically ? Thanks for your suggestions !

Note: I am modifying the basic template provided by David Grant here according to my own preferences.

Best Answer

Here's an adaptation of what you currently have that aligned things horizontally as you request:

enter image description here

\documentclass[letterpaper]{article}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\usepackage[empty]{fullpage}% http://ctan.org/pkg/fullpage
\usepackage{color}% http://ctan.org/pkg/color
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\definecolor{mygrey}{gray}{0.85}

\newcommand{\resitem}[1]{\item #1 \vspace{-3pt} }
\newcommand{\resheading}[1]{%
  \noindent\fcolorbox{mygrey}{mygrey}{\makebox[\dimexpr\textwidth-2\fboxsep-2\fboxrule][l]{\textbf{~#1}}}%
}
\newcommand{\ressubheading}[4]{%
  \item \textbf{#1} \hfill #2\null\\
  #3 \hfill #4}

\begin{document}

\begin{center}
\textbf{\LARGE Rohit Bahl}
\end{center}
\noindent\begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}r@{}}
  My Address Comes Here, Apt \#x & Phone: 215-xxx-xxxx \\
  City, State & Email: \href{mailto:rbahl@xxxx.edu}{rbahl@xxxx.edu}  \\
\end{tabular*}

\medskip

\resheading{Education}

\begin{itemize}[nosep]
  \ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}
  \begin{itemize}
    \resitem{\textbf{Major}: }
    \resitem{\textbf{Research Focus}}:          
    \resitem{\textbf{Courses}}:         
    \resitem{\textbf{GPA}: x.xx/4.00}
  \end{itemize}

  \ressubheading{Undergrad College }{City}{Bachelor of Technology in Electronics and Communication}{2005 -- 2009} 
\end{itemize}
\end{document}

I've added enumitem which can be used to modify list-level separation (vertically). I've used the nosep option, which seems to be what you're after - a tight spacing around items and other lists. You would need to peruse the enumitem documentation in order to modify the settings locally/globally. For example, topsep=1ex will give you a top gap of 1ex.

Also, I've used the following tabular* column specification:

\begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}r@{}}

This sets the tabular* to have width \textwidth with 2 columns. The first is left aligned without a preceding column separation space @{}, while the second is right aligned without a following column separation space @{}. The middle space is stretchable.

You'll notice that I dropped a bunch of your \vspace adjustments in lieu of things like \bigskip and \medskip. This is just a consistency measure since you can modify these things later (if needed). That is, use \bigskip whenever you have (say) a separation between distinct/vastly different document elements, while \medskip would provide a smaller gap between similarly-styled document elements. Finally, in terms of lengths, it is sometimes better to use font-specific lengths like em and/or ex, rather than fixed-lengths like pt, mm and cm, since you might want to change the font size later (from the current, non-existent 9pt to, say, 11pt). using the former font-specific lengths would then adjust automatically.

Related Question