Page LayoutDefinition of a new Page Style

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

Definition of a new Page Style

Post by corey979 »

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

Code: Select all

\makeatletter
\newcommand{\ps@thesis}{
\renewcommand{\@oddfoot}{\thepage}
}
\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?

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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

Definition of a new Page Style

Post by localghost »

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

Without any package you can try these lines.

Code: Select all

\makeatletter
\def\ps@thesis{%
  \let\@oddhead\@empty%
  \let\@evenhead\@empty%
  \def\@oddfoot{\reset@font\hfil\thepage}%
  \def\@evenfoot{\reset@font\thepage\hfil}%
}
\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
corey979
Posts: 2
Joined: Thu Jun 07, 2012 7:02 pm

Re: Definition of a new Page Style

Post by corey979 »

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