Page Layoutabout using \usepackage{fancyhdr}

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
teddy0625
Posts: 9
Joined: Sat Mar 28, 2009 10:34 am

about using \usepackage{fancyhdr}

Post by teddy0625 »

Code: Select all

Code, edit and compile here:
\documentclass[a4paper,10pt,fleqn,twoside]{book}
\usepackage{amsmath,amssymb,amsfonts,a4wide} % Typical maths resource packages
\usepackage{graphics} % Packages to allow inclusion of graphics
\usepackage{color} % For creating coloured text and background
\usepackage{hyperref} % For creating hyperlinks in cross references
\usepackage{epsfig}
\usepackage{graphicx}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{teo}{Theorem}[section]
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername \ \thechapter \ \ #1}}{}}
\fancyhf{}%clear all header and footer fields
\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[RO,LE]{\thepage}
\def\chem#1#2{ {{\scriptscriptstyle#1\atop\longrightarrow}\atop{\longleftarrow\atop \scriptscriptstyle#2}} }
\begin{document}
\begin{titlepage}
.
.
.
\end{titlepage}
\thispagestyle{empty}
\tableofcontents
\renewcommand*\thesection{\arabic{section}}
\newpage
\section{1}
\section{2}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I am keep getting "Contents" on every even pages on the right top which is very annoying. Help please!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

about using \usepackage{fancyhdr}

Post by localghost »

I can't comprehend the problem. The following works for me.

Code: Select all

Code, edit and compile here:
\documentclass[a4paper,10pt,fleqn,twoside,english]{book}
\usepackage{babel}
\usepackage{amsmath,amssymb,amsfonts} % Typical maths resource packages
\usepackage{xcolor} % For creating coloured text and background
\usepackage{hyperref} % For creating hyperlinks in cross references
\usepackage{graphicx}
\usepackage{blindtext}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{teo}{Theorem}[section]
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\chaptername \ \thechapter \ \ #1}}{}}
\fancyhf{}%clear all header and footer fields
\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[RO,LE]{\thepage}
\def\chem#1#2{{{\scriptscriptstyle#1\atop\longrightarrow}\atop{\longleftarrow\atop\scriptscriptstyle#2}}}
\title{About using \textsf{fancyhdr}}
\author{teddy0625}
\date{\today}
\begin{document}
\maketitle
\thispagestyle{empty}
\tableofcontents
\newpage
\Blinddocument
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
If the problem persists, you may try the titlesec package which lets you also define page styles, but much easier and better to customize.


Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

about using \usepackage{fancyhdr}

Post by gmedina »

Hi teddy0625,

if I correctly understood your question, then try adding

Code: Select all

\clearpage{\pagestyle{empty}\cleardoublepage}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
just after the \tableofcontents command.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply