3

I am referencing the Mcdowell CV Latex Template from Github to produce my CV, but I have the following question to be answered:

  1. The space between the two sections are too large for me (I guess it is the default distance of an article document in LaTeX) enter image description here so I tried to add
\usepackage[compact]{titlesec}         % you need this package
\titlespacing{\section}{0pt}{0pt}{0pt} % this reduces space between (sub)sections to 0pt, for example
\AtBeginDocument{%                     % this will reduce spaces between parts (above and below) of texts within a (sub)section to 0pt, for example - like between an 'eqnarray' and text
  \setlength\abovedisplayskip{0pt}
  \setlength\belowdisplayskip{0pt}}

in the tex file, but it did not work. Then I checked the mcdowellcv.cls file, I found that there was no defined spacing for "section", he wrote a new "cvsection" on his own.

My question is: how to adjust the spacing between sections and subsections?

Here I include the tex template and cls file code, or you can check at https://github.com/dnl-blkv/mcdowell-cv

mcdowellcv.cls

\ProvidesClass{mcdowellcv}[2017/06/18 v1.2.0 McDowell CV class]

% Set up the fonts according to options
\def\mainfontsize{11pt}
\def\mainfontface{Times New Roman}

\DeclareOption{calibri}{%
  \def\mainfontface{Calibri}
}

\ProcessOptions\relax

% Set font size and paper type
\LoadClass[letterpaper,\mainfontsize]{article} 

% Set document margins
\usepackage[left=0.75in,top=0.6in,right=0.75in,bottom=0.6in]{geometry} 

% Set font face
\usepackage{fontspec}
\setmainfont[SmallCapsFeatures={Renderer=Basic},
Ligatures={TeX, NoCommon, NoDiscretionary}]{\mainfontface}

% Remove paragraph indentation
\usepackage[parfill]{parskip} 

% Required for boldface (\bf and \bfseries) tabular columns
\usepackage{array} 

% Required for ifthenelse statements
\usepackage{etoolbox} 

% Suppress page numbers
\pagestyle{empty} 

% Flexible tables
\usepackage{tabu}

% For custom margins
\usepackage{changepage}

% To customize lists
\usepackage{enumitem}
% Remove left margin from lists, suppress vertical item separation and set top 
% separation to a negative value to suppress a single parskip before lists
\setlist{leftmargin=*, noitemsep, topsep=-1\parskip}

% For adjusting spacing based on the platform used
\usepackage{ifthen}
\usepackage{ifplatform}

% For spcaed small caps
\usepackage{microtype}

\DeclareMicrotypeSet*{smallcapsi} { 
    encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2},
    shape = {sc*,si,scit}
}

%--------------------------------------------------------------------------------
%                                    Constants                                  -
%--------------------------------------------------------------------------------

\ifthenelse{\equal{\platformname}{\notwindowsname}}{
    \def\namespaceskip{0.575em}
    \def\afterheaderspace{1.1pt}
    \def\beforesectionheaderspace{5pt}
    \def\sectionheadermargin{6pt}
    \def\beforesectionheaderhrulespace{2.85pt}
    \def\sectionheaderhrlueheight{0.518pt}
    \def\aftersectionheaderspace{-5.8pt}
    \def\aftersinglelinesubsectionheaderspace{-20.25pt}
    \def\afterdoublelinesubsectionheaderspace{-11.75pt}
    \def\aftermultilinesubsectionheaderspace{-7.75pt}
    \def\afteremptysubsectionheaderspace{1.25pt}
    \def\subsectionmargin{9pt}
    \def\aftersubsectionspace{2.1pt}
}{
    \def\namespaceskip{0.4em}
    \def\afterheaderspace{3pt}
    \def\beforesectionheaderspace{4.75pt}
    \def\sectionheadermargin{6pt}
    \def\beforesectionheaderhrulespace{3pt}
    \def\sectionheaderhrlueheight{0.5pt}
    \def\aftersectionheaderspace{-4pt}
    \def\aftersinglelinesubsectionheaderspace{-18.5pt}
    \def\afterdoublelinesubsectionheaderspace{-10pt}
    \def\aftermultilinesubsectionheaderspace{-6pt}
    \def\afteremptysubsectionheaderspace{3pt}
    \def\subsectionmargin{9pt}
    \def\aftersubsectionspace{4pt}
}

