[Tex/LaTex] Spacing before and after section at class resume.cls

cvresumespacing

I am using the resume template using class resume.cls and I want to change the spacing before and after sections. Right now the vertical distance between the heading and the section is too long. I tried the titlesec package, but \titlespacing does not change anything in my document. Can anybody help me with this problem? Thanks in advance!

spacing between section and heading

\documentclass{resume}
\usepackage[left=0.4in,top=0.4in,right=0.4in,bottom=0.4in]{geometry} % Document margins
\usepackage{enumitem}
\usepackage{titlesec}
\newcommand{\tab}[1]{\hspace{.2667\textwidth}\rlap{#1}}
\newcommand{\itab}[1]{\hspace{0em}\rlap{#1}}
\name{XZ} % Your name
\address{123} % Your phone number and email

\usepackage{titlesec}

\begin{document}\small

\begin{rSection}{Education}
\setlength{\parskip}{0.5em}
{\bf xxx} \hfill {XXX} 
\\ Bachelor of Arts
\\Coursework 
{\bf Peking University, Beijing} \hfill {Sept.2013-Jun.2017}
\\ Bachelor of Arts
\\Coursework :  Econometrics
\end{rSection}
\end{document}

Best Answer

The relevant code in that class to manipulate the distances is

\usepackage[parfill]{parskip}
\def\sectionlineskip{\medskip} % The space above the horizontal line for each section 
\def\sectionskip{\medskip} % The space after the heading section

% Defines the rSection environment for the large sections within the CV
\newenvironment{rSection}[1]{ % 1 input argument - section name
  \sectionskip
  \MakeUppercase{\bf #1} % Section title
  \sectionlineskip
  \hrule % Horizontal line
  \begin{list}{}{ % List for each individual item in the section
    \setlength{\leftmargin}{1.5em} % Margin within the section
  }
  \item[]
}{
  \end{list}
}

The obvious way to change the distances is to play with the both defined \sectionlineskip and \sectionskip. For example you can define them to be 0cm:

\def\sectionlineskip{\vspace{0cm}}
\def\sectionskip{\vspace{0cm}}

That will give you the (in my eyes not very pretty) result with the following MWE, I changed to make the distances better visuable:

\documentclass{resume}

\usepackage[left=0.4in,top=0.4in,right=0.4in,bottom=0.4in]{geometry} % Document margins
\usepackage{enumitem}

\newcommand{\tab}[1]{\hspace{.2667\textwidth}\rlap{#1}}
\newcommand{\itab}[1]{\hspace{0em}\rlap{#1}}
\name{XZ} % Your name
\address{123} % Your phone number and email


\begin{document}

\small

text before rsection % <================================

\begin{rSection}{Education}
\setlength{\parskip}{0.5em}
{\bf xxx} \hfill {XXX} 
\\ Bachelor of Arts
\\Coursework 
{\bf Peking University, Beijing} \hfill {Sept.2013-Jun.2017}
\\ Bachelor of Arts
\\Coursework :  Econometrics
\end{rSection}

\def\sectionlineskip{\vspace{0cm}} % <==========================
\def\sectionskip{\vspace{0cm}} % <==============================

text before rsection % <========================================

\begin{rSection}{Education}
%\setlength{\parskip}{0.5em}
{\bf xxx} \hfill {XXX} 
\\ Bachelor of Arts
\\Coursework 
{\bf Peking University, Beijing} \hfill {Sept.2013-Jun.2017}
\\ Bachelor of Arts
\\Coursework :  Econometrics
\end{rSection}
\end{document}

and the resulting pdf:

enter image description here

If you need to save more space you could add an \vspace{-0.5\baselineskip} after \end{list} in the code for rSection but that results in a real ugly cv. So I do not show an code to do that ...

Please see that I deleted both calls of package titlesec. Do not load packages twice. Package titlesec is not needed for the changing I did.

At last one remark:

For me it seems you are trying to fit your cv on one single page. Better than changing a given typography (with the result of an ugly looking cv) is to rephrase your cv content. Check once more what you can left out (try to think as the person that should read your cv: what is useful information, what is unintresting for the job).