当标题出现在页首时,beforeskip消失。
正常:
页首:
在站里找到了之前的回答: https://wenda.latexstudio.net/answer/1911/2957.html
\usepackage{xpatch}
\makeatletter \xpatchcmd
\@startsection {\addvspace} {\vspace*} {}{\fail}
\makeatother
patch之后空白变多了:
\documentclass[zihao=5]{ctexart}
\usepackage[bodytextleadingratio=1.2]{zhlineskip}
\usepackage[pass, showframe]{geometry}
\usepackage{multicol}
\setlength{\columnsep}{\ccwd}
\setlength{\columnseprule}{0.4pt}
\ctexset
{
section={
fixskip=true,
format=\zihao{4}\heiti\centering,
beforeskip = 13.575bp,
afterskip = 13.575bp
},
subsection={
fixskip=true,
format=\zihao{-4}\heiti\raggedright,
beforeskip = 8.3bp,
afterskip = 8.3bp
}
}
\newcommand{\test}{\noindent\rule{\linewidth}{\ccwd}}
\usepackage{xpatch}
\makeatletter \xpatchcmd\@startsection {\addvspace} {\vspace*} {}{\fail} \makeatother
\raggedbottom
\begin{document}
\begin{multicols}{2}
\test
\section{测试}
\test
\test
\subsection{测试}
\test
\newcolumn
\test
一
二
三
\test
\test
一
二
\test
\end{multicols}
\newpage
\begin{multicols}{2}
% \test
\section{测试}
\test
\test
\subsection{测试}
\test
\newcolumn
% \test
一
二
三
\test
\test
一
二
\test
\end{multicols}
\end{document}
可能有用?:
https://ask.latexstudio.net/ask/question/17394.html
https://github.com/CTeX-org/ctex-kit/issues/207
https://github.com/CTeX-org/ctex-kit/issues/248