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 am a beginner in using LaTeX. The problem I am getting is that I am unable to get the correct reference page number in the content, but get the previous chapter last page number. Also in the header, i.e. chapter number of the references is of previous chapter.

This is the main file code

\documentclass[12pt,a4paper]{report}

\usepackage[top=0.70in, bottom=0.70in, left=0.8in,right=0.80in]{geometry} % setting the page alignment with this package
\usepackage[pdftex]{graphicx} 
\usepackage[dvips, bookmarks, colorlinks=false]{hyperref} %for creating links in the pdf version and other additional pdf attributes, no effect on the printed document
\usepackage[final]{pdfpages} %for embedding another pdf, remove if not required
\usepackage{float} %used for figure placement with H as a parameter
\usepackage{pslatex} % for times new roman, old package, but works
\usepackage{array} % for making text bold in table
\usepackage{subfigure} % for displaying figure side by side

%For the header and footer
\usepackage{fancyhdr}
\fancypagestyle{plain}{%
%\fancyhf{} % clear all header and footer fields
\fancyfoot[L]{\emph{TouchX Mouse Simulation Using Gesture on a Virtual Screen}} % except the center
\fancyfoot[R]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
}

\pagestyle{fancy}
\lhead{Chapter \thechapter}
\renewcommand{\chaptermark}[1]{% 
\markboth{#1}{}} 

\fancyfoot[LO,LE]{\emph{TouchX Mouse Simulation Using Gesture on a Virtual Screen}}
\cfoot{}
\fancyfoot[RO, RE]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
%For the header and footer Over

% Altering the Index Page Title
%\renewcommand{\contentsname}{\begin{center}\textsc{University Of Pune \\2011 - 2012}\\[1cm]Index\end{center}} 


%GLOBAL SETTINGS OVER, DOCUMENT BEGINS
\begin{document}

%Renames "Bibliography" to "References" on ref page
\renewcommand\bibname{References} 



%TABLE OF CONTENTS AND LIST OF FIGURES ARE AUTOMATICALLY ADDED BY FOLLOWING COMMANDS
%ADD FIGURE OF TABLES IF YOU NEED TO, CHECK DOCUMENTATION
\pagenumbering{roman} %numbering before main content starts


%To reset the Header & Footer for TOC and LOF
\pagestyle{empty}
\addtocontents{toc}{\protect\thispagestyle{empty}}
\tableofcontents % adds Index Page

%\pagestyle{empty}

\addtocontents{lof}{\protect\thispagestyle{empty}}
\listoffigures % adds List of Figures
\addtocontents{lot}{\protect\thispagestyle{empty}}
\listoftables
\cleardoublepage

%And reset back the settings we choose for Header and Footer
\pagestyle{fancy}

\newpage
\pagenumbering{arabic} %reset numbering to normal for the main content

\input{project/introduction.tex} % adds the introduction page
\input{project/ref.tex} % adds the References page

\end{document}

and the ref.tex file is

\addcontentsline{toc}{chapter}{References}
\begin{thebibliography}{99}

\bibitem{short_paper_name}Mario Ganzeboom ,\emph{How hand gestures are recognized using a dataglove};  University of Twente,The Netherlands,2010.
\bibitem{short_paper_name}Ye Zhou,Gerald Morrison,\emph{A Real-time Algorithm for Finger Detection in a Camera Based Finger-Friendly Interactive Board System}; 5th International Conference on Computer Vision Systems, Applied Computer Science Group, Bielefeld University, Germany,2007.

\end{thebibliography}
share|improve this question
1  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem directly to the question, i.e. remove every line which does not have an impact on the issue (like unrelated packages, etc.) and inline the content from input files. –  Martin Scharrer May 1 '12 at 7:52
1  
One thing I found in your code is that you are passing device drivers to the packages, i.e. pdftex to graphicx and dvips to hyperref. This is no longer required and should be avoided, because it leads to issues when the wrong driver is selected manually. Of course, the driver should be the same for all packages, so the above choice doesn't make much sense. This is not related to your stated problem, but will cause issues for you nevertheless. –  Martin Scharrer May 1 '12 at 7:55
1  
Note that the 'References' page uses \chapter* (with report class) and therefore doesn't change the chapter counter, which explains why you still get the last chapter number. Usually you don't have an header showing the chapter number or title for such pages, so I would recommend you to switch the page style for these pages. If you give a full example of your use case, we can help you better. –  Martin Scharrer May 1 '12 at 7:57
    
Your example is not very minimal... –  Martin Schröder May 1 '12 at 8:55

1 Answer 1

It's quite simple:

\begin{thebibliography}{99}
\addcontentsline{toc}{chapter}{\bibname}
\lhead{}\markboth{\bibname}{}

\bibitem{short_paper_name1}
Mario Ganzeboom, \emph{How hand gestures are recognized using a dataglove};  University of Twente, The Netherlands,2010.

\bibitem{short_paper_name2}
Ye Zhou,Gerald Morrison, \emph{A Real-time Algorithm for Finger Detection in a Camera Based Finger-Friendly Interactive Board System}; 5th International Conference on Computer Vision Systems, Applied Computer Science Group, Bielefeld University, Germany, 2007.

\end{thebibliography}

In this way the header is set after the bibliography has started and so the page number in the table of contents will be correct.


Some notes

You're using conflicting options dvips and pdftex: remove them, they are unnecessary as the typesetting engine is able to recognize itself.

The package pslatex is obsolete:

\usepackage{mathptmx}

Also subfigure is obsolete:

\usepackage{subfig}

(you may need to change some commands, as the new version uses \subfloat rather than \subfigure and \subtable).

Add

\setlength{\headheight}{14.5pt}

to the preamble, or headheight=14.5pt to the options passed to geometry.

share|improve this answer
    
thanks a lot @egreg and everyone it works fine after the changes –  Mridul Birla May 1 '12 at 9:07

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.