splitbib 和 hyperref 之间的冲突

splitbib 和 hyperref 之间的冲突

当我使用该splitbib包时,生成的引文的锚点hyperref似乎消失了。我有一些示例代码来说明这个问题:

\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}

如果splitbib注释掉该包,则超链接将按预期工作,即单击[1]将带您进入下一页。如果splitbib包含该包,则链接不再有效。此外,如果您更改两个包的顺序,它甚至不会编译。

我的最终目标是拥有一个包含两个类别(“好东西”和“其他一切”)的书目,然后将“好东西”分成几个子类别。我知道很多人建议biblatex,但很难弄清楚如何使用该系统。如果有人能给我一个biblatex我最终需要的例子,那也足以解决我的问题。

答案1

以下是biblatex使用“类别”功能的解决方案 - 将 bibentries 分配给主.tex文件中的类别:

\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}

或者,您可以将特殊keywords字段添加到您的.bib文件中:

\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}

两个示例的输出相同(编辑:现在还演示了的用法hyperref):

在此处输入图片描述

相关内容