Page LayoutHow to remove page numbers from my document?

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
apleto
Posts: 6
Joined: Wed Feb 04, 2009 10:24 pm

How to remove page numbers from my document?

Post by apleto »

Hello,

I am using IEEETrans to write a paper. I am not submitting it to an IEEE Transactions publication, but I 'm just using this document class because I thought it is very neat and well implemented.

Anyway, I don't want any page numbers on my paper. I tried to comment out the following lines in IEEETrans.cls but that resulted in about 50 errors while trying to build my paper. I can't understand why.

Code: Select all

%% SET UP THE DEFAULT PAGESTYLE
\ps@headings
\pagenumbering{arabic}

% normally the page counter starts at 1
\setcounter{page}{1}
% however, for peerreview the cover sheet is page 0 or page -1
% (for duplex printing)
\ifCLASSOPTIONpeerreview
  \if@twoside
      \setcounter{page}{-1}
   \else
      \setcounter{page}{0}
   \fi
\fi
Is there a better and easier way to get rid off page numbers from my paper, but still use IEEETran document class?

Any help would be much appreciated!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

How to remove page numbers from my document?

Post by Stefan Kottwitz »

Hi apleto,

try

Code: Select all

\makeatletter
\let\ps@plain\ps@empty
\let\ps@headings\ps@empty
\makeatother
like noted in Modifying plain page style.

Stefan
LaTeX.org admin
apleto
Posts: 6
Joined: Wed Feb 04, 2009 10:24 pm

Re: How to remove page numbers from my document?

Post by apleto »

Unfortunately the above does not work...

Is there anything else I can do?

Why when I comment out the code mentioned above in the .cls file that generates more errors?

Should I change something in the .cls file?

Should I change something in the source file of my document (i.e. the .tex file)?
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

How to remove page numbers from my document?

Post by phi »

First of all, never make private changes to a class or package, they would make your system hard to maintain and update over time. Every change should go into the document (.tex) file. The following should do the job:

Code: Select all

\documentclass{IEEEtran}

\usepackage{blindtext}
\usepackage{etoolbox}

\makeatletter
\def\do#1{\patchcmd{#1}{\thepage}{\null}{}{\GenericWarning{}{Could not patch \string#1}}}
\docsvlist{\@oddhead,\@evenhead,\ps@headings,\ps@IEEEtitlepagestyle,\ps@IEEEpeerreviewcoverpagestyle}
\makeatother


\begin{document}

\Blinddocument

\end{document}
Post Reply