%--------------------------------------------------------------------------------
%                            Header Setup and Printing                          -
%--------------------------------------------------------------------------------

% Address
\makeatletter

\newcommand\address[1]{\def\@address{#1}}
\address{}

\newcommand\printaddress{
    \small{\@address}
}

\makeatother

% Name
\makeatletter

\newcommand\name[1]{\def\@name{#1}}
\name{}

\newcommand\printname{
    \typeout {kokoko}
    \typeout \spaceskip
    \spaceskip \namespaceskip \relax
    \textbf{\LARGE\textls[110]{\textsc{\@name}}}
}

\makeatother

% Contacts
\makeatletter

\newcommand\contacts[1]{\def\@contacts{#1}}
\contacts{}

\newcommand\printcontacts{
    \small{\@contacts}
}

\makeatother

\makeatletter
\newcommand\makeheader{
    \begin{center}
        \begin{tabu} to 1\textwidth { X[l,m] X[2,c,m] X[r,m] }
            \printaddress & \printname & \printcontacts \\
        \end{tabu}  
    \end{center}
    \vspace*{\afterheaderspace}
}
\makeatother

%--------------------------------------------------------------------------------
%                            Sections and Subsections                           -
%--------------------------------------------------------------------------------

% Print a section header
\makeatletter
\newenvironment{cvsection}[1]{
    \vspace*{\beforesectionheaderspace}
    % Set text margins to equal \tabcolsep (6pt by default)
    \begin{adjustwidth}{\sectionheadermargin}{\sectionheadermargin}
        \textsc{\textbf{#1}}
    \end{adjustwidth}
    \vspace*{\beforesectionheaderhrulespace}
    \hrule height \sectionheaderhrlueheight
    \vspace*{\aftersectionheaderspace}
}{}
\makeatother

% Print a subsection
\makeatletter
% Define toggles checking if titles were defined
\newtoggle{lefttitledefined}
\newtoggle{centertitledefined}
\newtoggle{righttitledefined}

\newenvironment{cvsubsection}[4][1]{
    \notblank{#2}{\toggletrue{lefttitledefined}}{}
    \notblank{#3}{\toggletrue{centertitledefined}}{}
    \notblank{#4}{\toggletrue{righttitledefined}}{}
    \ifboolexpr{togl {lefttitledefined} or togl {centertitledefined} or togl {righttitledefined}}{
        \begin{tabu} to 1\textwidth { X[l,p] X[c,p] X[r,p] }
            \textbf{#2} & \textbf{#3} & \textbf{#4} \\
        \end{tabu}
        % Add space according to the specidied number of lines
        \ifnumcomp{#1}{=}{1}{\vspace*{\aftersinglelinesubsectionheaderspace}}{
            \ifnumcomp{#1}{=}{2}{\vspace*{\afterdoublelinesubsectionheaderspace}}{
                \vspace*{\aftermultilinesubsectionheaderspace}
            }
        }
    }{
        \vspace*{\afteremptysubsectionheaderspace}
    }
    \togglefalse{lefttitledefined}
    \togglefalse{centertitledefined}
    \togglefalse{righttitledefined}
    \begin{adjustwidth}{\subsectionmargin}{\subsectionmargin}
}
{
    \end{adjustwidth}
    \vspace*{\aftersubsectionspace}
}
\makeatother

tex template

% The font could be set to Windows-specific Calibri by using the 'calibri' option
\documentclass[]{mcdowellcv}

% For mathematical symbols
\usepackage{amsmath}

% Set applicant's personal data for header
\name{Gayle L. McDowell}
\address{123 Spruce St, Apt 35 \linebreak Philadelphia PA 19103}
\contacts{(555) 555-1212 \linebreak gayle@careercup.com}

\begin{document}

    % Print the header
    \makeheader

    % Print the content
    \begin{cvsection}{Employment}
        \begin{cvsubsection}{Software Engineer, Intern}{Apple Computer}{Summer 2004}
            iChat AV            
            \begin{itemize}
                \item Reduced time to render the user’s buddy list by 75\% by implementing prediction algorithm.
                \item Implemented iChat integration with OS X Spotlight Search by creating tool which extracts metadata from saved chat transcripts and provides metadata to a system-wide search database.
                \item Redesigned chat file format and implemented backwards compatibility for search.
            \end{itemize}
        \end{cvsubsection}

        \begin{cvsubsection}{Lead Student Ambassador}{Microsoft Corporation}{Fall 2003 -- Spring 2005}  
            \begin{itemize}
                \item Promoted to Lead Student Ambassador in Fall 2004; supervised 10 -- 15 Student Ambassadors.
                \item Created and taught Computer Science course, CSE 099: Software Design and Development.
            \end{itemize}
        \end{cvsubsection}

        \begin{cvsubsection}{Head Teaching Assistant}{University of Pennsylvania}{Fall 2001 -- Spring 2005}     
            \begin{itemize}
                \item Courses: Advanced Java III, Software Engineering, Mathematical Foundations of Computer Science I \& II.
                \item Promoted to Head TA in Fall 2004; led weekly meetings and supervised four other TAs.
            \end{itemize}
        \end{cvsubsection}

        \begin{cvsubsection}{Software Design Engineer, Intern}{Microsoft Corporation}{Summers 2001 -- 2003}
            Visual Studio Core (Summer 2003)        
            \begin{itemize}
                \item Implemented a user interface for the VS open file switcher (ctrl-tab) and extended it to tool windows.
                \item Created service to provide gradient across VS and VS add-ins. Optimized service via caching.
            \end{itemize}
            Programmer Productivity Research Center (Summers 2001, 2002)
            \begin{itemize}
                \item Built app to compute similarity of all methods in a code base; reduced time from $O(n^2)$ to $O(n\ log\ n)$. 
                \item Created test case generation tool which creates random XML docs from XML Schema.
            \end{itemize}
        \end{cvsubsection}
    \end{cvsection}

    \begin{cvsection}{Education}
        \begin{cvsubsection}{Philadelphia, PA}{University of Pennsylvania}{Fall 2000 -- May 2005}
            \begin{itemize}
                \item M.S.E. in Computer and Information Science, May 2005. GPA: 3.6
                \item B.S.E. in Computer Science Engineering with Minor in Mathematics, May 2005.  In-major GPA: 3.4.
                \item Graduate Coursework: Software Foundations; Computer Architecture; Algorithms; Artificial Intelligence; Comparison of Learning Algorithms; Computational Theory.
                \item Undergraduate Coursework: Operating Systems; Databases; Algorithms; Programming Languages; Comp. Architecture; Engineering Entrepreneurship; Calculus III.
            \end{itemize}
        \end{cvsubsection}
    \end{cvsection}

    \begin{cvsection}{Technical Experience}
        \begin{cvsubsection}{Projects}{}{}
            \begin{itemize}
                \item \textbf{Multi-User Drawing Tool} (2004). Electronic classroom where multiple users can view and simultaneously draw on a “chalkboard” with each person’s edits synchronized.  C++, MFC
                \item \textbf{Synchronized Calendar} (2003 – 2004). Desktop calendar with globally shared and synchronized calendars, allowing users to schedule meetings with other users.  C\#.NET, SQL, XML
                \item \textbf{Operating System} (2002).  UNIX-style OS with scheduler, file system, text editor and calculator. C
            \end{itemize}
        \end{cvsubsection}
    \end{cvsection}

    \begin{cvsection}{Additional Experience and Awards}
        \begin{cvsubsection}{}{}{}  
            \begin{itemize}
                \item \textbf{Instructor (2003 – 2005):} Taught two full-credit Computer Science courses; average ratings of 4.8 out of 5.0.
                \item \textbf{Third Prize, Senior Design Projects:} Awarded 3rd prize for Synchronized Calendar project, out of 100 projects.
            \end{itemize}
        \end{cvsubsection}
    \end{cvsection}

    \begin{cvsection}{Languages and Technologies}
        \begin{cvsubsection}{}{}{}  
            \begin{itemize}
                \item C++; C; Java; Objective-C; C\#.NET; SQL; JavaScript; XSLT; XML (XSD) Schema 
                \item Visual Studio; Microsoft SQL Server; Eclipse; XCode; Interface Builder
            \end{itemize}
        \end{cvsubsection}
    \end{cvsection}

\end{document}

1
  • It's debatable if you want to use a random CV template from github. The cls file is using \newenvironment{cvsubsection} to define the cvsubsection environment. Within that definition, you're wanting to play around with the \vspace* commands. – Teepeemm May 9 '20 at 18:22
1

In the class file you can find for example the definition of environment \cvsection like this:

\newenvironment{cvsection}[1]{
    \vspace*{\beforesectionheaderspace} % <=======================================
    % Set text margins to equal \tabcolsep (6pt by default)
    \begin{adjustwidth}{\sectionheadermargin}{\sectionheadermargin}
        \textsc{\textbf{#1}}
    \end{adjustwidth}
    \vspace*{\beforesectionheaderhrulespace}
    \hrule height \sectionheaderhrlueheight
    \vspace*{\aftersectionheaderspace} 
}{}

and an definition of \beforesectionheaderspace like this:

\def\beforesectionheaderspace{5pt}

Dito for environment cvsubsection and definition for \aftersubsectionspace. Play with the new values (I choosed 0pt for each, but you can also use negative values ...) for your needs ...

So you simply need to define another values for them in your preamble like:

% \vspace*{\beforesectionheaderspace}
\def\beforesectionheaderspace{0pt} % <================================== 5pt
% \vspace*{\aftersubsectionspace}
\def\aftersubsectionspace{0pt} % <====================================== 4pt

The complete MWE

%% The MIT License (MIT)
%%
%% Copyright (c) 2015 Daniil Belyakov
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the "Software"), to deal
%% in the Software without restriction, including without limitation the rights
%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
%% copies of the Software, and to permit persons to whom the Software is
%% furnished to do so, subject to the following conditions:
%%
%% The above copyright notice and this permission notice shall be included in all
%% copies or substantial portions of the Software.
%%
%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
%% SOFTWARE.

% The font could be set to Windows-specific Calibri by using the 'calibri' option
\documentclass[]{mcdowellcv}

% For mathematical symbols
\usepackage{amsmath}

% Set applicant's personal data for header
\name{Gayle L. McDowell}
\address{123 Spruce St, Apt 35 \linebreak Philadelphia PA 19103}
\contacts{(555) 555-1212 \linebreak gayle@careercup.com}

% \vspace*{\beforesectionheaderspace}
\def\beforesectionheaderspace{0pt} % <================================== 5pt
% \vspace*{\aftersubsectionspace}
\def\aftersubsectionspace{0pt} % <====================================== 4pt


\begin{document}

    % Print the header
    \makeheader

    % Print the content
    \begin{cvsection}{Employment}
        \begin{cvsubsection}{Software Engineer, Intern}{Apple Computer}{Summer 2004}
            iChat AV            
            \begin{itemize}
                \item Reduced time to render the user’s buddy list by 75\% by implementing prediction algorithm.
                \item Implemented iChat integration with OS X Spotlight Search by creating tool which extracts metadata from saved chat transcripts and provides metadata to a system-wide search database.
                \item Redesigned chat file format and implemented backwards compatibility for search.
            \end{itemize}
        \end{cvsubsection}

        \begin{cvsubsection}{Lead Student Ambassador}{Microsoft Corporation}{Fall 2003 -- Spring 2005}  
            \begin{itemize}
                \item Promoted to Lead Student Ambassador in Fall 2004; supervised 10 -- 15 Student Ambassadors.
                \item Created and taught Computer Science course, CSE 099: Software Design and Development.
            \end{itemize}
        \end{cvsubsection}

        \begin{cvsubsection}{Head Teaching Assistant}{University of Pennsylvania}{Fall 2001 -- Spring 2005}     
            \begin{itemize}
                \item Courses: Advanced Java III, Software Engineering, Mathematical Foundations of Computer Science I \& II.
                \item Promoted to Head TA in Fall 2004; led weekly meetings and supervised four other TAs.
            \end{itemize}
        \end{cvsubsection}

        \begin{cvsubsection}{Software Design Engineer, Intern}{Microsoft Corporation}{Summers 2001 -- 2003}
            Visual Studio Core (Summer 2003)        
            \begin{itemize}
                \item Implemented a user interface for the VS open file switcher (ctrl-tab) and extended it to tool windows.
                \item Created service to provide gradient across VS and VS add-ins. Optimized service via caching.
            \end{itemize}
            Programmer Productivity Research Center (Summers 2001, 2002)
            \begin{itemize}
                \item Built app to compute similarity of all methods in a code base; reduced time from $O(n^2)$ to $O(n\ log\ n)$. 
                \item Created test case generation tool which creates random XML docs from XML Schema.
            \end{itemize}
        \end{cvsubsection}
    \end{cvsection}

    \begin{cvsection}{Education}
        \begin{cvsubsection}{Philadelphia, PA}{University of Pennsylvania}{Fall 2000 -- May 2005}
            \begin{itemize}
                \item M.S.E. in Computer and Information Science, May 2005. GPA: 3.6
                \item B.S.E. in Computer Science Engineering with Minor in Mathematics, May 2005.  In-major GPA: 3.4.
                \item Graduate Coursework: Software Foundations; Computer Architecture; Algorithms; Artificial Intelligence; Comparison of Learning Algorithms; Computational Theory.
                \item Undergraduate Coursework: Operating Systems; Databases; Algorithms; Programming Languages; Comp. Architecture; Engineering Entrepreneurship; Calculus III.
            \end{itemize}
        \end{cvsubsection}
    \end{cvsection}

    \begin{cvsection}{Technical Experience}
        \begin{cvsubsection}{Projects}{}{}
            \begin{itemize}
                \item \textbf{Multi-User Drawing Tool} (2004). Electronic classroom where multiple users can view and simultaneously draw on a “chalkboard” with each person’s edits synchronized.  C++, MFC
                \item \textbf{Synchronized Calendar} (2003 – 2004). Desktop calendar with globally shared and synchronized calendars, allowing users to schedule meetings with other users.  C\#.NET, SQL, XML
                \item \textbf{Operating System} (2002).  UNIX-style OS with scheduler, file system, text editor and calculator. C
            \end{itemize}
        \end{cvsubsection}
    \end{cvsection}

    \begin{cvsection}{Additional Experience and Awards}
        \begin{cvsubsection}{}{}{}  
            \begin{itemize}
                \item \textbf{Instructor (2003 – 2005):} Taught two full-credit Computer Science courses; average ratings of 4.8 out of 5.0.
                \item \textbf{Third Prize, Senior Design Projects:} Awarded 3rd prize for Synchronized Calendar project, out of 100 projects.
            \end{itemize}
        \end{cvsubsection}
    \end{cvsection}

    \begin{cvsection}{Languages and Technologies}
        \begin{cvsubsection}{}{}{}  
            \begin{itemize}
                \item C++; C; Java; Objective-C; C\#.NET; SQL; JavaScript; XSLT; XML (XSD) Schema 
                \item Visual Studio; Microsoft SQL Server; Eclipse; XCode; Interface Builder
            \end{itemize}
        \end{cvsubsection}
    \end{cvsection}

\end{document}

gives you then the following resulting pdf:

resulting first page

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.