在长文档的目录中,我排除了文本和目录中的章节编号,并对样式进行了修改,bringhust
同时:
\setsecnumdepth{section}
和
\renewcommand{\chapternumberline}[1]{}% no number for chapters in toc
但是,在文档的后半部分,我希望章节编号出现在文本和目录中...但不要在文本或目录中加上章节编号前缀。可以这样做吗?如何做?
为了实现这一目标,我想到了一个微不足道的尝试:用每个节日日期重置部分计数器,然后使用第一个可选参数表示\section
圣人姓名列出的日期,并使用圣人姓名表示其余日期。
例如:
\chapter{January}
\setcounter{section}{16}
\section[— St. Antony the Great][]{St. Antony the Great}
这样,我可以使用memman.pdf
9.2 ToC 方法,将章节编号设置为右对齐。
但是那些讨厌的章节号是有前缀的!!
这是我的 MWE。
\documentclass[11pt]{memoir}
\settypeblocksize{9in}{6in}{*}
\setlrmargins{*}{*}{1}
\setulmargins{.75in}{*}{1}
\checkandfixthelayout
%\tolerance=600
\hfuzz=1.2pt
\usepackage{lipsum}
\chapterstyle{bringhurst}
\renewcommand*{\afterchaptertitle}{%
\vskip\onelineskip}
\renewcommand*{\clearforchapter}{\cleartorecto}
\renewcommand*{\printchaptertitle}[1]{%
\centering\Large\scshape{#1}}
\setsecnumdepth{section}
\renewcommand{\chapternumberline}[1]{}% no number for chapters in toc
\setsecheadstyle{\centering\Large}
%% from memman.pdf 9.2 ToC methods
% To set the section numbers flushright:
\newlength\mylen
\setlength{\mylen}{0.5em}% extra space at end of number
\renewcommand{\cftsectionpresnum}{\hfill} % note the double ‘l’
\renewcommand{\cftsectionaftersnum}{\hspace*{\mylen}}
\addtolength{\cftsectionnumwidth}{\mylen}
\renewcommand{\cftchapterpresnum}{\hfill} % note the double ‘l’
\renewcommand{\cftchapteraftersnum}{\hspace*{\mylen}}
\addtolength{\cftchapternumwidth}{\mylen}
\pagestyle{plain}
\raggedbottom
\frenchspacing
\begin{document}
\frontmatter
\tableofcontents*
\mainmatter
\chapter{January}
\setcounter{section}{4}
\section[— St. Paul the First Hermit, C][]{St. Paul the First Hermit, C}
\lipsum[10]
\setcounter{section}{14}
\section[— Our Lady of the Seeds][]{Our Lady of the Seeds}
\lipsum[14]
\setcounter{section}{15}
\section[— Memorial of the Chains of St. Peter the Apostle][]{Memorial of the Chains of St. Peter the Apostle}
\lipsum[15]
\setcounter{section}{16}
\section[— St. Antony the Great, C][]{St. Antony the Great, C}
\lipsum[16]
\setcounter{section}{22}
\section[— Pope St.Sergius I, C][]{Pope St.Sergius I, C}
\lipsum[17]
\setcounter{section}{23}
\section[— St. Francis de Sales, C][]{St. Francis de Sales, C}
\lipsum[18]
\end{document}
答案1
section
您可以按照下列方式调整文档后半部分的计数器的表示:
\renewcommand{\thesection}{\arabic{section}}
默认以 为前缀\thechapter
。此外,自动添加破折号到你的目录中,因为为了添加一个而重复标题破折号就会导致错误。
\documentclass[11pt]{memoir}
\settypeblocksize{9in}{6in}{*}
\setlrmargins{*}{*}{1}
\setulmargins{.75in}{*}{1}
\checkandfixthelayout
\usepackage{lipsum}
\chapterstyle{bringhurst}
\renewcommand*{\afterchaptertitle}{%
\vskip\onelineskip}
\renewcommand*{\clearforchapter}{\cleartorecto}
\renewcommand*{\printchaptertitle}[1]{%
\centering\Large\scshape{#1}}
\setsecnumdepth{section}
\renewcommand{\chapternumberline}[1]{}% no number for chapters in toc
\setsecheadstyle{\centering\Large}
%% from memman.pdf 9.2 ToC methods
% To set the section numbers flushright:
\renewcommand{\cftsectionpresnum}{\hfill} % note the double ‘l’
\renewcommand{\cftsectionaftersnum}{~---~}
\addtolength{\cftsectionnumwidth}{1.5em}
\pagestyle{plain}
\begin{document}
\frontmatter
\tableofcontents*
\mainmatter
\chapter{January}
\setcounter{section}{4}
\section{St.~Paul the First Hermit, C}
\lipsum[10]
\setcounter{section}{14}
\section{Our Lady of the Seeds}
\lipsum[14]
\setcounter{section}{15}
\section{Memorial of the Chains of St. Peter the Apostle}
\lipsum[15]
\setcounter{section}{16}
\section{St. Antony the Great, C}
\lipsum[16]
\setcounter{section}{22}
\section{Pope St.~Sergius I, C}
\lipsum[17]
\setcounter{section}{23}
\section{St. Francis de Sales, C}
\lipsum[18]
\chapter{February}
\renewcommand{\thesection}{\arabic{section}}%
\setcounter{section}{4}
\section{St.~Paul the First Hermit, C}
\lipsum[10]
\setcounter{section}{14}
\section{Our Lady of the Seeds}
\lipsum[14]
\setcounter{section}{15}
\section{Memorial of the Chains of St. Peter the Apostle}
\lipsum[15]
\setcounter{section}{16}
\section{St. Antony the Great, C}
\lipsum[16]
\setcounter{section}{22}
\section{Pope St.~Sergius I, C}
\lipsum[17]
\setcounter{section}{23}
\section{St. Francis de Sales, C}
\lipsum[18]
\end{document}