# Modifying the location of page number on the first page of chapter to fit within height

I am working on writing my masters thesis, for which the layout requirements are:

1. 1.5 inch margin on left, 1 inch on all other side

2. Page number on top right on every page, except for first page of chapter and preliminary pages where they occur at the center bottom.

3. The page numbers should fit within the margin on everypage

I am using the geometry package to set the above layout as follows:

\usepackage[letterpaper, height = 9in, left =1.5in, right=1in, top=1in, includehead,includefoot]{geometry}


which works fine, except for the fact that on the subsequent pages of the chapter (after first page) the bottom margin is leaving margin > 1 inch. I think this is happening because of the fact that I have included includefoot in the geometry option, but since I need the page numbers within the margin, including the first page of the chapter, I had to do this.

What is the correct method of setting the above layout so that page number falls in the margin, including the first page of chapter, and in subsequent pages, where the page number lies on top right, while leaving only 1 inch bottom margin?

-
Strange requirement. This will have the type block to jump one inch from the first page to the subsequent. –  Sveinung Aug 4 '12 at 7:35
@Sveinung: What can be a possible solution for this ? If I remove the includefoot from the layout, then all my subsequent pages span the correct margin, i.e. leave 1 inch at the bottom, but at the first page of the chapter, the page number lies below (I am guessing this is the footer region). I think somehow applying the \newgeometry command of the first page of every chapter should help i.e. removing includefoot from the standard layout and only include it for the first page. Unfortunately I am not sure how to do this. Any suggestions ? –  R.Bahl Aug 4 '12 at 18:12
@R.Bahl: From my point of a singular page number on the chapter-opening page does not warrant the inclusion of the whole foot into the text body as it simply does not provide enough "weight". On the other hand on all other pages the head contains the page number and possibly a running head with chapter/section names. This establishes a visual connection between the head and the body which allows an inclusion via 'includehead'. Long story short: 'includefoot' is not necessary here. (PS: '\newgeometry' also may not work as expected, because it adds an forced pagebreak.) –  hakaze Aug 4 '12 at 19:14
@hakaze: so you mean to say that it is better to keep the page number on the first page of the chapter in the 1 inch margin region i.e. below the textheight area ?? Removing includefoot will definitely accomplish that but violate the condition that the page number should fit within the margin on every page. This will then keep the page number in the area otherwise marked as margin for rest of the pages –  R.Bahl Aug 4 '12 at 19:26
@R.Bahl: yes, that's what I meant. Removing includefoot may violate that rule, but obeying that rule would result in a "jumping" bottom end of the text body. From my point of view this is a stronger typographic violation than a single page number within the bottom margin of an opening page. –  hakaze Aug 4 '12 at 19:37

I think the solution is to remove the includefootand then:

1. Use\thispagestyle{empty} after the chapter command so the page number disappears.
2. Use the command \enlargethispage{-\baselineskip} to reduce the type block on the chapter page one line (-2\baselineskipto reduce with two lines).
3. Use the package textpos to place the page number centred one line under the body text.

I assume all command can be defined in a page style to be linked to you chapter command.

And here is a MWE (which has to be refined):

\documentclass[11pt, letterpaper]{report}

\usepackage[absolute]{textpos}
\setlength{\TPHorizModule}{\paperwidth}
\setlength{\TPVertModule}{\paperheight}

\usepackage{blindtext}

\begin{document}

\begin{textblock}{0.8}[0.5,0.5](0.52,0.88)% Increase 0.88 to move down
% Increase 0.52 to move to right
\centering%
\noindent{\thepage}
\end{textblock}

\chapter{This is the first chapter}
\thispagestyle{empty}             % Remove page number
\enlargethispage{-\baselineskip}  % Reduce the type block one line

\Blindtext
\blinddocument

\end{document}


To move the page number further down, increase the last figure in the command:

\begin{textblock}{0.8}[0.5,0.5](0.5,0.86)%


Try changing the two lines

\enlargethispage{-\baselineskip}


and

\begin{textblock}{0.8}[0.5,0.5](0.52,0.88)%


My code is brute force. It is more sophisticated methods, f.ex. (re)defining the page style, or define one macro combining all the commands.

-
Thanks Sveinung! That does seem to work to an extent. I tried this in my thesis and it's moving around the page number. However, it's still leaving 1.5 inches below the page number. I would like it to be 1 inch as per the requirements. Is there a way ? I didnt fully understand the code to make changes myself. –  R.Bahl Aug 4 '12 at 21:34
@R.Bahl See revision. –  Sveinung Aug 4 '12 at 21:52