I am stuck with a very strict requirement to keep the space between chapter/sections/subsections/paragraph headers the same. After a chapter header, I need to have a triple space. After section headers, I need to have a double space. I have been able to do this, however, if I do not have additional text between a chapter title and the first section header, then the spaces add (triple space + double space). Is there a way to have an if statement acknowledges that if there is text, only use a triple space, whereas if the text is displayed, then use the double space?
\titlespacing{\chapter}{0in}{\UOneInChapterSpace}{\UHeadSpace}[0in]
\titlespacing{\section}{0in}{0in}{\UDoubleSpace}[0in]
\titlespacing{\subsection}{0in}{0in}{\UDoubleSpace}[0in]
\titlespacing{\subsubsection}{0in}{0in}{\UDoubleSpace}[0in]
\titlespacing{\paragraph}{1em}{1ex}{1ex}[1em]
\titleformat{\chapter}
[display]
{\color{URED}\centering\normalfont\Large\bfseries\doublespacing}
{\MakeUppercase{\chaptertitlename} \Large\thechapter}
{0in}
{\MakeUppercase}
[]
\titleformat{\section}
[hang]
{\centering\singlespacing\normalfont\Large\bfseries}
{\thesection}
{1ex}
{}
[]
\titleformat{\subsection}
[hang]
{\centering\singlespacing\normalfont\large\bfseries}
{\thesubsection}
{1ex}
{}
[]
\titleformat{\subsubsection}
[hang]
{\centering\singlespacing\normalfont\normalsize\bfseries}
{\thesubsubsection}
{1ex}
{}
[]
\titleformat{\paragraph}
[runin]
{\centering\singlespacing\normalfont\normalsize\bfseries}
{\theparagraph}
{1ex}
{}
[]
\titleformat{\subparagraph}
[runin]
{\centering\singlespacing\normalfont\normalsize\bfseries}
{\thesubparagraph}
{1ex}
{}
[]
I posted a previous question that has the entire cls file (Link). I'm just not sure how to do this.
Thank you!


\documentclass{MastersDoctoralThesis}? – Simon Dispa May 18 '21 at 13:24\AtBeginEnvironment{figure}{\addvspace{\UHeadSpace}}and similars. – Simon Dispa May 18 '21 at 19:56