我将目录中的章节条目样式chapterentry
(在 koma-script 类文档中 - 不能从 koma-script 更改)更改为小写。不幸的是,这也影响了章节的页码,即页码也是小写。有没有办法防止页码更改为小写,而只保留正常的罗马字体?
\documentclass[
fontsize=12pt,
open=right,
twoside = true,
paper=a4,
listof=totoc,
numbers=noenddot,
headings=big,
chapterprefix=false] %
{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{blindtext}
\setkomafont{sectioning}{\rmfamily}
\setkomafont{chapterentry}{\mdseries\scshape\lowercase}
\addtokomafont{chapter}{\normalsize\scshape}
\addtokomafont{section}{\normalsize\scshape}
\addtokomafont{subsection}{\normalsize\itshape}
\begin{document}
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\newpage
\pagenumbering{arabic}
\Blinddocument
\end{document}
答案1
使用
\setkomafont{chapterentrypagenumber}{\normalfont\normalcolor}
使用正常字体作为目录中章节页码的字体。
代码:
\documentclass[
fontsize=12pt,
open=right,
twoside = true,
paper=a4,
listof=totoc,
numbers=noenddot,
headings=big,
chapterprefix=false] %
{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{blindtext}
\setkomafont{sectioning}{\rmfamily}
\setkomafont{chapterentry}{\mdseries\scshape\lowercase}
\setkomafont{chapterentrypagenumber}{\normalfont\normalcolor}%<- added
\addtokomafont{chapter}{\normalsize\scshape}
\addtokomafont{section}{\normalsize\scshape}
\addtokomafont{subsection}{\normalsize\itshape}
\begin{document}
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\newpage
\pagenumbering{arabic}
\Blinddocument
\end{document}
答案2
获得你想要的东西的最简单方法是添加行
\addtokomafont{pagenumber}{\rmfamily\normalsize}
在您的序言中。然后页面上的页码和目录中的页码将采用给定的字体\rmfamily
大小\normalsize
。
完整代码:
\documentclass[
fontsize=12pt,
open=right,
twoside = true,
paper=a4,
listof=totoc,
numbers=noenddot,
headings=big,
chapterprefix=false] %
{scrreprt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{blindtext}
\setkomafont{sectioning}{\rmfamily}
\setkomafont{chapterentry}{\mdseries\scshape\lowercase}
\addtokomafont{chapter}{\normalsize\scshape}
\addtokomafont{section}{\normalsize\scshape}
\addtokomafont{subsection}{\normalsize\itshape}
\addtokomafont{pagenumber}{\rmfamily\normalsize} % <====================
\begin{document}
\pagenumbering{roman}
\tableofcontents
\listoffigures
\listoftables
\newpage
\pagenumbering{arabic}
\Blinddocument
\end{document}
得到的目录如下: