我正在将一本较旧的书转换成 tex,我需要模仿一个奇怪的目录(见下文图片),但我找不到任何合适的模型来开始工作。我使用了以下结构(如图所示):高级标题(INTRODUCTION、FORM)被视为部分,然后是章节,最后是每个章节下的子部分(见下文代码)。关于从哪里开始以及使用哪个包,有什么建议吗?
\documentclass[10pt, paper=9.250in:6.125in,pagesize,
twoside]{scrbook}
\usepackage[T1]{fontenc}
\begin{document}
\tableofcontents
\newpage
\section{Preface}
\sectionmark{Preface}
\newpage
\section{INTRODUCTION}
\sectionmark{Introduction}
\newpage
\chapter{Comparative Biology: Space, Time, and Form}
\chaptermark{Comparative Biology}
\subsection{The Science of Comparative Biology}
\subsection{Problems of Form: Systematics}
\subsection{Problems of Time: Ontogeny and Paleontology}
\subsection{Problems of Space; Biogeography}
\section{FORM}
\sectionmark{Form}
\newpage
\chapter{Systematic History: Kinds of Branching Diagrams}
\chaptermark{Systematic History}
\subsection{Natural Kinds}
\subsection{Stability of Classification}
\newpage
\chapter{Systematic Patterns: Component Analysis}
\chaptermark{Systematic Patterns}
\subsection{Cladograms, Trees, and Components}
\subsection{Cladograms and Information}
\subsection{Trees and Information}
\subsection{A Postscript on Parsimony}
\subsection{Information, Phyletics, and Phenetics}
\subsection{Information and Components}
\subsection{Incomplete Information, Multiple Branching, and Reticulation}
\end{document}
答案1
虽然不是完整的答案,但可以为您提供帮助。以下基于memoir
类(的超集book
)的 MWE 生成的 ToC 总体上看起来像您想要的。
% weirdtocprob.tex SE 633903
\documentclass{memoir}
%%% this is a revision from the .sty file for memoir
%%% but I can't remember just how it worked
%%% list sections in ToC as a paragraph
\makeatletter
\newcommand*{\setupparasecs}{%
\let\oldnumberline\numberline
\renewcommand*{\cftsectionfont}{\upshape}
\renewcommand*{\cftsectionpagefont}{\upshape}
\renewcommand{\l@section}[2]{
\ifnum\c@tocdepth > 0\relax
\def\numberline####1{\textup{####1}~}%
\leftskip=\cftsectionindent
\rightskip=\@tocrmarg
\parfillskip=\fill
\ifhmode \llap{,}\ \else\noindent\fi
\ignorespaces
{\cftsectionfont ##1}~{\cftsectionpagefont##2}%
\let\numberline\oldnumberline\ignorespaces
\fi}
}
\makeatother
\setupparasecs
\renewcommand{\cftchaptername}{Chapter }
\renewcommand{\thesection}{} %% no section numbers
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\addtocontents{toc}{\centering INTRODUCTION \par}
\chapter{First chapter}
\section{One section}
\section{Two section}
\section{Three section}
\newpage
\section{Another}
\section{And another with a longer title}
\section{One more and let's see how this is in the ToC}
\end{document}
您可以修改文档中的部门(章节/部分)代码,以便向目录提供适当的命令。
编辑——添加了图片