biblatex 透過類別連續反向編號

biblatex 透過類別連續反向編號

答案是引用某種類型的參考文獻...幾乎完美地解決了我的問題,但我希望透過連續計數對我的履歷進行排序:

**Articles**
[5] great Article 2
[4] great Article 1

**Presentations**
[3] great Presentation 2
[2] great Presentation 1

**Thesis**
[1] great Thesis

答案1

從連結開始回答您需要一個計數器,而不是每個類別一個。基本上你只需要bbx@itemtotal.

\documentclass{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=numeric,sorting=ydnt,defernumbers]{biblatex}

\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}

\makeatletter

% Print labelnumber as actual number, plus item total, minus one
\newrobustcmd{\mkbibdesc}[1]{%
  \number\numexpr\csuse{bbx@itemtotal}+1-#1\relax}

% Increment item total, add entries to categories
\def\bbx@itemtotalcategory#1{%
  \iftoggle{blx@skipbib}{\listbreak}{}%
  \ifentrytype{#1}
    {\csnumgdef{bbx@itemtotal}{\csuse{bbx@itemtotal}+1}%
     \addtocategory{#1}{\thefield{entrykey}}%
     \listbreak}
    {}}
\AtDataInput{\forlistloop{\bbx@itemtotalcategory}{\blx@categories}}
\csnumgdef{bbx@itemtotal}{0}

\makeatother

\DeclareBibliographyCategory{article}
\DeclareBibliographyCategory{report}
\DeclareBibliographyCategory{inproceedings}

\defbibheading{bibliography}{\section*{Publications and Presentations}}
\defbibheading{article}{\subsection*{Journal Articles}}
\defbibheading{report}{\subsection*{Reports}}
\defbibheading{inproceedings}{\subsection*{Presentations}}

\addbibresource{biblatex-examples.bib}
\begin{document}
\nocite{aksin,bertram,chiu,companion,padhye,angenendt,moraux}
\printbibheading
\bibbycategory
\end{document}

同樣的警告也適用於此 - 該方法僅適用於\nocite並且需要額外的 LaTeX 運行,即使biblatex沒有告訴您需要一個。

相關內容