调整章节标题之后和 tcolorbox 环境之前的垂直间距

调整章节标题之后和 tcolorbox 环境之前的垂直间距

如何调整节标题之后和tcolorbox环境之前的垂直间距?

这是我的 MWE:

在此处输入图片描述

\documentclass{scrbook}
\usepackage{mathtools, amsthm, amssymb} % Math packages
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math} % Math fonts
\setmathfont{Latin Modern Math}
\usepackage[most]{tcolorbox} % Colored boxes

% Heading font size
\setkomafont{chapter}{\huge}
\setkomafont{section}{\LARGE}

% Spacing
\renewcommand*{\chapterheadstartvskip}{\vspace*{0cm}}
\renewcommand*{\chapterheadendvskip}{\vspace*{\baselineskip}}
\RedeclareSectionCommands[
  beforeskip=-.5\baselineskip,
  afterskip=.5\baselineskip
]{section}

% Custom tcolorbox environment
\newtcolorbox{mybox}[1][]{colback=black!5!white,colframe=black,boxrule=1pt,arc=0mm,#1}

\begin{document}

\chapter{Limits}
\section{Provisional Definition of the  Limit of a Function}

\begin{mybox}[before skip=2ex, after skip=4ex,boxsep=0pt]
    The function \(f\) approaches the limit \(L\) near \(c\), if we can make \(f(x)\) as close as we like to \(L\) by requiring that \(x\) be sufficiently close to, but unequal to, \(c\).
\end{mybox}

\end{document}

看起来,即使我将before skip值调整为任意值,它似乎也不会影响垂直间距除非我在中间添加了一个文本或空白\,如下所示:

在此处输入图片描述

\section{Provisional Definition of the  Limit of a Function}
\
\begin{mybox}[before skip=2ex, after skip=4ex,boxsep=0pt]
    The function \(f\) approaches the limit \(L\) near \(c\), if we can make \(f(x)\) as close as we like to \(L\) by requiring that \(x\) be sufficiently close to, but unequal to, \(c\).
\end{mybox}

插入的空格是\必要的吗?谢谢。

相关内容