I am currently writing a PhD. I have the following code
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\rightmark}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
which I obtained from this thread. My goal is to have the section name instead of the chapter name in the top left part of each page the thesis, but I am getting the chapter name instead. Does anybody know if this might be caused by a conflict between packages?
The ones I am using are:
\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}
I have also proved the example:
\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}
and it works as intended.
Any help is appreciated. Best regards.
vectorwhich seems to be not supported in overleaf, but I don't think it is responsible for this), it still works as expected for me. – Οὖτις Mar 12 '23 at 13:41