The hints in this link solved my problem. It seems that backref
conflicts with the urls that contains either %
or #
. Using tinyURL can solve the problem. However, this is not a complete solution as someone may like to have the actual url in the reference. I should say that it didn't fix the correct back-referencing.
That would be great if someone could address how we can have %
and #
in bibliography while using back-referencing.
Here is a MWE
\documentclass[
openright,
titlepage, numbers=noenddot, headinclude,%1headlines,
footinclude=true, cleardoublepage=empty,
BCOR=30mm, paper=letter, fontsize=11pt, % Binding correction, paper type and font size
ngerman, american, % Languages
]{scrreprt}
\PassOptionsToPackage{%
eulerchapternumbers,
listings,
pdfspacing,
subfig,
beramono,
parts}{classicthesis}
\PassOptionsToPackage{square,numbers,sort&compress}{natbib}
\usepackage{natbib}
\usepackage[position=t,singlelinecheck=off,font={it}]{subfig}
\PassOptionsToPackage{pdftex,hyperfootnotes=false,pdfpagelabels}{hyperref}
\usepackage{hyperref} % backref linktocpage pagebackref
\pdfcompresslevel=9
\pdfadjustspacing=1
\hypersetup{
colorlinks=true, linktocpage=true, pdfstartpage=1, pdfstartview=FitV,
breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,
plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,
hypertexnames=true, pdfhighlight=/O, %
}
\usepackage{ifthen} % Allows the user of the \ifthenelse command
\newboolean{enable-backrefs} % Variable to enable backrefs in the bibliography
\setboolean{enable-backrefs}{true} % Variable value: true or false
% ---------------------------------------------------------------------------------------
\newcommand{\backrefnotcitedstring}{\relax} % (Not cited.)
\newcommand{\backrefcitedsinglestring}[1]{(Cited on page~#1.)}
\newcommand{\backrefcitedmultistring}[1]{(Cited on pages~#1.)}
\ifthenelse{\boolean{enable-backrefs}} % If backrefs were enabled
{
\PassOptionsToPackage{hyperpageref}{backref}
\usepackage{backref} % to be loaded after hyperref package
\renewcommand{\backreftwosep}{ and~} % separate 2 pages
\renewcommand{\backreflastsep}{, and~} % separate last of longer list
\renewcommand*{\backref}[1]{} % disable standard
\renewcommand*{\backrefalt}[4]{% detailed backref
\ifcase #1
\backrefnotcitedstring
\or
\backrefcitedsinglestring{#2}
\else
\backrefcitedmultistring{#2}
\fi}
}{\relax}
\usepackage{classicthesis}
\begin{document}
This is test for back-referencing. \citep{chdkiller}.
\bibliographystyle{abbrvunsrtnat}
\bibliography{Bibliography}
\end{document}
Here is the file content of the bibliography file.
@misc{chdkiller,
author = {},
title = {{Centers for Disease Control and Prevention. Vital Statistics Public Use
Data Files - 2008 Mortality Multiple Cause Files}},
howpublished = "\url{http://www.cdc.gov/nchs/data_access/Vitalstatsonline.htm#Mortality_Multiple}",
year = {2012},
note = "[Online; accessed March 7, 2012]"
}
If I remove #
from the url in the bibliography file, it will work. I am using the bibliography style file, abbrvunsrtnat.bst
, posted here. It seems backref
package does not like %
and #
in the urls.