3

Current state of \part spacing

Currently, trying to reduce the line spacing when I use the \part command. Ideally, I am currently trying to achieve the following result below:

Part I: Project Scope

With the surrounding padding reduced as much as possible. How do I go about achieving this in LaTeX as I've been using the evening to searching for an answer but can't seem to find the answer I need.

I currently have something like this:

\documentclass{article}
\begin{document}
  \part{Project Scope}
  \section{Background}
\end{document}

Regards

  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – user11232 Apr 4 '15 at 22:56
  • 1
    Which document class are you using? Please add a minimal working example (MWE) – user11232 Apr 4 '15 at 22:56
3

Assuming that you use article class, you can do this:

\documentclass{article}
\makeatletter
\def\@part[#1]#2{%
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \normalfont
     \ifnum \c@secnumdepth >\m@ne
       \Large\bfseries \partname\nobreakspace\thepart
       \hskip1em
     \fi
     \Large \bfseries #2%
     \markboth{}{}\par}%
    \nobreak
    \vskip 3ex
    \@afterheading}
   \def\@spart#1{%
   {\parindent \z@ \raggedright
   \interlinepenalty \@M
   \normalfont
   \Large \bfseries #1\par}%
   \nobreak
   \vskip 3ex
   \@afterheading}
     \makeatother
\begin{document}
  \part{Project Scope}
  \section{Background}
\end{document}

enter image description here

or this:

\documentclass{article}
\usepackage{xpatch}
\makeatletter
 \xpatchcmd{\@part}{\par\nobreak}{\hskip1em}{}{}
 \xpatchcmd{\@part}{\huge \bfseries}{\Large \bfseries}{}{}
 \xpatchcmd{\@spart}{\huge \bfseries}{\Large \bfseries}{}{}
\makeatother

\begin{document}
  \part*{Project Scope}
  \section{Background}
\end{document}
  • The first example worked perfectly. Thank you. – Ollie Apr 4 '15 at 23:54

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.