I have a problem with \thechapter implementation in fancyhdr package. As you can see in the photo I attached at the bottom of the post, the section number (RO) and its title (LO) don't match at the header: it should say "Propietats bàsiques de la divisibilitat" and then "1.3", or "Equacions diofantines lineals" and then "1.4". If I had to choose, I would prefer the latter (I think it's more complex to achieve, though). My pagestyle{fancy} config is the following:
% Header
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.1pt}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[RO]{\thesection}
\fancyhead[LE]{\thechapter}
\fancyfoot[RO, LE]{\thepage}
\fancyfoot[CO, CE]{}
\fancyheadoffset[LE,RO]{+0.025\textwidth}
\renewcommand{\chaptermark}[1]{\markboth{ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{ #1}}
If it can be of any help, I am working on a book, twoside environment.
\documentclass[a4paper,12pt,twoside]{book}
Thanks in advance!
\thesection
in your header or footer. That kind of running information must be communicated via marks. It could happen that the information is used, but then the text that produces this information is pushed to the next page. That is not the case here, because here there is another problem: if there is more than one section on the page,\thesection
has the value of the last section on the page (or one pushed over to the next page). So you must get it from the\firstmark
or something similar. I'll try to make a working solution for you.