LaTeX forum ⇒ Page LayoutParticular Position for Page Number Topic is solved

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

Particular Position for Page Number

Postby kajal » Tue May 08, 2012 2:03 pm

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

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

Postby localghost » Tue May 08, 2012 6:29 pm

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
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

kajal
Posts: 6
Joined: Thu Apr 26, 2012 5:25 pm

Postby kajal » Tue May 08, 2012 7:40 pm

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Tue May 08, 2012 8:17 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

kajal
Posts: 6
Joined: Thu Apr 26, 2012 5:25 pm

Postby kajal » Tue May 08, 2012 9:04 pm

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

Thanks once again

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

Postby localghost » Tue May 08, 2012 9:17 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

kajal
Posts: 6
Joined: Thu Apr 26, 2012 5:25 pm

Postby kajal » Wed May 09, 2012 10:40 am

The tikz package solve my problem partially. Final solution for my problem as below
  1. % Shifting 1cm horizontally
  2. \fancyheadoffset[RE,RO]{1cm}
  3. \fancyhead[RE,RO]{\thepage}
  4.  
  5. % Shifting 1cm vertically
  6. \addtolength{\headheight}{8pt}
  7. \newlength{\headshift}
  8. \setlength{\headshift}{30pt}
  9. \addtolength{\headsep}{\headshift}
  10. \addtolength{\voffset}{-\headshift}

Thank you very much


Regards
kajal

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

Postby Stefan Kottwitz » Wed May 09, 2012 11:44 am

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
Site admin

kajal
Posts: 6
Joined: Thu Apr 26, 2012 5:25 pm

Postby kajal » Wed May 09, 2012 2:16 pm

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

  1. \begin{tikzpicture}[overlay, remember picture]
  2. \path (current page.north east) ++(-1.1,-1.1) node[below left] {\thepage};
  3. \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.
Reason: code marked

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

Postby localghost » Wed May 09, 2012 6:02 pm

Since will still have no complete solution, here comes an example that only needs the fancyhdr package for the header setup.
  1. % !TeX program = pdflatex
  2. \documentclass[11pt,a4paper,english]{report}
  3. \usepackage[T1]{fontenc}
  4. \usepackage{babel}
  5. \usepackage{geometry}
  6. \geometry{
  7. includeheadfoot,
  8. headheight=14pt,
  9. left=4cm,
  10. right=2cm,
  11. top=2cm,
  12. bottom=3cm
  13. }
  14. \usepackage{fancyhdr}
  15. \usepackage{blindtext} % to be dropped in the real document
  16.  
  17. \fancyhf{}
  18. \fancyheadoffset[R]{1cm}
  19. \rhead{\leavevmode\smash{\raisebox{1cm}{\thepage}}}
  20. \lhead{\rightmark}
  21. \renewcommand{\headrulewidth}{0pt}
  22. \pagestyle{fancy}
  23.  
  24. \begin{document}
  25. \blinddocument
  26. \end{document}

Setup for chapter pages is missing but can be modified according to Section 7 of the package manual.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 1 guest