Page LayoutPage Number in top right Corner

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
fabioled
Posts: 14
Joined: Sat Sep 15, 2012 2:51 am

Page Number in top right Corner

Post by fabioled »

Hi everyone,

I have a problem with the page in my document. How do I put the page number in top right corner of the page in case I need to use the option twoside in the docment class report?

Here is my minimal example (my apologies for that because until now I can't do a good example, but hope that you understand).

Code: Select all

Code, edit and compile here:
\documentclass[
12pt,
a4paper,
% twoside
]{report}
%%%%%Preambule
\usepackage[T1]{fontenc} %encoding
\usepackage{times} %font
\usepackage{setspace}
\usepackage[utf8]{inputenc} %encoding
\usepackage{graphicx}
\usepackage{fancyhdr} % draw header and foot
% Pacote para divisão silábica do portugues
\usepackage[english, brazilian]{babel}
\usepackage[titles]{tocloft} %% formatar a lista de figuras e tabelas.
\usepackage{geometry}
\geometry{tmargin=20mm,bmargin=20mm,lmargin=30mm,rmargin=20mm}
% change indent of table of content
\usepackage[titles]{tocloft}
\cftsetindents{chapter}{0cm}{.3cm}
\cftsetindents{section}{0cm}{.6cm}
\cftsetindents{subsection}{0cm}{.9cm}
\cftsetindents{subsubsection}{0cm}{1.2cm}
\cftsetindents{paragraph}{0cm}{1.5cm}
%%%%%%%%%%% CONFIG ABOUT HEADER E AND FOOT %%%%%%%%%%%%%%%%%%
\pagestyle{fancy}
\fancyhf{}
%para margem do cabeçalho ficar do tamanho da margem do texto
\fancyheadoffset{0cm}
\rhead{\thepage} %% PUT THE PAGE ON TOP RIGHT BUT NOT WORK
\setlength\parindent{0pt}
\renewcommand{\headrulewidth}{0pt} % remove lines as well
\renewcommand{\footrulewidth}{0pt}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Last edited by localghost on Mon Sep 23, 2013 6:58 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Page Number in top right Corner

Post by Johannes_B »

Hi,

the pages where a chapter begins are typeset differently. Please have a look at section 7 of the fancyhdr manual to learn how to change the plain style.

By the way, getting rid of the \parindent isn't a good idea. You should use the parskip package instead.

Code: Select all

Code, edit and compile here:
\documentclass[12pt,a4paper,twoside]{report}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyheadoffset{0cm}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancyhead[R]{\thepage}
\fancypagestyle{plain}{%
\fancyhf{}%
\fancyhead[R]{\thepage}%
}
\usepackage{blindtext}
\usepackage{parskip}
\begin{document}
\Blinddocument
\end{document}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
fabioled
Posts: 14
Joined: Sat Sep 15, 2012 2:51 am

Re: Page Number in top right Corner

Post by fabioled »

Hi,

Work perfectly, very thanks for you help.
Is the persons how you that make the diference.
Post Reply