如何更改 Koma-Script 中的目录和列表中的数字/标题标签和页码的字体样式?

如何更改 Koma-Script 中的目录和列表中的数字/标题标签和页码的字体样式?

也许我问错了问题,但我认为我想要做的是更改目录和表格/图形/缩写列表中的数字/标题标签和页码的字体样式。

我用数字表示“1.1.5 这是一个小节 ...... 37”中的“1.1.5”。然后页码就是“37”。我用标签表示“图 2.23 一些图 ...... 49”中的“图 2.23”。然后页码就是“49”。

我使用 lualatex 和 scrbook 类。重点是我在文档中使用比例、旧式数字,但我认为在这两个位置使用等宽数字是有意义的,这样可以使数字对齐。

到目前为止,我所做的是创建一个新的字体系列并重新声明部分命令:

\newfontfamily\libertinussanstabular{libertinussans}[
  Numbers   = {Monospaced} ,
  Scale     = \libertinusSF@scale ,
  UprightFont    = *-regular,
  ItalicFont     = *-italic,
  BoldFont       = *-bold, 
  BoldItalicFont = *-bolditalic, 
  SmallCapsFeatures={Letters=SmallCaps},
  Extension      = .otf  
]

\RedeclareSectionCommand[tocpagenumberformat=\libertinussanstabular\textbf,tocentrynumberformat=\libertinussanstabular\textbf]{part}
\RedeclareSectionCommand[tocpagenumberformat=\libertinussanstabular\textbf,tocentrynumberformat=\libertinussanstabular\textbf]{chapter}
\RedeclareSectionCommand[tocpagenumberformat=\libertinussanstabular,tocentrynumberformat=\libertinussanstabular]{section}
\RedeclareSectionCommand[tocpagenumberformat=\libertinussanstabular,tocentrynumberformat=\libertinussanstabular]{subsection}

据我所知,没有办法只使用可能首选的方式addkomafont,因为我无法更改那里的章节和小节,而且我实际上不想更改标题的样式,而只是更改 toc/listof 中的条目。

上述方法对于目录非常有效,但我不知道如何对表格/图片列表 ( \listoftables \listoffigures) 执行此操作。但是,它似乎对我的列表列表有效,我用 声明了列表\DeclareNewTOC列表。b) 使用 glossaries 包和 \printglossary 命令打印缩写列表。

我该如何改变这些?还是整个方法都是废话?

答案1

问题中没有 MWE ...所以我将使用 MWE 的部分内容这个问题只回答有关 LoF 和 LoT 中的数字的问题。

您可以对包控制下的所有条目类型使用\DeclareTOCStyleEntry或:,,, ... 选项与(或)相同,但没有前缀。\DeclareTOCStyleEntriestocbasicfiguretablesection\RedeclareSectionCommand\RedeclareSectionCommandstoc

\documentclass[listof=entryprefix]{scrbook}
\usepackage{polyglossia}
\setdefaultlanguage{english}
%
\usepackage{fontspec}
\usepackage[osf]{libertinus-otf}[2018/07/03]
\makeatletter
\newfontfamily\libertinussanstabular{libertinussans}[
  Numbers   = {Monospaced} ,
  Scale     = \libertinusSF@scale ,
  UprightFont    = *-regular,
  ItalicFont     = *-italic,
  BoldFont       = *-bold, 
  BoldItalicFont = *-bolditalic, 
  SmallCapsFeatures={Letters=SmallCaps},
  Extension      = .otf  
]
\makeatother

\RedeclareSectionCommands[%
  tocpagenumberformat=\libertinussanstabular\textbf,%
  tocentrynumberformat=\libertinussanstabular\textbf%
]{part,chapter}

\DeclareTOCStyleEntries[%
  pagenumberformat=\libertinussanstabular,%
  entrynumberformat=\libertinussanstabular%
]{tocline}{section,subsection,figure,table}%

\usepackage{blindtext}
\begin{document}
\tableofcontents
\listoffigures
\listoftables
\Blinddocument

\captionof{figure}{A test caption for figure}

\captionof{table}{A test caption for table}
\Blinddocument

\chapter{Another chapter}
\captionof{figure}{A test caption for figure}

\captionof{table}{A test caption for table}
\end{document}

结果:

在此处输入图片描述

在此处输入图片描述

在此处输入图片描述

请针对第二个问题(关于包)提出新问题glossaries并其中包含 MWE!

相关内容