Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using fancyhdr to put a text and page number on every page:

\usepackage{fancyheadings}

\fancypagestyle{plain}{
\fancyhf{}
\lhead{section \bfseries \thesection}
\chead{CS04-708 Main Project, 2011}
\cfoot[{\vspace*{0.2cm}Department of Production Engineering, GEC - Thrissur \\ \thepage }]{\vspace*{0.2cm}Department of     Production Engineering, GEC - Thrissur \\ \thepage }
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.5pt}
}

I'm getting the required footer only on pages where a chapter has begun (remember the default page style of a page where chapter begins is plain) rest of the pages have just the number (I'm guessing its the default style). I've been hunting Google a fix, but no avail.

EDIT

The CLS File

\ProvidesClass{mainreport}[]

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions

\LoadClass[12pt,oneside]{report}

\RequirePackage{graphicx}
\RequirePackage{amsfonts}
\RequirePackage{multicol}


% The list of packages needed for creating an advanced report class.

\RequirePackage{amsmath}
\RequirePackage{setspace}
\RequirePackage{textcase}
\RequirePackage[  bottom = 2.50cm]{geometry}
\usepackage{fancyhdr}
\pagestyle{plain}
\fancypagestyle{plain}{
    \fancyhf{}
    \lfoot{Department of Production Engineering, GEC - Thrissur }
    \rfoot{\thepage}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}
}




% Macro for List of Symbols
\def\listofsymbols{\input{symbols} \clearpage}
\def\addsymbol #1: #2#3{$#1$ \> \parbox{5in}{#2 \dotfill \pageref{#3}}\\}
\def\newsymbol#1{\label{#1}} 

\pagenumbering{roman}

\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}


% for setting up alternative directory paths to graphics files,
% remember to comment in "graphics" package
%
\graphicspath{{./eps/}{./tiff/}{./jpg/}{./fig/}{./dia/}{./gnuplot/}{./png/}}


%------------
\usepackage{geometry}
\geometry{verbose,a4paper,tmargin=25.4mm,bmargin=31.75mm,lmargin=38.1mm,rmargin=31.75mm}

%To generate list of abbreviations
\usepackage{nomencl}
\makenomenclature


\renewcommand{\section}{\@startsection
{section}%                   % the name
{1}%                         % the level
{0mm}%                       % the indent
{-\baselineskip}%            % the before skip
{0.5\baselineskip}%          % the after skip
{\fontsize{12pt}{14.4pt}\selectfont \bf  \MakeTextUppercase}} % the style

\renewcommand\contentsname{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{ Table of Contents}}
\renewcommand\listfigurename{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{ List of Figures}}
\renewcommand\listtablename{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{List of Tables }}
\renewcommand\nomname{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{List of Abbreviations }}
\renewcommand\abstractname{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{Abstract }}
\renewcommand\bibname{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{Abstract }}

%\renewcommand\listsymbolsname{\fontsize{14pt}{16.8pt}\selectfont \bf  \centering  \MakeTextUppercase{Bibliography }}

\newcommand{\chhead}{\fontsize{14pt}{16.8pt}\selectfont \centerline}
\makeatletter
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    %\ifnum \c@secnumdepth >\m@ne
    %    \huge\bfseries \@chapapp\space \thechapter
    %    \par\nobreak
    %    \vskip 20\p@
    %\fi
    \interlinepenalty\@M
    {\centering  \fontsize{14}{16.82} \selectfont  \bf \bfseries \thechapter .  \MakeTextUppercase{#1}\par\nobreak }
    \vskip 40\p@
  }}

  \makeatother

And the TEX File

\newcommand{\projecttitle}{fImpact of Valve timing in Engine Performance}
\newcommand{\projectauthors}{{\normalsize \bf {Arvind.S.A}}}

\documentclass{mainreport}
\usepackage{lipsum}
\linespread{1.5}
\begin{document}
\addcontentsline{toc}{chapter}{Abstract}
\chapter*{Abstract}
\lipsum[1]
\tableofcontents
\newpage
\addcontentsline{toc}{chapter}{List of abbreviations}
\input{abbreviation}
\pagenumbering{arabic}
\chapter{First}
\lipsum[1-3]
\chapter{seond}
\lipsum[1-3]

%\bibliographystyle{amsplain}
%\bibliography{master}

\end{document}

I thank you for your trouble.

share|improve this question
    
tried yet no change. i tried changing to \usepackage{fancyhdr} \pagestyle{plain} \fancypagestyle{plain}{ \fancyhf{} \lfoot{Department of Production Engineering, GEC - Thrissur } \rfoot{\thepage} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } but no improvement –  Arvindsa Apr 17 '12 at 14:02
    
