scrrprt TOC에 사용되는 글꼴

scrrprt TOC에 사용되는 글꼴

scrrprt 문서에서는 전체적으로 비례적인 이전 스타일 번호를 사용하고 있지만 TOC의 페이지에는 고정폭 줄넘기 번호를 사용하고 싶습니다.

chapterentrypagenumber최상위 수준의 글꼴을 사용할 수 있지만 sectionentrypagenumber기사에만 사용할 수 있습니다(최상위 수준이기 때문입니다). 나머지 숫자에는 어떤 글꼴이 사용됩니까?

다음은 간단한 테스트 문서입니다. 검은색 숫자의 글꼴을 어떻게 변경합니까?

\documentclass{scrreprt}
\usepackage{xcolor}
\setkomafont{chapterentrypagenumber}{\color{red}}
\setkomafont{disposition}{\color{teal}}
\begin{document}
{\color{blue}\tableofcontents}
\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\end{document}

여기에 이미지 설명을 입력하세요

또한 이러한 작업에 사용할 수 있는 간단한 디버깅 스위치가 있습니까? 사용 중인 코마 글꼴의 이름을 문서에 입력하는 것뿐입니다. 나는 노력했다

\renewcommand{\usekomafont}[2]{(#1:#2)}

그러나 내가 파악하지 못하는 몇 가지 글꼴 변경이 분명히 발생하고 있습니다. 여기에 이미지 설명을 입력하세요

답변1

KOMA 번들 및 pagenumberhook의 tocstyle 패키지를 사용하십시오.

\documentclass{scrreprt}
\usepackage{xcolor, tocstyle}
\setkomafont{chapterentrypagenumber}{\color{red}}
\setkomafont{disposition}{\color{teal}}
\settocstylefeature{pagenumberhook}{\sffamily{}}
\begin{document}
{\color{blue}\tableofcontents}
\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\end{document}

나는 \sffamily글꼴 명령으로 사용했지만 다른 명령을 사용하고 싶을 수도 있습니다.


편집하다

비오는 날, 나는 뭔가 색깔 있는 것을 갈망했고 그래서 나는 이것을 가지고 놀면서 어느 정도의 말도 안되는 KOMAscript가 유지되는지 알아보았습니다.

\documentclass[x11names]{scrreprt}
\usepackage{xcolor, blindtext}
\usepackage{tocstyle}
\usetocstyle{KOMAlike}

\addtokomafont{chapterentrypagenumber}{\color{purple}}
\addtokomafont{chapter}{\color{purple}}

\addtokomafont{chapterentry}{\Large\color{purple}}
%\addtokomafont{disposition}{\color{Snow4}}
\settocstylefeature{entryhook}{\color{Wheat4!70!black}\bfseries}
 \settocstylefeature{pagenumberhook}{\rlap{\color{Wheat1}\hspace{-0.3em}\rule[-0.6ex]{0.6em}{2.5ex}\color{Wheat3}\rule[0.1ex]{0.6em}{2.5ex}}\bfseries\sffamily\color{teal}}

\begin{document}
 \tableofcontents
% \chapter{Chapter}
% \section{Section}
% \subsection{Subsection}

\blinddocument

\blinddocument

\end{document}

그러면 이렇게 귀여운 TOC가 나옵니다. 내용색

관련 정보