Text FormattingNeed help with hyperref and BiBTeX integration

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
rtkomar
Posts: 5
Joined: Sun Jun 26, 2011 1:02 pm

Need help with hyperref and BiBTeX integration

Post by rtkomar »

Hi all..
I am new to latex. I have been using it since a week. It is so easy to make a document.. But learning about the commands take a lot of time for beginners..

My Problem is, hyperref is not linking my citations with the references. I am using the standard IEEEtran.bst as my BIB style file and have made a BiBTeX entry 'reference.bib' of all my references. But in the documents when I am citing the references, they are not getting hyperlinked. I guess may be there is some problem with BiBTeX and hyperref integration. But then, the strange thing is, in references, the URLs from my 'reference.bib' files are hyperlinked to respective sites. What do I do? Do I need to use any special packages for that?
And by the way rest of the things like Figures, Table of contents and Equations are getting properly hyperlinked. Problem is with citations.

My preamble looks like this

Code: Select all

\documentclass[a4paper,12pt]{article}
\addtolength{\hoffset}{-1.5cm}
\addtolength{\textwidth}{3.5cm}
\addtolength{\voffset}{-1.50cm}
\addtolength{\textheight}{2.5cm}
\setlength{\topmargin}{0.5in}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{epsfig}
\usepackage{mathptm}
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{fancyhdr}
\usepackage{cite}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{color}
\usepackage{shorttoc}
\usepackage{verbatim}
\usepackage{float}
\usepackage{subfig}
\usepackage{fmtcount}
\usepackage{nomencl}  
\makenomenclature
\renewcommand\nomname{Symbols and Abbreviations}
\usepackage{hyperref}
\hypersetup{backref,colorlinks,linktocpage=true}
and the bibliography part is

Code: Select all

\bibliographystyle{IEEEtran}
\bibliography{reference}
Please help me on this.
Last edited by rtkomar on Fri Jul 01, 2011 6:09 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
gkl
Posts: 28
Joined: Sat Jan 17, 2009 12:21 am

Need help with hyperref and BiBTeX integration

Post by gkl »

I think backref (or hyperbackref) needs to be setup as an option when you load the package, otherwise its value is set and you can not change it.

So you should write

Code: Select all

\usepackage[hyperref,backpageref]{hyperref}
rtkomar
Posts: 5
Joined: Sun Jun 26, 2011 1:02 pm

Need help with hyperref and BiBTeX integration

Post by rtkomar »

gkl wrote:I think backref (or hyperbackref) needs to be setup as an option when you load the package, otherwise its value is set and you can not change it.

So you should write

Code: Select all

\usepackage[hyperref,backpageref]{hyperref}
I tried this.. But it gives error message saying
"2238:Package caption Error: backpageref undefined \ProcessKeyvalOptions{Hyp}"

The thing doesn't work even if I remove backref.. :( :(
gkl
Posts: 28
Joined: Sat Jan 17, 2009 12:21 am

Need help with hyperref and BiBTeX integration

Post by gkl »

Try this:

Code: Select all

\renewcommand{\backrefpagesname}{ \protect\\  \textit{Cited on
page(s):}~}
\renewcommand{\backref}{\backrefpagesname}
rtkomar
Posts: 5
Joined: Sun Jun 26, 2011 1:02 pm

Need help with hyperref and BiBTeX integration

Post by rtkomar »

gkl wrote:Try this:

Code: Select all

