LaTeX forum ⇒ Page LayoutDefinition of a new Page Style Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
corey979
Posts: 2
Joined: Thu Jun 07, 2012 7:02 pm

Definition of a new Page Style

Postby corey979 » Thu Jun 07, 2012 7:10 pm

I'm writing a thesis in a two-sided document using the »book« class. I want to define a new page style so that when I type \thispagestyle{thesis} I will have the page number on the right side in the footer. Unfortunately, the only definition I found was
  1. \makeatletter
  2. \newcommand{\ps@thesis}{
  3. \renewcommand{\@oddfoot}{\thepage}
  4. }
  5. \makeatother

which as I understood is just setting the page number on the center. How can I define it to be in the right of the footer?

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

Postby localghost » Thu Jun 07, 2012 7:32 pm

Usually new page styles are set up by packages like fancyhdr or titleps (split from titlesec).

Without any package you can try these lines.
  1. \makeatletter
  2. \def\ps@thesis{%
  3. \let\@oddhead\@empty%
  4. \let\@evenhead\@empty%
  5. \def\@oddfoot{\reset@font\hfil\thepage}%
  6. \def\@evenfoot{\reset@font\thepage\hfil}%
  7. }
  8. \makeatother

For a better appearance you should also define the footer of even pages (see code above).


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

corey979
Posts: 2
Joined: Thu Jun 07, 2012 7:02 pm

Postby corey979 » Thu Jun 07, 2012 11:57 pm

Thank you, that works and is what I needed :)


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 7 guests