섹션 이름을 헤더로 가져오는 중에 문제가 발생했습니다.

섹션 이름을 헤더로 가져오는 중에 문제가 발생했습니다.

저는 현재 박사 학위를 집필 중입니다. 다음 코드가 있습니다

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\rightmark}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}

내가 얻은 것이 스레드. 내 목표는 논문 각 페이지의 왼쪽 상단에 장 이름 대신 섹션 이름을 두는 것인데 대신 장 이름이 표시됩니다. 이것이 패키지 간의 충돌로 인해 발생할 수 있는지 아는 사람이 있습니까?

내가 사용하고 있는 것들은 다음과 같습니다:

\usepackage[square, numbers, comma, sort&compress]{natbib}  
\usepackage{verbatim}
\usepackage{vector} 
\usepackage{titlesec}
\usepackage{subeqnarray}
\usepackage{lineno,hyperref}
\usepackage{soul}
\usepackage{comment}
\usepackage{amssymb}
\usepackage{srcltx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{psfrag}
\usepackage{graphicx,subfigure}
\usepackage{multirow}
\usepackage{algorithm}
\usepackage{algorithmic}   
\usepackage{psfrag}       
\usepackage{url}
\usepackage{color}
\usepackage{xcolor}
\usepackage{ulem}
\usepackage{breqn}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{subfigmat}
\usepackage{fancyhdr}

나는 또한 그 예를 증명했습니다:

\documentclass{book}
    
    \usepackage{fancyhdr}

\usepackage{lipsum}% just to generate text for the example

\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\rightmark}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}

\begin{document}
\chapter{Chapter title}
\section{AAAA}

\lipsum[1-20]


\section{BBBB}

\lipsum[1-20]
\end{document}

의도한 대로 작동합니다.

도움을 주시면 감사하겠습니다. 친애하는.

관련 정보