如何增加章节/小节标题与定理之间的空间

如何增加章节/小节标题与定理之间的空间

我想在定理和前面一行之间添加一些空格。

我使用titlesecamsthm自定义间距,但是当定理就在小节之后时,定理之前所需的间距就不会被遵守。

如何增加章节/小节标题和定理之间的空间?


以下是显示该问题的 MWE。

\documentclass{article}

% -------------------------------------------------- %
\usepackage[explicit]{titlesec}

\titleformat{\section}
  {\bigskip\bfseries\large}
  {\Roman{section}. }
  {0em}
  {#1}

\titleformat{\subsection}
  {\smallskip\bfseries}
  {\arabic{subsection}) }
  {0em}
  {#1}
  
\titleformat{\subsubsection}
  {\itshape}
  {{\normalfont\alph{subsubsection})}}
  {.5em}
  {#1}

\titlespacing{\section}{0.5ex}{*1}{1ex}
\titlespacing{\subsection}{0.5ex}{*2}{*0}
\titlespacing{\subsubsection}{0.5ex}{*0}{*0}
% -------------------------------------------------- %


% -------------------------------------------------- %
\usepackage{amsthm}

\newtheoremstyle{theorem-style}
  {3pt}% space before
  {3pt}% space after
  {\itshape}
  {}% indent
  {\bfseries}% header font
  {.\vspace{0.5mm}}% punctuation
  {\newline}% after theorem header
  {}% header specification (empty for default)

\theoremstyle{theorem-style}

\newtheorem*{proposition}{Proposition}
% -------------------------------------------------- %


\begin{document}

\section{Section}
\subsection{Subsection}
\subsection{Subsection}
\subsection{Subsection}

\begin{proposition}
This proposition is too close to the title.
\end{proposition}

\subsection{Subsection}

Some text.

\begin{proposition}
This proposition is not too close to the preceding line.
\end{proposition}

\end{document}

在此处输入图片描述

编辑

根据评论中给出的想法,我尝试过

\titleformat{\subsection}
  {\smallskip\bfseries}
  {\arabic{subsection}) }
  {0em}
  {#1}
  [\strut\vspace{-\baselineskip}]

但它不起作用。

答案1

\@afterheading期望后面跟着一个普通段落。这将提供一个不可见的段落。仅在需要时使用。

\documentclass{article}

% -------------------------------------------------- %
\usepackage[explicit]{titlesec}

\titleformat{\section}
  {\bigskip\bfseries\large}
  {\Roman{section}. }
  {0em}
  {#1}

\titleformat{\subsection}
  {\smallskip\bfseries}
  {\arabic{subsection}) }
  {0em}
  {#1}
  
\titleformat{\subsubsection}
  {\itshape}
  {{\normalfont\alph{subsubsection})}}
  {.5em}
  {#1}

\titlespacing{\section}{0.5ex}{*1}{1ex}
\titlespacing{\subsection}{0.5ex}{*2}{*0}
\titlespacing{\subsubsection}{0.5ex}{*0}{*0}
% -------------------------------------------------- %


% -------------------------------------------------- %
\usepackage{amsthm}

\newtheoremstyle{theorem-style}
  {3pt}% space before
  {3pt}% space after
  {\itshape}
  {}% indent
  {\bfseries}% header font
  {.\vspace{0.5mm}}% punctuation
  {\newline}% after theorem header
  {}% header specification (empty for default)

\theoremstyle{theorem-style}

\newtheorem*{proposition}{Proposition}
% -------------------------------------------------- %


\begin{document}

\section{Section}
\subsection{Subsection}
\subsection{Subsection}
\subsection{Subsection}\strut\vspace{-\baselineskip}

\begin{proposition}
This proposition is too close to the title.
\end{proposition}

\subsection{Subsection}

Some text.

\begin{proposition}
This proposition is not too close to the preceding line.
\end{proposition}

\end{document}

相关内容