1

I have a table, and I am trying to adjust the spacing so that the right most column goes to the right of the page as much as possible, to line up with a horizontal rule I have that stretches the page width (automatically inserted for each new section heading).

The markup I am using is:

\documentclass[letterpaper,11pt]{article}
\usepackage{kpfonts}
\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{0pt}%
\usepackage{xcolor}
\definecolor{smokyblack}{rgb}{0.06, 0.05, 0.03}
\definecolor{mygrey}{rgb}{0.1, 0.14, 0.12}
\definecolor{darkjunglegreen}{rgb}{0.0, 0.26, 0.15}
\usepackage[
top    = 0.608cm,
bottom = 1.1cm,
left   = 1.20cm,
right  = 1.10cm]{geometry}
\usepackage{titlesec}
\makeatletter 
\newcommand\semiLarge{\@setfontsize\semiLarge{13.22}{17.38}}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}
{1em}{}[\color{darkjunglegreen}{\titlerule[2pt]}]
\titlespacing\section{0pt}{1pt plus 4pt minus 2pt}{-3pt plus 2pt minus 2pt}
\newcommand{\forceindent}{\leavevmode{\parindent=1.5em\indent}}
\begin{document}
\sloppy
\begin{tabular*}{7.5in}{@{}l@{\extracolsep{\fill}}r}
\colorbox{white}{\textbf{\LARGE \textcolor{mygrey}{REAL NAME}}}  & \large{email@realemail.com}\\
\colorbox{mygrey!11}{\textbf{\semiLarge \textcolor{smokyblack}{Employed Professional}}} &  \large{555-555-5555 - New York, NY}
\vspace{0.1mm}
\end{tabular*}
\section*{Career Summary}
\end{document}

I have also made an image demonstrating how things are not aligned and where they should be.

enter image description here

I don't understand why on the right side of the page the bottom entry (containing NY) is more left than the email address above it?

I would like both to be as right as possible in line with the horizontal rule, similar to how the left entries are in line with the entry on the left.

What is the correct waay to change the spacing of these table entries?

1

Probably you are more satisfied with the following, where I have set the tabular* to be as wide as the textwidth and where I have removed the additional small horizontal white space on the right by adding @{} (just as you did on the left side of the table):

\documentclass[letterpaper,11pt]{article}
\usepackage{kpfonts}
\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{0pt}%
\usepackage{xcolor}
\definecolor{smokyblack}{rgb}{0.06, 0.05, 0.03}
\definecolor{mygrey}{rgb}{0.1, 0.14, 0.12}
\definecolor{darkjunglegreen}{rgb}{0.0, 0.26, 0.15}
\usepackage[
top    = 0.608cm,
bottom = 1.1cm,
left   = 1.20cm,
right  = 1.10cm]{geometry}
\usepackage{titlesec}
\makeatletter 
\newcommand\semiLarge{\@setfontsize\semiLarge{13.22}{17.38}}
\titleformat{\section}
{\normalfont\Large\bfseries}{\thesection}
{1em}{}[\color{darkjunglegreen}{\titlerule[2pt]}]
\titlespacing\section{0pt}{1pt plus 4pt minus 2pt}{-3pt plus 2pt minus 2pt}
\newcommand{\forceindent}{\leavevmode{\parindent=1.5em\indent}}
\begin{document}
\sloppy
\begin{tabular*}{\linewidth}{@{}l@{\extracolsep{\fill}}r@{}}
\textbf{\LARGE \textcolor{mygrey}{REAL NAME}}  & \large{email@realemail.com}\\
\colorbox{mygrey!11}{\textbf{\semiLarge \textcolor{smokyblack}{Employed Professional}}} &  \large{555-555-5555 - New York, NY}
\end{tabular*}
\section*{Career Summary}
\end{document}
| improve this answer | |
  • Ah, very nice! Thank you. I notice this solution seems t add some white space and/or indent slightly the text in the first column on the second row, where it says 'Employed Professional', is there a way to undo that? – Jake Rankin Dec 23 '19 at 18:02
  • Do you have the whitespace added on your end also? Should I make this a new question? – Jake Rankin Dec 23 '19 at 18:56
  • The indentation seems to be due to the \colorbox around "Employed Professional" – leandriis Dec 23 '19 at 18:59
  • OK, I will make a new question since that is a separate issue. Thank you for all your help thus far! – Jake Rankin Dec 23 '19 at 19:05

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.