fancyhdr은 tocloft에 의해 재정의됩니다.

fancyhdr은 tocloft에 의해 재정의됩니다.

내 toc 내부의 점 수와 분포를 변경하고 싶었기 때문에 tocloft 패키지를 사용하여 다음과 같이 변경하려고 했습니다.

\usepackage{tocloft}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftdotsep}{3}

하지만 그렇게 하면 내 fancyhdr 설정이 모두 변경/삭제됩니다. 왜냐하면 새 패키지를 포함한 후에 헤더가 단순히 사라지기 때문입니다.

내 현재 전문은 다음과 같습니다.

\usepackage[ngerman]{babel}

\usepackage{mathptmx}

\usepackage{graphicx}
\graphicspath{{images/}}

\usepackage[left=4cm, right=2cm, top=2.5cm, bottom=2.5cm]{geometry}

\usepackage{tocloft}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftdotsep}{3}

% Header and Footer
\usepackage{fancyhdr}
\usepackage{nameref}
\usepackage{titleref}

\pagestyle{fancy}

\fancyhead{\currenttitle}
\fancyhead[C]{Praxisarbeit}
\fancyhead[R]{\thepage}

\usepackage{biblatex}
\addbibresource{quellen.bib}

MWE:

\documentclass[12pt]{article}
\usepackage[ngerman]{babel}

\usepackage[left=4cm, right=2cm, top=2.5cm, bottom=2.5cm]{geometry}


%----the issue----%
%\usepackage{tocloft}
%\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
%\renewcommand{\cftdotsep}{3}

\usepackage{fancyhdr}
\pagestyle{fancy}

\fancyhead{\leftmark}
\fancyhead[C]{title}
\fancyhead[R]{\thepage}
\fancyfoot{}
\fancyfoot[L]{}

\begin{document}

\pagenumbering{Roman} %römische Seitenzahlen
%--------Inhaltsverzeichnis------------
\tableofcontents
\addcontentsline{toc}{section}{Inhaltsverzeichnis}
\newpage
%--------Abbildungsverzeichnis---------
\listoffigures
\addcontentsline{toc}{section}{Abbildungsverzeichnis}
%--------Abkürzungsverzeichnis---------
\newpage \section*{Abkürzungsverzeichnis}
\addcontentsline{toc}{section}{Abkürzungsverzeichnis}
%---------------ENDE-------------------


\newpage \pagenumbering{arabic} %arabische Seitenzahlen
%--------Einleitung---------
\newpage \section{section 1}
\subsection{subsection 1}
\subsection{subsection 2}
\subsection{subsection 3}

%--------Theoretischer Rahmen---------
\newpage \section{section 2}
\subsection{subsection 1}
\subsection{subsection 2}
\subsubsection{subsubsection 1}
\subsubsection{subsubsection 2}

%--------Methodik---------
\newpage \section{section 3}
\subsection{subsection 1}
\subsection{subsection 2}
\subsection{subsection 3}

\end{document}

관련 정보