我使用pdflatex
(TeX Live 2013)。我尝试制作一本包含 27 个部分的书。它是俄语的。只有最后一部分有\section
和\subsection
。此外,我需要在奇数页的顶部页眉上显示书名,在偶数页的顶部页眉上显示书各部分的名称。为了编译\tableofcontents*
(没有数字,只有部分名称),我尝试使用此解决方案。但在我的例子中,它不能正常工作。第一页变成了空白页,页码为“1”,目录与第二页的底部边距重叠。而且它不会延续到第三页。它只是“消失了”。
。
我用了这个代码:
\documentclass[a4paper,twoside]{memoir}
\usepackage{tocloft}
\usepackage{tocvsec2}
\begin{document}
\setsecnumdepth{none}
\addtocontents{toc}{\protect\renewcommand{\protect\cftpartpresnum}{}}
\tableofcontents*
\part*{Name of the part 1}
\addcontentsline{toc}{part}{Name of the part 1}
\markboth{Name of book}{Name of the part}
\part*{Name of the part 2}
\addcontentsline{toc}{part}{Name of the part 2}
\markboth{Name of book}{Name of the part}
%-----------
\part*{Name of the part 27}
\addcontentsline{toc}{part}{Name of the part 27}
\markboth{Name of book}{Name of the part}
\section{Name of Section}
\subsection{Name of Subsection}
\end{document}
我做错了什么?有人能帮我吗?
答案1
我不知道这是否适合您的用例:
\documentclass[a4paper,twoside]{memoir}
\usepackage{tocloft}
\usepackage{tocvsec2}
\usepackage{etoolbox}
\makeatletter
\apptocmd\l@part{\null\kern-\baselineskip}{}{}
\makeatother
\begin{document}
\setsecnumdepth{none}
\addtocontents{toc}{\protect\renewcommand{\protect\cftpartpresnum}{}}
\tableofcontents*
\part*{Name of the part 1}
\addcontentsline{toc}{part}{Name of the part 1}
\markboth{Name of book}{Name of the part}
\part*{Name of the part 2}
\addcontentsline{toc}{part}{Name of the part 2}
\markboth{Name of book}{Name of the part}
\newcount\partcnt
\partcnt 3
\loop
\part*{Name of the part \the\partcnt }
\addcontentsline{toc}{part}{Name of the part \the\partcnt}
\markboth{Name of book}{Name of the part}
\ifnum\partcnt<26
\advance\partcnt 1
\repeat
\part*{Name of the part 27}
\addcontentsline{toc}{part}{Name of the part 27}
\markboth{Name of book}{Name of the part}
\section{Name of Section}
\subsection{Name of Subsection}
\end{document}