TeX - LaTeX Asked by bobicino on February 17, 2021
I am having a problem with the leftmark
command of the fancyhdr
package. This is a tex
sample
documentclass[a4paper,11pt]{article}
usepackage{fancyhdr}
pagestyle{fancy}
lhead{}
rhead{leftmark}
author{Author}
title{Title}
begin{document}
maketitle
tableofcontents
newpage
section{first section}
First paragraph
section{second section}
Second paragraph
end{document}
This is the output
As you can see, the problem is that latex (compiling with lualatex
) print SECOND CHAPTER
instead of FIRST CHAPTER
, as the leftmark
should give the current section in article
mode. If i try to use the builtin pagestyle{headings}
, changing the document like so:
...
pagestyle{headings}
%usepackage{fancyhdr}
%pagestyle{fancy}
%lhead{}
%rhead{leftmark}
...
then the output is as expected:
What should I try?
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP