我遇到了这个问题,尽管我在网上搜索了很久,但就是找不到答案。我想要两个参考书目。一个保存我在文中引用的引文,另一个保存所有引文(例如完整的出版物列表)。前者应该按照我引用的顺序排列,而后者应该按年份排列。
后者的问题是,我可以使用 使其按年份排序\nocite{*}
,但它们将按照 bibtex 中编写的(任意)顺序进行编号。最小工作示例:
\documentclass{article}
\usepackage[backend=biber,style=numeric-comp,sorting=none]{biblatex}
\begin{filecontents}{mybib.bib}
@article{ref2014,
author = {First, Author},
volume = {54},
number = {2},
journal = {Phys. Rev. {\O}},
year = {2014},
title = {Funny title 1},
pages = {1--3}}
@article{ref2012,
author = {Second, Author},
volume = {54},
number = {2},
journal = {Phys. Rev. {\O}},
year = {2012},
title = {Funny title 2},
pages = {1--3}}
@article{ref2013,
author = {Third, Author},
volume = {54},
number = {2},
journal = {Phys. Rev. {\O}},
year = {2013},
title = {Funny title 3},
pages = {1--3}}
\end{filecontents}
\addbibresource{mybib.bib}
\begin{document}
\section{Interesting text}
\begin{refsection}[mybib]
Citing some stuff \cite{ref2013,ref2012} numbered in the order I cite them\cite{ref2014}.
\printbibliography[title=Citations]
\end{refsection}
\begin{refsection}[mybib]
\nocite{*}
\printbibliography[sorting=ynt,title={Entire publication list sorted by year}]
\end{refsection}
\end{document}
现在我的按年份排序的完整出版物列表按年份排序,但按顺序编号2,3,1
。我希望如此1,2,3
。有人能帮助我吗?
答案1
您可以使用biblatex
-commands\ateverycite
和\addtocategory
来区分被引用和未被引用的文献条目。
对于不同的排序,您可以设置 biblatex-option defernumbers=true
,并resetnumbers=true
在 中用作选项\printbibliography
。
梅威瑟:
\documentclass{article}
\usepackage[backend=biber,style=numeric-comp,
sorting=none,defernumbers=true]{biblatex}%mod.
\begin{filecontents}{mybib.bib}
@article{ref2014,
author = {First, Author},
volume = {54},
number = {2},
journal = {Phys. Rev. {\O}},
year = {2014},
title = {Funny title 1},
pages = {1--3}}
@article{ref2012,
author = {Second, Author},
volume = {54},
number = {2},
journal = {Phys. Rev. {\O}},
year = {2012},
title = {Funny title 2},
pages = {1--3}}
@article{ref2013,
author = {Third, Author},
volume = {54},
number = {2},
journal = {Phys. Rev. {\O}},
year = {2013},
title = {Funny title 3},
pages = {1--3}}
\end{filecontents}
\addbibresource{mybib.bib}
\DeclareBibliographyCategory{cited}
\AtEveryCitekey{\addtocategory{cited}{\thefield{entrykey}}}
\begin{document}
\section{Interesting text}
\begin{refsection}[mybib]
Citing some stuff \cite{ref2013,ref2012} numbered in the order I cite them.
\printbibliography[resetnumbers=true,title=Citations,category=cited]%mod
\end{refsection}
\begin{refsection}[mybib]
\nocite{*}
\printbibliography[resetnumbers=true,sorting=ynt,%mod
title={Entire publication list sorted by year}]
\end{refsection}
\end{document}
输出: