EDIT: I've adjusted this question after experimenting with the titlesec package. I removed the following code to prevent conflicts as suggested by @Bernard & @cfr.

\makeatletter
\renewcommand{\section}{\@startsection{section}{1}
{\z@}
{\b@level@one@skip}
{\e@level@one@skip}
{\centering\normalfont\normalsize}}
\renewcommand{\subsection}{\@startsection{subsection}{2}
{\z@}
{\b@level@two@skip}
{\e@level@two@skip}
{\centering\normalfont\normalsize\itshape}}


I need to achieve the following spacing for my headers:

1. Triple space following Sections (e.g., INTRODUCTION, METHODS, etc.)
2. Triple space preceding freestanding Subsection heading followed by a double space.

NOTE: I'm using 12pt font.

Also note that I'm using the setspace package to achieve double spacing (\usepackage[doublespacing]{setspace}). This makes it difficult (for me anyway) to know if I'm meeting the spacing requirements of my university. Since I've already been corrected by the thesis office twice, is there a way to know for certain if my LaTeX document is meeting these requirements (something more exact than an eyeball test)?

MWE:

\documentclass[doc,12pt,floatsintext,longtable,natbib]{apa6}
\usepackage[up,tiny,center]{titlesec}
\usepackage{lipsum} % dummy text only
\usepackage[doublespacing]{setspace}

\geometry{reset, letterpaper, height=9in, width=6in, hmarginratio=1:1, vmarginratio=1:1, marginparsep=0pt, marginparwidth=0pt, headheight=15pt}
\setlength{\parindent}{0.5in}
\raggedbottom

\titleformat{\section}
{\normalfont\normalsize\upshape}{\thesection}{1em}{\centering}
\titlespacing\section{0pt}{0pt}{12pt}

\titleformat{\subsection}
{\normalfont\normalsize\itshape}{\thesubsection}{1em}{\centering}
\titlespacing\subsection{0pt}{0pt}{0pt}

\begin{document}
\thispagestyle{empty}
\section{INTRODUCTION}
\lipsum
\subsection{Background}
\lipsum
\clearpage
\thispagestyle{empty}
\section{METHODS}
\lipsum
\subsection{Statistical Analysis}
\end{document}


EDIT: In the special case where a subsection begins on a new page, a blank line is inserted above the heading. How does one get rid of this space? The spacing before and after the subsection heading is correct in the other cases.

EDIT: Also, in the special case where a subsection directly follows a section heading, the space in between is greater than a triple space.

NOTE: Both of these spacing issues weren't apparent using the original coding (i.e, not the titlesec package) that changed the functionality of the section headings (i.e., the code between \makeatletter and \makeatother).

• I think there's a conflict between your low level commands (between \makeatletter and makeatother) and the commands that use titlesec. You must choose which way you want to go. – Bernard Jul 12 '15 at 18:13
• Use titlesec's commands to change the fonts etc. as well. Otherwise, one thing will overwrite the changes made by the other. – cfr Jul 12 '15 at 18:46
• Since you are not sure what your thesis office's requirements even mean, I don't see how you can possibly be sure whether you are meeting them. Does a double space mean skip 2 lines? Or does it mean skip 2*2 lines since you are double-spacing? If you don't want to ask them again, the only things I can suggest are the following: (1) get a recent thesis from the library and compare or (2) find a copy of Word and a box to run it on and see what it looks like if you follow the rules in the 'obvious' way. Or get together with other students and take turns to ask the questions! – cfr Jul 12 '15 at 22:29
• @cfr That is not what was stated in the question. I understand the thesis requirements. A double space means skip 2 lines and a triple space means skip 3 lines in which a line is equal to the height of the font. Therefore, since I'm using 12 pt font, a double space would be equivalent to a gap of 12pt (2 returns) and a triple space would be a gap equivalent to 24pt (3 hits of the return key). Since I'm not getting a graduate degree in formatting, it's difficult to decipher what LaTeX is doing. Rather than just trusting the space that is created, it would be beneficial to have confirmation. – Edward Jul 12 '15 at 22:51
• If you are sure that is what they mean, that's different. But that is not stated in the question ;). I thought you meant that you weren't sure how to interpret those requirements, given that you were double-spacing. Obviously I misunderstood. – cfr Jul 12 '15 at 23:07