
我正在使用名為“publist”的 BibLaTex 擴充功能來發布我的出版物的編號清單。它按升序對項目進行編號(見下圖)。
如果我希望它們以相反的順序編號怎麼辦?因此,從分配給 Smith 2020 的編號 [4] 開始,一直到分配給 Smith 2017 的編號 [1]。
這將立即顯示我今天的論文總數。
包文檔中沒有描述此類選項。但是,我想知道是否可以透過更改原始程式碼來輕鬆完成出版商包裹。
編輯 根據要求,我添加了 TeX 文件的源代碼。
\documentclass[11pt]{article}
\usepackage[bibstyle=publist,marginyear=true]{biblatex}
\omitname[John][]{Smith}
\plauthorname[John][]{Smyth}
\addbibresource{publist.bib}
\begin{document}
\title{List of publications}
\author{John Smith}
\date{\today}
\maketitle
\nocite{*}
\printbibliography[heading=none]
\end{document}
publist.bib 檔案:
@phdthesis{Smith:2017,
Author = {John Smith},
Publisher = {TheGruiter},
School = {Hogwarts school of magic},
Title = {Investigation on interesting topics},
Year = {2017}}
@book{Smith:2019b,
Address = {Blondon},
Author = {John Smith},
Pages = {23--45},
Publisher = {TheGruiter},
Title = {Funny book},
Year = {2019}}
@article{Smith:2019a,
Author = {John Smith},
Journal = {Journal of interesting papers},
Number = {1},
Pages = {23--45},
Title = {More or less interesting paper},
Volume = {18},
Year = {2019}}
@article{Smith:2020,
Author = {John Smith},
Journal = {Journal of interesting papers},
Number = {3},
Pages = {23--45},
Title = {Very interesting new paper},
Volume = {19},
Year = {2020}}
答案1
對於大多數意圖和目的,代碼來自biblatex:反向編號(即倒數)也應該在這裡工作。
由於biblatex
有自己的版本,\mkbibdesc
您只需更改\newrobustcmd
為\renewrobustcmd
.
請注意,如果您大量使用過濾和多個參考書目,則此代碼可能無法按預期工作(另請參閱答案中提到的警告biblatex:反向編號(即倒數))。
\documentclass[11pt]{article}
\usepackage[bibstyle=publist,marginyear=true]{biblatex}
\omitname[John][]{Smith}
\plauthorname[John][]{Smyth}
% Count total number of entries in each refsection
\AtDataInput{%
\csnumgdef{entrycount:\therefsection}{%
\csuse{entrycount:\therefsection}+1}}
% Print the labelnumber as the total number of entries in the
% current refsection, minus the actual labelnumber, plus one
\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}
\renewrobustcmd*{\mkbibdesc}[1]{%
\number\numexpr\csuse{entrycount:\therefsection}+1-#1\relax}
\begin{filecontents}{\jobname.bib}
@phdthesis{Smith:2017,
Author = {John Smith},
Publisher = {TheGruiter},
School = {Hogwarts school of magic},
Title = {Investigation on interesting topics},
Year = {2017}}
@book{Smith:2019b,
Address = {Blondon},
Author = {John Smith},
Pages = {23--45},
Publisher = {TheGruiter},
Title = {Funny book},
Year = {2019}}
@article{Smith:2019a,
Author = {John Smith},
Journal = {Journal of interesting papers},
Number = {1},
Pages = {23--45},
Title = {More or less interesting paper},
Volume = {18},
Year = {2019}}
@article{Smith:2020,
Author = {John Smith},
Journal = {Journal of interesting papers},
Number = {3},
Pages = {23--45},
Title = {Very interesting new paper},
Volume = {19},
Year = {2020}}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\title{List of publications}
\author{John Smith}
\date{\today}
\maketitle
\nocite{*}
\printbibliography[heading=none]
\end{document}
由於這似乎是出版物清單中的一個流行功能,您可能需要直接向開發人員建議https://github.com/jspitz/biblatex-publist/issues。