I converted citation format to alphabetical according to this answer. But, it created an abnormal behavior in hyperref. Although the citations are still clickable in the PDF, nothing happens when I click on them. (With hyperref, when a citation is clicked, it should be dereferenced and the PDF viewer should jump to bibliography page where the citation was declared.)
MWE:
\documentclass[12pt]{article}
\usepackage{hyperref, lipsum}
\makeatletter
\renewcommand\@bibitem[1]{\item\if@filesw \immediate\write\@auxout{%
\string\bibcite{#1}{\theenumiv}}\fi\ignorespaces} %%% instead of \the\value{\@listctr}
\renewenvironment{thebibliography}[1]
{\section*{\refname}
\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
\list{\@biblabel{\alph{enumiv}}}% %% instead of "\@arabic\c@enumiv"
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\alph{enumiv}}}%
%% instead of "\@arabic\c@enumiv"
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\makeatother
\begin{document}
\lipsum[1]
\cite{A1}
\lipsum[2]
\pagebreak
\begin{thebibliography}{9}
\bibitem{A1}{John (2011)}
\bibitem{B1}{Carl (2015)}
\end{thebibliography}
\end{document}
Any idea how to fix it? I am using XeLaTeX engine to compile the document. (Because I intend to use package polyglossia later.)
My attempts to identify the problem:
After a little investigation, it became clear that when I renewed only \@bibitem command and not \thebibliography environment, the citation dereferencing error still remained.
Then I tried the following code, which is completely identical to the original definition of \@bibitem according to the LaTeX Bibliography manual. The error is here too.
Can anyone explain what is exactly happening?
\documentclass[12pt]{article}
\usepackage{hyperref, lipsum}
\makeatletter
\renewcommand\@bibitem[1]{\item\if@filesw \immediate\write\@auxout{%
\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces}
\makeatother
\begin{document}
\lipsum[1]
\cite{A1}
\lipsum[2]
\pagebreak
\begin{thebibliography}{9}
\bibitem{A1}{John (2011)}
\bibitem{B1}{Carl (2015)}
\end{thebibliography}
\end{document}
biblatex? In the same question you linked there's a solution forbiblatexby lockstep – Guilherme Zanotelli Dec 13 '16 at 08:41hyperref. Instead of modifying\@bibitemdirectly, I'd make use of thenatbibpackage and provide the required new pieces of information in the optional argument of each\bibiteminstruction. – Mico Dec 13 '16 at 09:35