CTeX-org / ctex-kit

Macro Packages and Scripts for Chinese TeX users
972 stars 124 forks source link

加载 titlesec 宏包后,页眉的章节名对应数字丢失 #599

Closed EnkiduGilgamesh closed 2 years ago

EnkiduGilgamesh commented 2 years ago

使用 titlesec 宏包后,页眉只剩下章节名,章节名对应的数字(所在章节)丢失。

title-issue

我的测试样例

\documentclass[oneside]{ctexart}  % or twoside

% to fix this issue
%\renewcommand{\sectionmark}[1]{\markboth{}{\thesection\quad#1}}
%\renewcommand{\subsectionmark}[1]{\markboth{\thesubsection\quad#1}{}}
%\renewcommand{\sectionmark}[1]{\markright{\thesection\quad#1}}

\usepackage{titlesec}
\usepackage{lipsum}
\begin{document}
    %\pagestyle{headings}
    \section{A}
    \subsection{My Subsection}
    \lipsum[1-10]
    \section{B}
    \lipsum[2-9]
\end{document}
muzimuzhi commented 2 years ago

本地 texlive 2021 latest 能复现,在 overleaf 上测试,texlive 2021--2017 都能复现,只有 texlive 2016 (overleaf v1) 输出正常。猜测,用 ctex 文档类时,大多数时候就直接用自带的 ctexheading 设置章节标题样式了,使用 titlesec 的极少。

更新:使用 \usepackage[loadonly]{titlesec} 时问题消失,所以问题出在 \ctex_titlesec_hook: