how to display current section title in header insted of chapter title?
I'm using book
and fancychap
MWE
\documentclass [11pt,oneside,final]{book}
\usepackage[nohints]{minitoc}
\usepackage[round]{natbib}
\usepackage{longtable}
\usepackage[font={footnotesize,it}]{caption}
\usepackage{bookman}
\usepackage[T1]{fontenc}
\usepackage{setspace}
\doublespacing
%\onehalfspacing
\usepackage{multirow}
\usepackage[left=35mm,top=30mm,right=30mm,bottom=30mm]{geometry}
\pagenumbering{Roman}
\usepackage[small,compact]{titlesec}
\usepackage[Lenny]{fncychap}
\usepackage{arabtex}
\usepackage{cp1256}
\setcode{cp1256}
\usepackage{float}
\usepackage[final]{graphicx}
\usepackage{epstopdf}
\usepackage{array}
\setarab
\raggedbottom
\begin{document}
\chapter{introduction} \thispagestyle{empty}
\section{one}
bla bla bla bla bla
\section{two}
bla bla bla bla
\end{document}
Best Answer
You can use
fancyhdr
.\pagestyle{fancy}
sets the page style to the style delivered and editable withfancyhdr
.\fancyhf{}
sets all head and foot elements empty.\fancyhead[L]{\rightmark}
sets the left head element to\rightmark
, which contains the current section (\leftmark
is the current chapter).\fancyhead[R]{\thepage}
sets the right head element to the page number.\renewcommand{\headrulewidth}{0pt}
lets the head rule disappear.Possible selectors for the optional argument of
\fancyhead
/\fancyfoot
areL
(left),C
(center) orR
(right) for the position of the element andE
(even) orO
(odd) to distinguish even and odd pages. If you omitE
/O
the element is set for all pages.