目录中的罗马数字太宽

目录中的罗马数字太宽

考虑下面的代码:

\documentclass[%
    paper=A4,
    twoside=true,
    fontsize=12pt,
    titlepage=true,
    listof=totoc,
    bibliography=totoc,
    listof=flat,
    open=right,
    cleardoublepage=empty,
    headsepline=true,
    footsepline=false,
    captions=tableheading,
    numbers=noendperiod,
    parskip=half-,
    headings=normal]{scrbook}
\usepackage[a4paper]{geometry}
\geometry{
    includehead=true,
    hmarginratio=1:2,
    vmarginratio=3:5,
    textwidth=170mm,
    textheight=230mm,
    headheight=20pt,
    footskip=15mm,
    bindingoffset=6mm}
\usepackage{showframe}
\usepackage{blindtext}
\usepackage[tocindentauto]{tocstyle}
\usetocstyle{KOMAlike}
\begin{document}
\frontmatter
\tableofcontents
\cleardoublepage
\mainmatter
\blinddocument\blindtext
\pagenumbering{Roman}
\setcounter{page}{20}
\appendix
\blinddocument
\end{document}

目录中的罗马页码太宽。如何修复? 目录

答案1

与您正在使用的包兼容的一种方法tocstyle是添加

\settocstylefeature{pagenumberbox}{\hbox}

平均能量损失

\documentclass[%
    paper=A4,
    twoside=true,
    fontsize=12pt,
    titlepage=true,
    listof=totoc,
    bibliography=totoc,
    listof=flat,
    open=right,
    cleardoublepage=empty,
    headsepline=true,
    footsepline=false,
    captions=tableheading,
    numbers=noendperiod,
    parskip=half-,
    headings=normal]{scrbook}
\usepackage[a4paper]{geometry}
\geometry{
    includehead=true,
    hmarginratio=1:2,
    vmarginratio=3:5,
    textwidth=170mm,
    textheight=230mm,
    headheight=20pt,
    footskip=15mm,
    bindingoffset=6mm}
\usepackage{showframe}
\usepackage{blindtext}
\usepackage[tocindentauto]{tocstyle}
\usetocstyle{KOMAlike}
\settocstylefeature{pagenumberbox}{\hbox}
\begin{document}
\frontmatter
\tableofcontents
\cleardoublepage
\mainmatter
\blinddocument\blindtext
\pagenumbering{Roman}
\setcounter{page}{20}
\appendix
\blinddocument
\end{document} 

输出:

在此处输入图片描述

相关内容