koma-script 目录中的边距或换行符

koma-script 目录中的边距或换行符

我的 KOMA-script TOC 中的条目与页码之间的距离太近: 在此处输入图片描述

一个解决方案是使用简称并在其中插入换行符,但这不是一个可接受的解决方案。

我正在尝试修改托克玛吉。这是我的尝试,但所有编译都出现错误:

\makeatletter
% one and one only of the following
\renewcommand*{\settocfeature}{tocrmarge}{10em}
\renewcommand*\l@tocrmarge}{10em}
\renewcommand*{\settocfeature}{\setlength{\@tocrmarge}{10em}}
\makeatother

我对 LaTeX 的理解不够好。我需要帮助才能正确编写命令。

编辑:添加 MWE(在序言中不是那么简单)

\documentclass[english,enlargefirstpage, full]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[paperwidth=148mm,paperheight=210mm]{geometry}
\geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=2.5cm,rmargin=3cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{-2}
\setcounter{tocdepth}{1}
\usepackage{pifont}
\usepackage{textcomp}
\usepackage{fixltx2e}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}

\makeatletter
\@ifundefined{lettrine}{\usepackage{lettrine}}{}
\@ifundefined{date}{}{\date{}}
\usepackage[english,frenchle]{babel}
\usepackage[nottoc,numbib]{tocbibind}
\renewcommand{\sectfont}{\normalfont\bfseries} %\slshape} %\rmfamily}
\makeatletter
\renewcommand*\l@chapter{\bprot@dottedtocline{1}{1.8em}{3.2em}}
\renewcommand*\l@section{\bprot@dottedtocline{1}{1.8em}{3.2em}}
\renewcommand*\l@subsection{\bprot@dottedtocline{3}{1.8em}{3.2em}}
\makeatother

\frenchspacing
\usepackage{hyphenat}
\hyphenpenalty=3500
\doublehyphendemerits=9000
\finalhyphendemerits=6000

\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[babel=true,kerning=french,protrusion=true,expansion=auto,spacing,tracking]{microtype}
\pretolerance=1500
\tolerance=2000
\setlength{\emergencystretch}{2em}

\AtBeginDocument{
  \def\labelitemi{\Pisymbol{psy}{42}}
}

\makeatother

\usepackage{babel}
\begin{document}
\title{my book title}
\subtitle{my book subtitle}
\author{\textbf{myself}}
\maketitle
\frontmatter
\chapter{Before}
blublu
\tableofcontents{}
\newpage{}\mainmatter
\part{PROLOG}
\chapter{\emph{chapter 1}}
blabla
\chapter{\emph{chapter 2 title is very long and should look uggly}}
bloblo
\end{document}

其结果(不像我的真实文档那么丑陋):

在此处输入图片描述

编辑:这是成功的构建日志(在 pastbin 中,否则我会超出堆栈交换正文限制为 30,000 个字符。

答案1

在序言中添加:

[...]
\renewcommand*\l@subsection{\bprot@dottedtocline{3}{1.8em}{3.2em}}
\renewcommand*\@pnumwidth{3em}%%%%%%%%%%%%%%%  the width of the page number
\makeatother
[...]

在此处输入图片描述

你的序言看起来有点奇怪......

答案2

我已经使用以下两种解决方案之一解决了这个问题:

任何一个:

\renewcommand*\@pnumwidth{2em}

或者:

\renewcommand*\@tocrmarg{3em}

相关内容