使用 publist 进行反向编号

使用 publist 进行反向编号

我使用名为“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

相关内容