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.

When I use the splitbib package, the anchors for the citations produced by hyperref seem to disappear. I have some example code to illustrate the problem:

\documentclass{article}
\usepackage{hyperref}
\usepackage{splitbib}

\begin{document}
We cite~\cite{entry1,entry3,entry4,entry5}.

\clearpage
\begin{thebibliography}{4}

\bibitem{entry1} This is the first entry.

\bibitem{entry3} This is the third entry.

\bibitem{entry4} This is the fourth one.

\bibitem{entry5} This is the last one.

\end{thebibliography}
\end{document}

If the splitbib package is commented out, then the hyperlinks work as expected, i.e., clicking on [1] will take you to the next page. If the splitbib package is included, the link no longer works. Also, if you change the order of the two packages, it won't even compile.

My ultimate goal is to have a bibliography with a two categories ("Good Stuff" and "Everything Else") and then to have the "Good Stuff" split into several subcategories. I know many folks have suggested biblatex, but it's hard to figure out how to use the system. If someone can give me an biblatex example of what I ultimately need, that would also suffice to solve my problem.

share|improve this question

1 Answer 1

Here's a biblatex solution using the "category" feature -- assign bibentries to categories within your main .tex file:

\documentclass{article}

\usepackage[defernumbers=true]{biblatex}

\DeclareBibliographyCategory{goodA}
\DeclareBibliographyCategory{goodB}
\DeclareBibliographyCategory{else}
\addtocategory{goodA}{A01,K11}
\addtocategory{goodB}{B02}
\addtocategory{else}{C03}

\usepackage{hyperref}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
@misc{C03,
  author = {Cuthor, C.},
  year = {2003},
  title = {Charlie},
}
@misc{K11,
  author = {Kuthor, K.},
  year = {2011},
  title = {Kilo},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

Some text \autocite{A01,B02,C03}. Some more text \autocite{K11}.

\printbibheading[title={Good Stuff}]

\printbibliography[heading=subbibliography,category=goodA,title={Good Stuff, category~A}]

\printbibliography[heading=subbibliography,category=goodB,title={Good Stuff, category~B}]

\printbibliography[category=else,title={Everything Else}]

\end{document}

Alternatively, you may add the special keywords field to your .bib file :

\documentclass{article}

\usepackage[defernumbers=true]{biblatex}

\usepackage{hyperref}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
  keywords = {goodA},
}
@misc{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
  keywords = {goodB},
}
@misc{C03,
  author = {Cuthor, C.},
  year = {2003},
  title = {Charlie},
  keywords = {else},
}
@misc{K11,
  author = {Kuthor, K.},
  year = {2011},
  title = {Kilo},
  keywords = {goodA},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

Some text \autocite{A01,B02,C03}. Some more text \autocite{K11}.

\printbibheading[title={Good Stuff}]

\printbibliography[heading=subbibliography,keyword=goodA,title={Good Stuff, category~A}]

\printbibliography[heading=subbibliography,keyword=goodB,title={Good Stuff, category~B}]

\printbibliography[keyword=else,title={Everything Else}]

\end{document}

The identical output for both examples (EDIT: now also demonstrating the use of hyperref):

enter image description here

share|improve this answer
    
This is very helpful! Thanks very much. I have another question: how do I convince biblatex to number things in order in the bibliography. Currently they are numbered in alphabetical author order, rather than first by category and then by alphabetical order. I am using the first version of the code, i.e., where I declare the category in the latex code rather than the bib database. Thanks in advance for any further help. –  user937840 Jan 17 '12 at 21:07
    
I found the answer --- add defernumbers=true in the options for the biblatex package. –  user937840 Jan 17 '12 at 21:14
    
@user937840 Indeed. I updated my example to be more instructive. –  lockstep Jan 17 '12 at 21:19
    
@user937840 Don't forget to accept this answer if it solved the problem! –  cfr Apr 15 at 22:27

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.