对于我的论文,我从出版商那里得到了详细的指导。所以我以多种方式配置了目录,几乎完成了。关于部分,最新版本如下所示:https://www.screencast.com/t/uui7oQ9dzw在目录中,就像在部分的第一页上一样:https://www.screencast.com/t/MBI4pOeS9
最后一个要求是将各部分置于目录中,我几乎可以解决这个问题,使用以下命令:
\renewcommand*{\addparttocentry}[2]{%
\addtocentrydefault{part}{}{\protect\parbox{\textwidth}{\protect\centering\partname~#1~~#2}}}
这几乎完美地工作,但是现在出现了附加的“Teil”(=“Part”),我不知道如何摆脱它:https://www.screencast.com/t/BnJvEWGdLfhM
这是MWE:
\documentclass[a4paper,fontsize=10pt,numbers=noenddot]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{times}
\usepackage{blindtext}
\usepackage[papersize={210mm,297mm},text={113mm,180mm},inner=77mm,outer=20mm,top=34mm,bottom=83mm]{geometry}
\addtokomafont{disposition}{\rmfamily}
\KOMAoptions{toc=chapterentrydotfill}
\KOMAoptions{headings=optiontohead}
%formatting the part, chapter,...
\addtokomafont{partnumber}{\large}
\addtokomafont{part}{\large}
\addtokomafont{partentry}{\normalsize \bfseries}
\addtokomafont{partentrypagenumber}{\nullfont}
\addtokomafont{chapterprefix}{\fontsize{11}{11} \bfseries}
\addtokomafont{chapter}{\fontsize{11}{11} \bfseries}
\addtokomafont{chapterentry}{\bfseries}
\addtokomafont{chapterentrypagenumber}{\mdseries}
\addtokomafont{section}{\fontsize{10}{10} \bfseries}
\addtokomafont{subsection}{\fontsize{10}{10} \itshape \mdseries}
\addtokomafont{subsubsection}{\fontsize{10}{10}\normalfont}
\renewcommand*{\raggedsection}{\centering}
\usepackage{enumitem}
\setlist[description]{font={\bfseries\rmfamily}}
\renewcommand*{\partformat}{\thepart\autodot}
%formatting entries for part, chapter, ...
\usepackage{titletoc}
\renewcommand{\thepart}{\Alph{part}.}
\renewcommand{\thechapter}{\Roman{chapter}.}
\renewcommand{\thesection}{\arabic{section}.}
\renewcommand{\thesubsection}{\alph{subsection})}
\renewcommand{\thesubsubsection}{\alph{subsubsection}\alph{subsubsection})}
%indention
\RedeclareSectionCommand[tocnumwidth=1.5em]{part}
\RedeclareSectionCommand[tocnumwidth=2.5em]{chapter}
\RedeclareSectionCommand[tocindent=2.5em,tocnumwidth=1em]{section}
\RedeclareSectionCommand[tocindent=5em,tocnumwidth=1em]{subsection}
\RedeclareSectionCommand[tocindent=7.5em,tocnumwidth=1.5em]{subsubsection}
%center toc entry 'part':
\renewcommand*{\addparttocentry}[2]{%
\addtocentrydefault{part}{}{\protect\parbox{\textwidth}{\protect\centering\partname~#1~~#2}}}
%set the number of the part and the part title in one line (at the first page of the part)
\renewcommand*{\partheadmidvskip}{}
\renewcommand*{\partformat}{\thepart\enskip}
\setkomafont{part}{\usekomafont{partnumber}}
\renewcommand*{\partpagestyle}{empty}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\usepackage{scrlayer-scrpage}
\clearpairofpagestyles
\chead{\headmark}
\automark[chapter]{part}
\lehead*{\pagemark}
\rohead*{\pagemark}
\setkomafont{pagehead}{\footnotesize\upshape}
\begin{document}
\renewcommand{\contentsname}{Inhalt}
\tableofcontents
\part{my first part}
\chapter{first chapter}
\blindtext
\part{my second part}
\chapter{seconf chapter}
\blindtext
\end{document}
答案1
将 的重新定义更改\addparttocentry
为:
\renewcommand*{\addparttocentry}[2]{%
\addtocentrydefault{part}{}
{\protect\parbox{\textwidth}{\protect\centering\protect\ifstr{#1}{}{}{~#1~~}#2}}%
}
不要加载titletoc
带有 KOMA-Script 类的包。
一些额外的建议:
不要加载
titletoc
带有 KOMA-Script 类的包!移除
\renewcommand*{\partformat}{\thepart\autodot}
。它将被后者覆盖\renewcommand*{\partformat}{\thepart\enskip}
。删除
\RedeclareSectionCommand[tocnumwidth=1.5em]{part}
并\addtokomafont{partentrypagenumber}{\nullfont}
添加\RedeclareSectionCommand[tocnumwidth=0pt,tocpagenumberbox=\gobble]{part}
\newcommand*\gobble[1]{}
删除目录中的部分页码。
删除
\renewcommand{\contentsname}{Inhalt}
并添加以下内容至序言中:\renewcaptionname{ngerman}{\contentsname}{Inhalt}
据我所知,包
times
应该被包newtxtext
和替换newtxmath
。