This is not a new answer, it is just something too long to be left as comment.
In the comments to the great answer of Andrew Swann, there is the discussion about how to proceed not to break the hyperref
behaviour. Since I had exactly this need when I came here, I decided to leave what I did as a possible patch for other users.
Desclaimer: It is quick and dirty, use it with a pinch of salt. Actually, here it is just about putting a prefix to the full bibliography, but anyone can use this as a starting point for her/his needs.
Looking at how the \@bibitem
is redefined in the hyperref
command,
\def\@bibitem#1{%
\@skiphyperreftrue\H@item\@skiphyperreffalse
\Hy@raisedlink{%
\hyper@anchorstart{cite.#1\@extra@b@citeb}\relax\hyper@anchorend
}%
\if@filesw
\begingroup
\let\protect\noexpand
\immediate\write\@auxout{%
\string\bibcite{#1}{\the\value{\@listctr}}%
}%
\endgroup
\fi
\ignorespaces
}%
it should not be so hard to insert a prefix into the \bibcite
call. Of course, this has to go together with a redefinition of \@biblabel
as also shown by Andrea Swann.
Then I decided to create a changeBibPrefix
command in order to redefine correctly the needed macros.
\makeatletter
\newcommand{\changeBibPrefix}[1]{%
\def\@bibitem##1{%
\@skiphyperreftrue\H@item\@skiphyperreffalse
\Hy@raisedlink{%
\hyper@anchorstart{cite.##1\@extra@b@citeb}\relax\hyper@anchorend
}%
\if@filesw
\begingroup
\let\protect\noexpand
\immediate\write\@auxout{%
\string\bibcite{##1}{#1\the\value{\@listctr}}%
}%
\endgroup
\fi
\ignorespaces
}
\def\@biblabel##1{[#1##1]}
}
\makeatother
The only thing to pay attention here is to use #1
to identify the prefix passed to the \changeBibPrefix
command and ##1
to identify the \@bibitem
or \@biblabel
macro argument.
At this point one can put all together in an example, where I decided to make the number in the bibliography continue.
\documentclass{article}
\usepackage{enumitem,lipsum}
\usepackage[colorlinks = true, citecolor = blue]{hyperref}
\newcounter{bibIndex}
\makeatletter
\newcommand{\changeBibPrefix}[1]{%
\def\@bibitem##1{%
\@skiphyperreftrue\H@item\@skiphyperreffalse
\Hy@raisedlink{%
\hyper@anchorstart{cite.##1\@extra@b@citeb}\relax\hyper@anchorend
}%
\if@filesw
\begingroup
\let\protect\noexpand
\immediate\write\@auxout{%
\string\bibcite{##1}{#1\the\value{\@listctr}}%
}%
\endgroup
\fi
\ignorespaces
}
\def\@biblabel##1{[#1##1]}
}
\makeatother
\begin{document}
\section{Some section}
\lipsum[1-3] Cite \cite{ref1} and cite \cite{ref2}. \lipsum[2]
\changeBibPrefix{P}
\renewcommand{\refname}{First bibliography}
\begin{thebibliography}{9}
\bibitem{ref1} First reference
\bibitem{ref2} Second reference
\setcounter{bibIndex}{\value{enumiv}}
\end{thebibliography}
\section{Some other section}
\lipsum[1] Cite \cite{ref1} and cite \cite{ref3}. \lipsum[2-5]
\changeBibPrefix{R}
\renewcommand{\refname}{Second bibliography}
\begin{thebibliography}{9}
\setcounter{enumiv}{\value{bibIndex}}
\bibitem{ref3} Third reference
\end{thebibliography}
\end{document}