
\part、\section、\subsection の新しいタイトル形式を作成しました。現在、各タイトルの上下に垂直スペースを挿入しようとしています。\part の場合は問題なく機能しますが、他の 2 つでは上のスペースは機能せず、テキストの下のスペースは機能します。なぜでしょうか。
\documentclass[]{article}
\usepackage{titlesec}
%\usepackage{xcolor}
\usepackage{titletoc}
%\usepackage{enumitem}
\usepackage[a4paper]{geometry}
\usepackage{showframe}
%\usepackage{fancyhdr}
%\usepackage{nameref}
\newcommand\content{%
\titleformat{\part}
[block]
{\centering\Large\bfseries}
{\MakeUppercase{Section}\thepart\linebreak}
{1ex}
{\MakeUppercase}
\titlespacing{\part}{0pt}{2cm}{1cm}
\titleformat{\section}
[block]
{\centering\Large\bfseries}
{\MakeUppercase{Section} \thepart\thesection\linebreak}
{1ex}
{\MakeUppercase}
\titlespacing{\section}{0pt}{2cm}{1cm}
\titleformat{\subsection}
[block]
{\centering\Large\bfseries}
{\MakeUppercase{Section}\thepart\thesection\thesubsection\linebreak}
{1ex}
{\MakeUppercase}
\titlespacing{\subsection}{0pt}{2cm}{1cm}}
\newcommand\testtitle{%
\titleformat{\section}
[hang]
{\normalfont\normalsize\bfseries}
{\thepart\thesection}
{1ex}
{\MakeUppercase}
\titleformat{\subsection}
[hang]
{\normalfont\normalsize\bfseries}
{\thepart\thesubsection}
{1ex}
{\MakeUppercase}
\titleformat{\subsubsection}
[hang]
{\normalfont\normalsize\bfseries}
{\thepart\thesubsubsection}
{1ex}
{\MakeUppercase}}
\begin{document}
\content
\part{aet}
Lorem
\newpage
\section{ok}
Lorem
\newpage
\subsection{lorem}
Lorem
\end{document}