[Tex/LaTex] Header with section name

fancyhdrheader-footer

I am writing an article document, without parts so the biggest item is the section (I also use subsection and subsubsection) in LaTeX and I am trying to configure the header so that :

  1. for each section (even the Introduction and Conclusion, without numbers (\section*{Introduction}) the header displays the title of the section on the left side, with the number of the section if there is one, in bold but not in italic, with a bold line separating the header and the text of the document. I don't want the pages number or my name to appear on this header
  2. This header should not appear on the front page, the table of contents, the bibliography and the appendix. I would also like the ability to make it disappear for some pages if there is a function to do it.

I add an example found in Internet (it is a combination of two screenshots) with the example I would like to have ("Introduction" and "1 La fiscalité indirecte française en 2010").

Here is my MWE :

\documentclass[a4paper]{article}
\usepackage{biblatex}
\usepackage{fancyhdr}
\usepackage[british, french]{babel}

\pagestyle{fancy}

\begin{document}

\section*{Introduction}
\newpage

\section{First part}
\newpage

\section*{Conclusion}
\newpage

\printbibliography
\newpage

\appendix
\section*{my appendix}

\end{document}

I think the fancyhdr is the package to use but I do not know how to do what I want to (I didn't found what I was looking for in internet), what commands should I use ?

enter image description here

Best Answer

This could works ... (lipsum package and \lipsum command is for the text in pictures)

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{ccc}
\author{Bernar}
\date{May 2015}
\usepackage{biblatex}
\usepackage[british, french]{babel}
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{%
\markboth{\thesection\quad #1}{}}
\fancyhead{}
\fancyhead[L]{\leftmark}
\fancyfoot{}
\fancyfoot[C]{\thepage}

\begin{document}

\maketitle

\section*{Introduction}
\markboth{Introduction}{}
\lipsum\lipsum\lipsum

\section{First part}
\newpage

\section*{Conclusion}
\markboth{Conclusion}{}
\newpage

\printbibliography
\newpage

\appendix
\section*{My appendix}
\markboth{My appendix}{}

\end{document}

enter image description here

enter image description here

Related Question