我的小测试示例如下
\documentclass[12pt]{book}
\usepackage{lipsum}
\usepackage{hyperref}
\hypersetup{
bookmarksnumbered=true,
bookmarksopen=true,
bookmarksdepth=2,
}
\setcounter{secnumdepth}{3} % ch=0,sec=1,subsec=2,subsubsec=3
\setcounter{tocdepth}{2}
\renewcommand{\chaptername}{} %% remove the word \chapter
\usepackage{titlesec}
\titleformat{\chapter}[hang]
{\LARGE\bfseries}{Lec~\arabic{chapter}~~}{0pt}{\LARGE\bfseries}
\titleformat{\section}
{\normalfont\Large\bfseries\filcenter}{\S~\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\large\bfseries}{\Roman{subsection}.}{1em}{}
\titleformat{\subsubsection}[runin]{\normalfont\large\bfseries}
{\arabic{chapter}.\arabic{section}.\arabic{subsubsection}}{1em}{}
\usepackage{fancyhdr}
\pagestyle{fancy}
\begin{document}
\tableofcontents
\chapter{Water}
\lipsum[1]
\section{Ocean}
\subsection{River}
\lipsum[1]
\subsubsection{Pond}
\lipsum[1-3]
\subsubsection{Brook}
\lipsum[1-3]
\chapter{Whale}
\lipsum[1]
\section{Shark}
\subsection{Carp}
\lipsum[1]
\subsubsection{Shrimp}
\lipsum[1-3]
\subsubsection{Crab}
\lipsum[1-3]
\end{document}
如您所见,我希望 Ch、Sec 和 Subsec 的编号为
Lec 1
SS 1.1
I
II
III
...
SS 1.2
I
II
III
...
...
Lec 2
SS 2.1
I
II
III
...
SS 2.2
I
II
III
...
...
...
它们在文本中精确呈现。但是,书签、目录和花式页眉不会自动更新相应的编号,而只是显示类似
1
1.1
1.1.1
2
2.1
2.1.1
我该如何解决这些问题?