5

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

2
  • Do you want page numbers somewhere else? And nothing on odd pages?
    – Bernard
    May 10, 2015 at 15:00
  • I would like to have numbers on the bottom of the page (centered) (I guess it is the default option). No difference between odd and even pages : I would like the header on both pages
    – etienne
    May 10, 2015 at 15:06

1 Answer 1

4

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

4
  • Thanks, almost perfect, there are just 2 problems :how can I remove the line on the top if I do not want any header for a specific page? And how to make the header in bold font ?
    – etienne
    May 11, 2015 at 16:07
  • If you want bold font in header you must write \bfseries before \leftmark; i.e., \fancyhead[L]{\bfseries\leftmark} ... otherwise, I don't understand when you say: "how can I remove the line on the top if I do not want any header for a specific page?" ... You can header without horizontal line in header or absolutely anything you want on the page, even page number?
    – juanuni
    May 12, 2015 at 4:00
  • If you want footer with page number and empty header in a specific page, you can use \thispagestyle{plain} in your specific page ...
    – juanuni
    May 12, 2015 at 4:04
  • Thanks that was exactly what I wanted : page number for all pages but for some pages no header so no horizontal line on the top of the page
    – etienne
    May 12, 2015 at 17:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .