
아래 tocloft
에서 까지의 모든 항목에 대해 사용하여 내 목차를 사용자 정의했지만 부품 글꼴의 색상을 변경하는 방법을 알 수 없습니다. 이 명령을 어떻게 갱신합니까? 설명서를 읽었 으나 아무것도 찾을 수 없습니다. 어떤 도움을 주셔서 감사합니다!chapter
subsection
tocloft
MWE:
\documentclass[a4paper, 12pt, twopage]{scrreprt}
\usepackage[titles]{tocloft}
\usepackage{color}
\definecolor{RoyalRed}{RGB}{157,16, 45}
\newcommand{\partfont}{\renewcommand\cftpartfont{\color{RoyalRed}}}
\newenvironment{MainTOC}{\partfont}
\begin{document}
\begin{MainTOC}
\tableofcontents
\end{MainTOC}
\part{first part}
\chapter{First chapter}
\part{second part}
\chapter{second chapter}
\end{document}
답변1
\cftpartfont
부품 제목과 번호의 글꼴을 변경하고 cftpartpagefont
페이지의 글꼴을 변경하는 데 사용할 수 있습니다 .
\documentclass{book}
\usepackage{xcolor}
\usepackage{tocloft}
\renewcommand\cftpartfont{\color{olive}}
\renewcommand\cftpartpagefont{\color{olive}}
\begin{document}
\tableofcontents
\part{A part}
\chapter{a chapter}
\part{another part}
\end{document}