5

I tried to write a book of the following style: Is there a way to modify the upper horizontal line such that it does not have the word "Sisältö" or any other text except page numbers?

\documentclass[10pt]{book}

\usepackage[utf8]{inputenc}
\usepackage[finnish]{babel}

\usepackage{blindtext}

\usepackage[a5paper]{geometry}
%\usepackage[a5paper, top=2in, bottom=1.5in, left=1in, right=1in]{geometry}

\usepackage{scrextend}
\changefontsizes{10.0pt}  % Change base font size

\usepackage{lettrine}
\usepackage{fancyhdr}

\fancyhead[LE,RO]{\thepage}
\fancyfoot{}
\fancyhead[RO,LE]{\thepage}
\fancyhead[LO]{\leftmark}
\fancyhead[RE]{\rightmark}

\cfoot{} % get rid of the page number 

\linespread{1.3}
\vbadness=20000
\pagestyle{fancy}
\begin{document}
\tableofcontents
\newpage
\section*{Chapter one}
\addcontentsline{toc}{section}{beginning}
First lines.

\newpage

\section*{Chapter two}
\addcontentsline{toc}{section}{somewhere}
Some text.

\newpage

\section*{Chapter two}
\addcontentsline{toc}{section}{end}
The end.
\end{document}
  • Do you want to remove it from a select number of pages, or the entire document? – Far Zin Mar 25 '14 at 14:47
  • I would like to have that my book contains horizontal line on the top of the page and over that there is a page number but not any other text. So I would like to remove the text in every page of the document. – studying Mar 25 '14 at 14:49
3

If you only want the rule and the page number in the header, with nothing in the footer, do

\pagestyle{fancy}
\fancyhf{} % clear all fields
\fancyhead[RO,LE]{\thepage}

That's all. Don't set anything else related to fancyhdr.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.