使用 titletoc 修改目录

使用 titletoc 修改目录

我需要从子部分条目中删除部分类别的罗马数字和字母枚举标记。然后我希望章节有阿拉伯数字。当我试图显示一些章节标题太长或有副标题时,我使用章节命令的可选参数以便在标题中使用它们。但我需要目录中的标题,例如“历史概念的形成:在原始人的思想中……”,所以我手动将其添加到目录中。我还想在长度方面在思想和其他类似标题之后有一个断行。当目录中的章节条目附加数字时,当行断开时,下一行中章节标题的其余部分将从上一行文本的正下方开始,而不是从该条目的编号下方开始。章节标题与前言、插图位于相同的水平位置。

谢谢您,对于我列出一系列请求我深感抱歉。

\documentclass[b5paper]{book}
\usepackage{kantlipsum}
\usepackage{geometry}
\usepackage{titletoc}
\usepackage[rm,small,center,compact,newparttoc,clearempty,toctitles,pagestyles]{titlesec}
% New Sectioning Levels
    % frontms
    \titleclass{\frontms}{page}[\chapter]
    \newcounter{frontms}
    \renewcommand{\thefrontms}{\Alph{frontms}}
    \newcommand{\frontmsname}{FMs}
    \titlespacing{\frontms}{0pt}{0pt}{0pt}
    % subpart
    \titleclass{\subpart}{page}[\part]
    \newcounter{subpart}
    \renewcommand{\thesubpart}{\Alph{subpart}}
    \newcommand{\subpartname}{Subpart}
    \titlespacing{\subpart}{0pt}{0pt}{0pt}

% Sectioning Levels' Format
\titleformat{\frontms}[display]{\centering\Large\bfseries}{}{}{\huge}
\titleformat{\subpart}[frame]{\centering\Large\bfseries}{\subpartname~\thesubpart}{1pc}{\Huge\bfseries}
\titleformat{\part}[display]{\centering\Huge\bfseries}{\partname~\thepart}{1pc}{\Huge\bfseries}

% Formatting toc enteries
\titlecontents{part}[0pt]{\addvspace{2pc}}{\thecontentslabel\enspace\enspace\large\bfseries}
{\Large\bfseries}{\hspace{1em plus 1fill}\large\contentspage}

\titlecontents{subpart}[0pt]{\addvspace{1pc}}{\thecontentslabel\enspace\enspace\large\itshape}{\Large}{\hspace{2em plus 1fill}\large\contentspage\itshape}

\titlecontents{frontms}[15pt]{\addvspace{-2pt}}{\thecontentslabel\enspace\enspace\large}
{\large\itshape}{\hspace{1em plus 1fill}\large\contentspage}

\titlecontents{chapter}[0pt]{\addvspace{10pt}}{\thecontentslabel\enspace\enspace\normalsize\bfseries}{\large}{\hspace{1em plus 1fill}\large\contentspage}



% Main Page Style
\newpagestyle{main}{
    \sethead[][\parttitle][] % even
    {}{\chaptertitle}{} % odd
    \setfoot[][\thepage][]
    {}{\thepage}{}
    \settitlemarks{part,chapter}}
\pagestyle{main}
\setcounter{secnumdepth}{0}
\usepackage{times}
\begin{document}


\frontmatter

\listoffigures
\addcontentsline{toc}{frontms}{Figures}
\frontms[Preface]{Preface}
\frontms{Acknowledgments}
\tableofcontents
\mainmatter
\pagestyle{main}

\part{History}

\subpart{Primitive Historians}

\chapter[The Formation of the Concept of History]{The Formation of the Concept of History:\\{in the Minds of the Primitives through ...}}
%\addcontentsline{toc}{chapter}{The Formation of the Concept of History: in the Minds of the Primitives through...}
\chapter{title}
\kant[1-10]
\part{History}

\subpart{Primitive Historians}

\chapter[The Formation of the Concept of History]{The Formation of the Concept of History:\\{in the Minds of the Primitives through ...}}
%\addcontentsline{toc}{chapter}{The Formation of the Concept of History: in the Minds of the Primitives through...}
\chapter{title}
\kant[1-10]
\end{document}

在此处输入图片描述

答案1

times这是你想要的吗?注意我用替换了过时的包newtxtext, newtxmath,它提供了真正的小型大写字母和一些其他字形。

\documentclass[b5paper]{book}
\usepackage{kantlipsum}
\usepackage{geometry}
\usepackage{xcolor} \usepackage{titletoc}
\usepackage[rm,small,center,compact,newparttoc,clearempty,toctitles,pagestyles, newlinetospace]{titlesec}
% New Sectioning Levels
    % frontms
    \titleclass{\frontms}{page}[\chapter]
    \newcounter{frontms}
    \renewcommand{\thefrontms}{\Alph{frontms}}
    \newcommand{\frontmsname}{FMs}
    \titlespacing{\frontms}{0pt}{0pt}{0pt}
    % subpart
    \titleclass{\subpart}{page}[\part]
    \newcounter{subpart}
    \renewcommand{\thesubpart}{\Alph{subpart}}
    \newcommand{\subpartname}{Subpart}
    \titlespacing{\subpart}{0pt}{0pt}{0pt}

% Sectioning Levels' Format
\titleformat{\frontms}[display]{\centering\Large\bfseries}{}{}{\huge}
\titleformat{\subpart}[frame]{\centering\Large\bfseries}{\subpartname~\thesubpart}{1pc}{\Huge\bfseries}
\titleformat{\part}[display]{\centering\Huge\bfseries}{\partname~\thepart}{1pc}{\Huge\bfseries}

% Formatting toc entries
\titlecontents{part}[0pt]{\addvspace{2pc}}{\large\bfseries}%
{\Large\bfseries}{\hspace{1em plus 1fill}\large\contentspage}

\titlecontents{subpart}[0pt]{\addvspace{1pc}}{\large\itshape}{\Large\hspace*{-2em}}{\hspace{2em plus 1fill}\large\contentspage\itshape}%

\titlecontents{frontms}[0pt]{\addvspace{-2pt}}{\large}%
{\large\itshape}{\hspace{1em plus 1fill}\large\contentspage}

\titlecontents{chapter}[0pt]{\addvspace{10pt}}{\contentspush{\thecontentslabel\quad}\normalsize\bfseries}{\Large}{\hspace{1em plus 1fill}\large\contentspage}

% Main Page Style
\newpagestyle{main}{
    \sethead[][\parttitle][] % even
    {}{\chaptertitle}{} % odd
    \setfoot[][\thepage][]
    {}{\thepage}{}
    \settitlemarks{part,chapter}}
\pagestyle{main}
\setcounter{secnumdepth}{0}
\usepackage{newtxtext, newtxmath}
\begin{document}


\frontmatter

\listoffigures
\addcontentsline{toc}{frontms}{Figures}
\frontms{Preface}
\frontms{Acknowledgments}
\tableofcontents
\mainmatter
\pagestyle{main}

\part{History}

\subpart{Primitive Historians}

\chapter{The Formation of the Concept of History: \\in the Minds of the Primitives through ...}
%\addcontentsline{toc}{chapter}{The Formation of the Concept of History: in the Minds of the Primitives through...}[The Formation of the Concept of History]
\chapter{title}
\kant[1-10]
\part{History}

\subpart{Primitive Historians}

\chapter{The Formation of the Concept of History:\\ in the Minds of the Primitives through ...}
%\addcontentsline{toc}{chapter}{The Formation of the Concept of History: in the Minds of the Primitives through...}[The Formation of the Concept of History]
\chapter{title}
\kant[1-10]
\end{document} 

在此处输入图片描述

相关内容