\renewcommand{\backrefpagesname}{ \protect\\  \textit{Cited on
page(s):}~}
\renewcommand{\backref}{\backrefpagesname}
Nothing is working.. :( And what I am supposed to do actually? Just enter the command you are showing in preamble?It still gives errors like

./proposal1.tex:39:\backrefpagesname undefined. \renewcommand{\backrefpagesname}
./proposal1.tex:41:\backref undefined. \renewcommand{\backref}
./proposal1.tex:2238:Package caption Error: backpageref undefined \ProcessKeyvalOptions{Hyp}

I am new to LaTeX.. I don't know how it works..
:( :(
gkl
Posts: 28
Joined: Sat Jan 17, 2009 12:21 am

Re: Need help with hyperref and BiBTeX integration

Post by gkl »

Could you please post on the forum a minimal file (one with the package declarations and some text) of the latex file you are trying to use so that I can compile and get a feeling of the errors?

If you remove the \hypersetup directive, does everything work (just in case you do not have hyperref installed)?

Regards,
George
rtkomar
Posts: 5
Joined: Sun Jun 26, 2011 1:02 pm

Need help with hyperref and BiBTeX integration

Post by rtkomar »

gkl wrote:Could you please post on the forum a minimal file (one with the package declarations and some text) of the latex file you are trying to use so that I can compile and get a feeling of the errors?

If you remove the \hypersetup directive, does everything work (just in case you do not have hyperref installed)?

Regards,
George
Thanks for the quick replies George.. :)

Here is my minimal working example.

Code: Select all

\documentclass[a4paper,12pt]{article}
\addtolength{\hoffset}{-1.5cm}
\addtolength{\textwidth}{3.5cm}
\addtolength{\voffset}{-1.50cm}
\addtolength{\textheight}{2.5cm}
\setlength{\topmargin}{0.5in}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{epsfig}
\usepackage{mathptm}
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{fancyhdr}
\usepackage{cite}
\usepackage{gensymb}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{color}
\usepackage{shorttoc}
\usepackage{verbatim}
\usepackage{float}
\usepackage{subfig}
\usepackage{fmtcount}
\linespread{1.2}
\usepackage{nomencl}
\makenomenclature 
\renewcommand\nomname{Symbols and Abbreviations}
\usepackage{hyperref}
\hypersetup{colorlinks,linktocpage=true}

\begin{document}
\begin{titlepage}
\begin{center}

{\Huge \textbf{Low Voltage Low Power Flash ADC}}\\
\vspace{40pt}
{ \Large Research Proposal}  \\
\vspace{20pt}
{\Large \textbf{ Mr.~Rajeev Komar}}
\end{center}
\end{titlepage}
\pagebreak

\pagenumbering{roman}
\tableofcontents 
\addcontentsline{toc}{section}{Contents}


\pagebreak 

\listoffigures
\addcontentsline{toc}{section}{List of Figures}

\pagebreak 

\printnomenclature[100pt]
\addcontentsline{toc}{section}{Symbols and Abbreviations}

\newpage \pagenumbering{arabic}
\pagebreak 

\section{Introduction}
\subsection{Motivation}

RC delay of the transistor scales with a factor of 0.5. This implies that smaller transistors switch faster \cite{wiki:2011:Mosfet}.

\section{Background}

The power dissipation of a logic gate is given by \cite{rabaey2003digital}
\begin{equation}\label{eq:pgate}
 P_{gate} = \frac{1}{2} \cdot {V_{DD}^2} \cdot C_{L} \cdot f_{clk} \cdot \alpha \hspace{30pt} \mathrm{(W)}
\end{equation}

\pagebreak

\section{The Problem}\label{prob}

We can refer to equation \eqref{eq:pgate} then it gets hyperlinked. But if we cite \cite{rabaey2003digital}, it doesn't. And the url link to wikipedia in \ref{bib} is hyperlinked. But it is giving wrong section name \ref{prob}. And this here is not hyperlinked to references \cite{wiki:2011:Mosfet}. Hope you got the problem.
\pagebreak


\bibliography{minimal}
\addcontentsline{toc}{section}{Reference}
\bibliographystyle{IEEEtran}\label{bib}

\end{document}
and the contents in minimal.bib file is

Code: Select all

@ONLINE{wiki:2011:Mosfet,
author = {Wikipedia},
title = {{MOSFET}},
month = jun,
year = {2011},
url = {http://en.wikipedia.org/wiki/MOSFET}
}

@book{rabaey2003digital,
  title={Digital Integrated Circuits, 2/e},
  author={Rabaey, J.M. and Chandrakasan, A.P. and Nikoli{\'c}, B.},
  isbn={9788178089911},
  year={2003},
  publisher={Pearson Education}
}
You can get IEEEtran.bst(The one I am using in file in \bibliographystyle) in
http://www.tex.ac.uk/tex-archive/bibli ... tranS.bst
or
http://www.ctan.org/tex-archive/macros ... an/bibtex
Help me out..
gkl
Posts: 28
Joined: Sat Jan 17, 2009 12:21 am

Need help with hyperref and BiBTeX integration

Post by gkl »

Hi,

I do apologise for the late reply (was caught up in preparing a journal and a conference paper); hope the reply comes in good time.

Your problems are caused by the cite package. Remove it from the preamble and replace it with

Code: Select all

\usepackage[pdftex,pagebackref]{hyperref}
    \usepackage{natbib}
    \hypersetup{colorlinks,linktocpage=true}
\renewcommand{\backrefpagesname}{ \protect\\  \textit{Cited on
page(s):}~}
\renewcommand{\backref}{\backrefpagesname}
Everything should be working then (at least the test document works in MikTeX).

Please let me know if that solves the problem or not.

Regards,
George
torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

Need help with hyperref and BiBTeX integration

Post by torbjorn t. »

Actually, all the hyperlinks in your example worked fine here, without making any changes (TeXlive 2010, all packages updated to the last available version, compiled with pdflatex). Of course, the link to the references display the wrong section number, as the references is an unnumbered section. You could solve that part by using the \hyperref command of the hyperref package:

Code: Select all

\hyperref[label]{link text}
And a small note about your example: While it is complete, it is not minimal. Most of the packages you load are unrelated to your problem, as well as the page layout changes and the titlepage. It's no big deal, just thought I'd mention it.

Also, a little tip: You may want to take a look at the packages geometry (for changing page layout) and tocbibind (puts toc, lof, bibliography in the toc).
rtkomar
Posts: 5
Joined: Sun Jun 26, 2011 1:02 pm

Need help with hyperref and BiBTeX integration

Post by rtkomar »

torbjorn t. wrote:Actually, all the hyperlinks in your example worked fine here, without making any changes (TeXlive 2010, all packages updated to the last available version, compiled with pdflatex). Of course, the link to the references display the wrong section number, as the references is an unnumbered section. You could solve that part by using the \hyperref command of the hyperref package:

Code: Select all

\hyperref[label]{link text}
And a small note about your example: While it is complete, it is not minimal. Most of the packages you load are unrelated to your problem, as well as the page layout changes and the titlepage. It's no big deal, just thought I'd mention it.

Also, a little tip: You may want to take a look at the packages geometry (for changing page layout) and tocbibind (puts toc, lof, bibliography in the toc).
Hey, thanks..
Actually there was problem with the package \usepackage{cite}.. When I commented it, it worked fine.. May be conflict between those two packages(But u told it s working fine in your system, so may be I need to update some more packages)..
Post Reply