Coloring the margintoc #197
-
|
How can I set the font color in the margin toc? The code % !TEX program = xelatex
\documentclass{kaobook}
\addtokomafont{section}{\color{blue}}
\begin{document}
\color{red}
\setchapterpreamble[u]{\margintoc}
\chapter{Chapter}
\section{Section}
Text
\end{document}
produces the following result: The documentation of the \renewcommand*{\marginfont}{\color{red}\sffamily}but this does not change anything for me. Related bug: #190 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
To answer my own question: We can change the color in the margintoc by setting the colors right before \hypersetup{linkcolor=orange} % Set the color for the section number/name and page number in the margintoc
\addtokomafont{section}{\color{orange}} % Set the color for the dots in the margin toc in the margintoc
\chapter{Chapter}
\hypersetup{linkcolor=green} % Reset the linkcolor for the normal text
\addtokomafont{section}{\color{blue}} % Reset the section color for the normal textInstead of modifying every |
Beta Was this translation helpful? Give feedback.

To answer my own question:
We can change the color in the margintoc by setting the colors right before
\chapterand resetting them after it:Instead of modifying every
chapter-call, we can redefine\chapter.