中文节标题(section和subsection)距离正文的距离无法调整。

发布于 2025-02-01 02:48:17

中文节标题行间距无法调整,代码如下:

\RequirePackage[heading=true]{ctex}

\setcounter{secnumdepth}{3}

\ctexset{
    chapter={
        format={\centering\sanhao\heiti\timesnewroman},
        aftername=\hspace{\ccwd},
        beforeskip={26bp},
        afterskip={18bp},
        name={第, 章},
        fixskip = true, % 添加配置
        number=\arabic{chapter},
        indent=0bp
    },
    section={
        format={\raggedright\heiti\sihao\timesnewroman},
        aftername=\hspace{\ccwd},
        beforeskip={24bp},
        afterskip={6bp},
        fixskip=true,
        number={\thechapter.\arabic{section}}
    },
    subsection={
        format={\raggedright\banxiaosi\heiti\timesnewroman},
        aftername=\hspace{\ccwd},
        beforeskip={12bp},
        afterskip={6bp},
        fixskip = true,
        number = {\thechapter.\arabic{section}.\arabic{subsection}}
    }
}

其中section和subsection里面的beforeskip和afterskip,无论调成多少都没有产生变化,解析出来的pdf如下:
Quicker_20250201_024211.png

明显标题跟正文距离不是6bp,这个需要怎么调整?

查看更多

关注者
0
被浏览
131
1 个回答
Sagittarius Rover
Sagittarius Rover 15小时前
我要成为Typst糕手/(ㄒoㄒ)/~~

你的代码并不完整\sanhao,\sihao\timesnewroman在标准文档类book以及ctex中并没有定义。我无法复现你所说的:

其中sectionsubsection里面的beforeskipafterskip,无论调成多少都没有产生变化

有可能是你文档中其他的设置影响了这一弹性长度,因此你需要提供最小工作示例

\documentclass{book}
\RequirePackage[heading=true]{ctex}
% \setcounter{secnumdepth}{3}
\ctexset{
    % chapter={
    %     % format={\centering\sanhao\heiti\timesnewroman},
    %     aftername=\hspace{\ccwd},
    %     beforeskip={26bp},
    %     afterskip={18bp},
    %     name={第, 章},
    %     fixskip = true, % 添加配置
    %     number=\arabic{chapter},
    %     indent=0bp
    % },
    section={
        % format={\raggedright\heiti\sihao\timesnewroman},
        aftername=\hspace{\ccwd},
        beforeskip={24bp},
        afterskip={60bp},
        fixskip=true,
        number={\thechapter.\arabic{section}}
    },
    subsection={
        % format={\raggedright\banxiaosi\heiti\timesnewroman},
        aftername=\hspace{\ccwd},
        beforeskip={12bp},
        afterskip={60bp},
        fixskip = true,
        number = {\thechapter.\arabic{section}.\arabic{subsection}}
    }
}
\usepackage{zhlipsum}
\begin{document}
    \chapter{00}
    \section{sec000}
        我能吞下玻璃而不伤身体。我能吞下玻璃而不伤身体。
        \subsection{subsec000}
        我能吞下玻璃而不伤身体。我能吞下玻璃而不伤身体。
\end{document}

image.png

请你提供最小工作示例(使用"补充问题"功能修改你的问题),同时建议再次仔细研究ctex宏包的文档.

image.png

image.png

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览