我尝试将所有出版物列为章节、文章和会议论文集,使用\printbibliography
\nocite{*}
% \printbibheading[title={Book Chapters}]
\printbibliography[heading=subbibliography,type=inbook,title= {Book Chapters},resetnumbers=true]
\printbibliography[heading=subbibliography,type=article,title={Journal Articles},resetnumbers=true]
\printbibliography[heading=subbibliography,type=inproceedings,title={Conference Proceedings},resetnumbers=true]
使用defernumbers=true
:
使用defernumbers=false
:
我正在寻找一种方法,让每个部分的参考文献从 1 开始(书籍第 1-5 章、文章 1-...)。非常感谢您阅读这篇文章。祝您有美好的一天。
答案1
答案2
找到了相当冗长的解决方案:
\AtDataInput[inbook]{%
\xifinlistcs{\thefield{entrykey}}{entrylist:\therefsection}{}{%
\listcsxadd{entrylist:\therefsection}{\thefield{entrykey}}%
\csnumgdef{bookentrycount:\therefsection}{%
\csuse{bookentrycount:\therefsection}+1}}}
\DeclareFieldFormat[inbook]{labelnumber}{\mkbibbookdesc{#1}}
\newrobustcmd*{\mkbibbookdesc}[1]{%
\number\numexpr\csuse{bookentrycount:\therefsection}+1-#1\relax}
\AtDataInput[article]{%
\xifinlistcs{\thefield{entrykey}}{entrylist:\therefsection}{}{%
\listcsxadd{entrylist:\therefsection}{\thefield{entrykey}}%
\csnumgdef{articleentrycount:\therefsection}{%
\csuse{articleentrycount:\therefsection}+1}}}
\DeclareFieldFormat[article]{labelnumber}{\mkbibarticledesc{#1}}
\newrobustcmd*{\mkbibarticledesc}[1]{%
\number\numexpr\csuse{articleentrycount:\therefsection}+1-#1\relax}
\AtDataInput[inproceedings]{%
\xifinlistcs{\thefield{entrykey}}{entrylist:\therefsection}{}{%
\listcsxadd{entrylist:\therefsection}{\thefield{entrykey}}%
\csnumgdef{inproceedingscount:\therefsection}{%
\csuse{inproceedingscount:\therefsection}+1}}}
\DeclareFieldFormat[inproceedings]{labelnumber}{\mkbibinproceedingscountdesc{#1}}
\newrobustcmd*{\mkbibinproceedingscountdesc}[1]{%
\number\numexpr\csuse{inproceedingscount:\therefsection}+1-#1\relax}