thats causing some errors ` Use of \reserved@a doesn't match its definition. \new@ifnextchar ...served@d = #1\def \reserved@a { #2}\def \reserved@b {#3}\f...` –  Arvindsa Apr 17 '12 at 14:13
    
See the answer below. If problem persists, add a complete minimal working example to get more accurate answers. –  Harish Kumar Apr 17 '12 at 14:23
add comment

2 Answers

up vote 1 down vote accepted

The class you're using has many deficiencies. The main one is the very wrong way to set the unnumbered chapters.

Here's an amended version:

\ProvidesClass{mainreport}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
\ProcessOptions

\LoadClass[12pt,oneside]{report}

\RequirePackage{graphicx}
\RequirePackage{amsfonts}
\RequirePackage{multicol}


% The list of packages needed for creating an advanced report class.

\RequirePackage{amsmath}
\RequirePackage{setspace}
\RequirePackage{textcase}

% Macro for List of Symbols
\def\listofsymbols{\input{symbols} \clearpage}
\def\addsymbol #1: #2#3{$#1$ \> \parbox{5in}{#2 \dotfill \pageref{#3}}\\}
\def\newsymbol#1{\label{#1}} 

\pagenumbering{roman}

\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}


% for setting up alternative directory paths to graphics files,
% remember to comment in "graphics" package
%
\graphicspath{{./eps/}{./tiff/}{./jpg/}{./fig/}{./dia/}{./gnuplot/}{./png/}}


%------------
\usepackage{geometry}
\geometry{verbose,a4paper,tmargin=25.4mm,bmargin=31.75mm,lmargin=38.1mm,rmargin=31.75mm}
\usepackage{fancyhdr}
\pagestyle{fancy}
    \fancyhf{}
    \lfoot{Department of Production Engineering, GEC - Thrissur }
    \rfoot{\thepage}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}
\fancypagestyle{plain}{
    \fancyhf{}
    \lfoot{Department of Production Engineering, GEC - Thrissur }
    \rfoot{\thepage}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}
}




%To generate list of abbreviations
\usepackage{nomencl}
\makenomenclature


\renewcommand{\section}{\@startsection
{section}%                   % the name
{1}%                         % the level
{0mm}%                       % the indent
{-\baselineskip}%            % the before skip
{0.5\baselineskip}%          % the after skip
{\fontsize{12pt}{14.4pt}\selectfont \bfseries  \MakeTextUppercase}} % the style


\DeclareRobustCommand{\chhead}{\fontsize{14pt}{16.8pt}\bfseries\centering}
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \normalfont\centering
    %\ifnum \c@secnumdepth >\m@ne
    %    \huge\bfseries \@chapapp\space \thechapter
    %    \par\nobreak
    %    \vskip 20\p@
    %\fi
    \interlinepenalty\@M
    {\chhead\thechapter. \MakeTextUppercase{#1}\par\nobreak }
    \vskip 40\p@
  }}
\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \normalfont\centering
    %\ifnum \c@secnumdepth >\m@ne
    %    \huge\bfseries \@chapapp\space \thechapter
    %    \par\nobreak
    %    \vskip 20\p@
    %\fi
    \interlinepenalty\@M
    {\chhead\MakeTextUppercase{#1}\par\nobreak }
    \vskip 40\p@
  }}

Now if in your document you want to add your header, use

\lhead{section \bfseries \thesection}
\chead{CS04-708 Main Project, 2011}

I don't know whether the class is provided by your company. If it is, it shouldn't set an explicit footer, but rely on macros defined in the document.

share|improve this answer
    
The Answer worked magically. I managed to get the stuff working just using the \pagestyle{plain}. Thanks –  Arvindsa Apr 18 '12 at 8:59
add comment

Without a complete MWE, we can only guess your problem. The following code works for me:

% Book Class (This is a LaTeX2e document)  ***********************
% ----------------------------------------------------------------
\documentclass[12pt]{book}
\usepackage{lipsum}%provides dummy text
\usepackage{fancyhdr}
\usepackage[margin=1in,showframe]{geometry} % to show frames and control page layout
% ----------------------------------------------------------------
\fancypagestyle{plain}{% 
\fancyhf{} 
\lfoot{Department of Production Engineering, GEC - Thrissur } 
\rfoot{\thepage} 
\renewcommand{\headrulewidth}{0pt} 
\renewcommand{\footrulewidth}{0pt} 
}
%
\pagestyle{plain}
%
\begin{document}
\chapter{First}
\lipsum[1-8]
%
\end{document}

Footer of the chapter page:

enter image description here

and the footer of second page:

enter image description here

To get an accurate diagnosis, consider adding a complete (non)working MWE.

share|improve this answer
    
added as an edit to original question –  Arvindsa Apr 17 '12 at 14:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.