# How to change font style of numbers/caption label and pagenumbers in toc and listofs in Koma-Script?

maybe I am asking the wrong question, but I think what I want to do is to change the font style of the numbers / caption labels and the page number in the table of contents and list of tables/figures/abbreviations.

With numbers I mean the "1.1.5" in "1.1.5 This is a subsection ....... 37". And the page number is then "37". With Labels I mean the "Figure 2.23" in "Figure 2.23 Some Figure ...... 49". And the page number then the "49".

I use lualatex and the scrbook class. The point is that I use proportional, oldstyle figures in my document, but I think that monospace figures would make sense in these two positions in order to get the numbers aligned.

What I did so far is to create a new font family and redeclare the section commands:

\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}


As far as I can see there is no way to just use the possibly preferred way with addkomafont, since I cannot change sections and subsections there and I don't want to actually change the style of the Heading, but just the entry in the toc/listof.

The approach above works quite well for the toc, but I cannot figure out how to do this a) for the List of Tables/Figures (\listoftables \listoffigures). However, it seems to work for my List of Listings, which I declared with \DeclareNewTOC. b) for List of Abbreviations printed with the glossaries package and \printglossary command.

How can I change those? Or is the whole approach nonsense?

There is no MWE in the question ... so I will use parts of the MWE in this question and only answer the question regarding numbers in LoF and LoT.

You can use \DeclareTOCStyleEntry for all entry types under control of package tocbasic: figure, table, section, ... The options are the same as for \RedeclareSectionCommand (or \RedeclareSectionCommands) but without the prefix toc.

\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}

\usepackage{expl3}
\ExplSyntaxOn
\clist_map_inline:nn
{section,subsection,figure,table}
{\DeclareTOCStyleEntry[%
pagenumberformat=\libertinussanstabular,%
entrynumberformat=\libertinussanstabular%
]{section}{#1}%
}
\ExplSyntaxOff

\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}


Result:

Please ask a new question for the second issue (regarding package glossaries) and include there a MWE!