Page LayoutParticular Position for Page Number

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
kajal
Posts: 6
Joined: Thu Apr 26, 2012 5:25 pm

Particular Position for Page Number

Post by kajal »

Hi
Myself Kajal, Senior Research Fellow from India. I want to write my thesis in LaTeX. But I face on problem. Here is the problem.

Margin for my PhD thesis set by my university is 4cm from left, 2cm from right, and 3cm from top and the bottom. This one I have done using geometry package. But my university wants the page number 1cm from top and 1cm from right. Which I am unable to solve. Please help me in this matter.


Thank you

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Particular Position for Page Number

Post by localghost »

kajal wrote:[…] Margin for my PhD thesis set by my university is 4cm from left, 2cm from right, and 3cm from top and the bottom. […] But my university wants the page number 1cm from top and 1cm from right. […]
I have several questions about your page layout.
  • Is the document always printed single-sided?
  • Are there any other specifications regarding the header?
  • Is the page number part of the page header or is it placed outside at that particular position?


Best regards and welcome to the board
Thorsten
kajal
Posts: 6
Joined: Thu Apr 26, 2012 5:25 pm

Re: Particular Position for Page Number

Post by kajal »

thank you for your reply..
1. Document always printed single sided..
2. No other specifications regarding header.. But I use fancyhdr to set chapter name in the top left and page number top right (2cm from top and 2cm from right). That 2cm I want make 1cm from top and 1cm from right..
3. I set the page number in the header..Using any technique is it possible to set 1cm from top and 1cm from right..

Thanks once again
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Particular Position for Page Number

Post by localghost »

Your statements are a bit contradictory, thus confusing.
kajal wrote:[…] Margin for my PhD thesis set by my university is 4cm from left, 2cm from right, and 3cm from top and the bottom. […]
kajal wrote:[…] But I use fancyhdr to set chapter name in the top left and page number top right (2cm from top and 2cm from right) […]
Which margins are now the correct ones? Is the header part of the type area?

I suggest that you prepare a minimal example that contains only necessary information about your document setup.
kajal
Posts: 6
Joined: Thu Apr 26, 2012 5:25 pm

Re: Particular Position for Page Number

Post by kajal »

Thank you very much for your reply...
I solved the problem using tikz package

Thanks once again
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Particular Position for Page Number

Post by localghost »

kajal wrote:[…] I solved the problem using tikz package […]
Good to hear. Then please be so kind and post the complete solution here. Finally others with the same or a similar problem could come here by search engine and would be disappointed if they don't find a working solution.
kajal
Posts: 6
Joined: Thu Apr 26, 2012 5:25 pm

Particular Position for Page Number

Post by kajal »

The tikz package solve my problem partially. Final solution for my problem as below

Code: Select all

% Shifting 1cm horizontally
\fancyheadoffset[RE,RO]{1cm}
\fancyhead[RE,RO]{\thepage}

% Shifting 1cm vertically
\addtolength{\headheight}{8pt}
\newlength{\headshift}
\setlength{\headshift}{30pt}
\addtolength{\headsep}{\headshift}
\addtolength{\voffset}{-\headshift}
Thank you very much


Regards
kajal
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Particular Position for Page Number

Post by Stefan Kottwitz »

Hi kajal,

thanks for posting the solution!

I just don't see the TikZ package here, perhaps you mean the fancyhdr package. As I read TikZ, I wondered how to do that, I think it would be possible using the current page node as a reference for positioning page numbers, an interesting approach.

Best regards,

Stefan
LaTeX.org admin
kajal
Posts: 6
Joined: Thu Apr 26, 2012 5:25 pm

Particular Position for Page Number

Post by kajal »

Thank you very much...
Yes, I solve the solution using fancyhdr...

For one page, I set the page number as bellow.. So, I write partially

Code: Select all

\begin{tikzpicture}[overlay, remember picture]
\path (current page.north east) ++(-1.1,-1.1) node[below left] {\thepage};
\end{tikzpicture}
Thank you very much
regards
Last edited by Stefan Kottwitz on Wed May 09, 2012 2:19 pm, edited 1 time in total.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Particular Position for Page Number

Post by localghost »

Since will still have no complete solution, here comes an example that only needs the fancyhdr package for the header setup.

Code: Select all

% !TeX program = pdflatex
\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{geometry}
\geometry{
  includeheadfoot,
  headheight=14pt,
  left=4cm,
  right=2cm,
  top=2cm,
  bottom=3cm
}
\usepackage{fancyhdr}
\usepackage{blindtext}   % to be dropped in the real document

\fancyhf{}
\fancyheadoffset[R]{1cm}
\rhead{\leavevmode\smash{\raisebox{1cm}{\thepage}}}
\lhead{\rightmark}
\renewcommand{\headrulewidth}{0pt}
\pagestyle{fancy}

\begin{document}
  \blinddocument
\end{document}
Setup for chapter pages is missing but can be modified according to Section 7 of the package manual.
Post Reply