为什么这个逆时针 BibTeX 列表中的编号不正确?

为什么这个逆时针 BibTeX 列表中的编号不正确?

2014 年,我写了一份简历,其中引用了以下模板。

我的想法是从谷歌学术下载一份出版物列表“google.bib”,然后按年份和类别反向排序。然后当我需要再次申请工作时,唯一的步骤就是下载我的 google.bib。然而,旧模板似乎不能正常工作。我可以看到反向年份仍然有效,但计数器似乎不起作用。LateX 改变了吗,还是我错过了什么?我尝试了其他 bibtex 文件,效果相同。

\documentclass[12pt,titlepage]{article}

%%%%%%%%%%%%%%%%%%%%%% BIBLATEX CV STUFF   %
\usepackage[style=nature,
                      maxnames=200,
                      sorting=ydnt,
                      defernumbers=true,
                      backend=biber]{biblatex}%% BIBLATEX CV STUFF  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Script for separating publication types and labels.
\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}

% Initialize category counters
\def\bbx@initcategory#1{\csnumgdef{bbx@count@#1}{0}}
\forlistloop{\bbx@initcategory}{\blx@categories}

% Increment category counters
\def\bbx@countcategory#1{%
  \ifentrytype{#1}
    {\csnumgdef{bbx@count@#1}{\csuse{bbx@count@#1}+1}%
     \addtocategory{#1}{\thefield{entrykey}}%
     \listbreak}
    {}}
\AtDataInput{\forlistloop{\bbx@countcategory}{\blx@categories}}

%Modify \bibbycategory to set item total
\patchcmd{\blx@bibcategory}
  {\blx@key@heading{#1}}
  {\blx@key@heading{#1}%
   \csnumdef{blx@labelnumber@\the\c@refsection}{0}%
   \csnumgdef{bbx@itemtotal}{\csuse{bbx@count@#1}}}
  {}{}
\makeatother

\DeclareBibliographyCategory{article}
\DeclareBibliographyCategory{inproceedings}
%\DeclareBibliographyCategory{report}
%\DeclareBibliographyCategory{unpublished}
\DeclareBibliographyCategory{book}

\defbibheading{bibliography}{\subsection{SCHOLARSHIP}}
\defbibheading{article}{\subsubsection{Peer-Reviewed Journal Publications}}
\defbibheading{inproceedings}{\subsubsection{Peer-Reviewed Conference Proceedings}}
%\defbibheading{report}{\subsubsection{Technical Reports, Proposals \& Theses}}
%\defbibheading{unpublished}{\subsubsection{Invited Talks}}
\defbibheading{book}{\subsubsection{Books}}
%%%%%%%%%%%%%%%%%%%END% BIBLATEX CV STUFF   %

\title{McNamerson CV}
\author{Namey McNamerson}
\date{\today}

\addbibresource{google.bib}% my google scholar bib  

\begin{document}

\nocite{*}
\printbibheading\label{scholar}
The following represent my scholarly output over the timeframe from 1965--Present.

\bibbycategory

\end{document}

以下是 bib 文件示例 -

%%%https://services.math.duke.edu/computing/tex/templates/database.bib



@inproceedings{GMP81,
   author = "Mark Goresky and Robert MacPherson",
    title = "On the topology of complex algebraic maps",
booktitle = "Algebraic Geometry Proceedings, La R\'abida,
             Lecture Notes in Mathematics",
   number = 961,
     year = 1981}    

@inproceedings{Kwi97,
   author = "Micha{\l} Kwieci\'nski",
    title = "Mac{P}herson's graph construction",
booktitle = "Algebraic Geometry, 
             Lecture Notes in Pure and Applied Mathematics",
   editor = "Sinan Sert{\"o}z",
   volume = 193,
     year = 1987}

@inproceedings{MP81,
   author = "Robert MacPherson",
    title = "Singularities of vector bundle maps",
booktitle = "Proceedings of Liverpool Singularities, 
             Lecture Notes in Mathematics",
   number = 192,
     year = 1981} 

@inproceedings{Shi84,
   author = "Theodore Shifrin",
    title = "Curvature integrals and {C}hern classes of singular varieties",
booktitle = "Integral Geoemetry, Proceedings,
             Contemporary Mathematics",
   volume = 63,
     year = 1984}

@inproceedings{Sul81,
   author = "D. Sullivan",
    title = "Combinatorical invariants of analytic spaces",
booktitle = "Proceedings of Liverpool Singularities, 
             Lecture Notes in Mathematics",
   number = 192,
     year = 1981}


@article{TM83,
  author = "L\^e D{\~u}ng Trang and Zoghman Mebkhout",
   title = "Vari\'et\'es caract\'er\-istiques et vari\'et\'es polaires",
 journal = "C. R. Acad. Sc. Paris",
  volume = 296,
    year = 1983,
   pages = "129--132"}

@article{BMM94,
  author = "Jo{\"e}l Biran{\c c}on and Philippe Maisonobe and Michel Merle",
   title = "Localisation de syst\`emes diff\'erentiels, stratifications
            de {W}hitney et condition de {T}hom",
 journal = "Invent. Math.",
  volume = 117,
    year = 1994,
   pages = "531--550"}

@article{PP95,
  author = "Adam Parusi\'nski and Piotr Pragacz",
   title = "A formula for the {E}uler characteristic of singular hypersurfaces",
 journal = "J. Alg. Geom.",
  volume = 4,
    year = 1995,
   pages = "337-351"}

@article{Bry82,
  author = "Jean--Luc Brylinski",
   title = "({C}o)--{H}omologie d'intersection et faisceaux pervers",
 journal = "S\'eminaire Bourbaki",
  volume = 585,
    year = 1982,
   pages = "129--157"}

@article{Ken90x,
  author = "Gary Kennedy",
   title = "Specialization of {M}ac{P}herson's {C}hern classes",
 journal = "Math. Scand.",
  volume = 66,
    year = 1990,
   pages = "12--16"}

有人知道在哪里可以修复编号问题吗?我相信这个想法的起源是这个帖子:

biblatex:反向编号(即倒数)

答案1

内部发生了变化\blx@bibcategory,你修补了它(请参阅https://github.com/plk/biblatex/commit/b22f1578d64436de57858f9c05a3a13c3ca0e49chttps://github.com/plk/biblatex/commit/4ae3ccc43cf003a0fe61f83a22991d4905e9bdf9)。不幸的是,您用来修补宏的确切命令已更改,因此您的修补程序不再适用。新的修补命令需要如下所示

\patchcmd{\blx@bibcategory}
  {\blx@key@heading{\blx@theheading}{#1}}
  {\blx@key@heading{\blx@theheading}{#1}%
   \csnumdef{blx@labelnumber@\the\c@refsection}{0}%
   \csnumgdef{bbx@itemtotal}{\csuse{bbx@count@#1}}}
  {}
  {\blx@error
     {Failed to patch \string\blx@bibcategory}
     {Maybe its definition has changed}}

我已经内置了一条错误消息,以防补丁再次出现故障,这样以后就可以更轻松地诊断类似的问题。

\documentclass[12pt]{article}
\usepackage[style=nature,
            maxnames=200,
            sorting=ydnt,
            defernumbers=true,
            backend=biber]{biblatex}


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

\makeatletter

\newrobustcmd{\mkbibdesc}[1]{%
  \number\numexpr\csuse{bbx@itemtotal}+1-#1\relax}

\def\bbx@initcategory#1{\csnumgdef{bbx@count@#1}{0}}
\forlistloop{\bbx@initcategory}{\blx@categories}

\def\bbx@countcategory#1{%
  \ifentrytype{#1}
    {\csnumgdef{bbx@count@#1}{\csuse{bbx@count@#1}+1}%
     \addtocategory{#1}{\thefield{entrykey}}%
     \listbreak}
    {}}
\AtDataInput{\forlistloop{\bbx@countcategory}{\blx@categories}}

\patchcmd{\blx@bibcategory}
  {\blx@key@heading{\blx@theheading}{#1}}
  {\blx@key@heading{\blx@theheading}{#1}%
   \csnumdef{blx@labelnumber@\the\c@refsection}{0}%
   \csnumgdef{bbx@itemtotal}{\csuse{bbx@count@#1}}}
  {}
  {\blx@error
     {Failed to patch \string\blx@bibcategory}
     {Maybe its definition has changed}}
\makeatother

\DeclareBibliographyCategory{article}
\DeclareBibliographyCategory{inproceedings}
\DeclareBibliographyCategory{book}

\defbibheading{bibliography}{\subsection{SCHOLARSHIP}}
\defbibheading{article}{\subsubsection{Peer-Reviewed Journal Publications}}
\defbibheading{inproceedings}{\subsubsection{Peer-Reviewed Conference Proceedings}}
\defbibheading{book}{\subsubsection{Books}}


\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@inproceedings{GMP81,
   author = "Mark Goresky and Robert MacPherson",
    title = "On the topology of complex algebraic maps",
booktitle = "Algebraic Geometry Proceedings, La R\'abida,
             Lecture Notes in Mathematics",
   number = 961,
     year = 1981}    

@inproceedings{Kwi97,
   author = "Micha{\l} Kwieci\'nski",
    title = "Mac{P}herson's graph construction",
booktitle = "Algebraic Geometry, 
             Lecture Notes in Pure and Applied Mathematics",
   editor = "Sinan Sert{\"o}z",
   volume = 193,
     year = 1987}

@inproceedings{MP81,
   author = "Robert MacPherson",
    title = "Singularities of vector bundle maps",
booktitle = "Proceedings of Liverpool Singularities, 
             Lecture Notes in Mathematics",
   number = 192,
     year = 1981} 

@inproceedings{Shi84,
   author = "Theodore Shifrin",
    title = "Curvature integrals and {C}hern classes of singular varieties",
booktitle = "Integral Geoemetry, Proceedings,
             Contemporary Mathematics",
   volume = 63,
     year = 1984}

@inproceedings{Sul81,
   author = "D. Sullivan",
    title = "Combinatorical invariants of analytic spaces",
booktitle = "Proceedings of Liverpool Singularities, 
             Lecture Notes in Mathematics",
   number = 192,
     year = 1981}


@article{TM83,
  author = "L\^e D{\~u}ng Trang and Zoghman Mebkhout",
   title = "Vari\'et\'es caract\'er\-istiques et vari\'et\'es polaires",
 journal = "C. R. Acad. Sc. Paris",
  volume = 296,
    year = 1983,
   pages = "129--132"}

@article{BMM94,
  author = "Jo{\"e}l Biran{\c c}on and Philippe Maisonobe and Michel Merle",
   title = "Localisation de syst\`emes diff\'erentiels, stratifications
            de {W}hitney et condition de {T}hom",
 journal = "Invent. Math.",
  volume = 117,
    year = 1994,
   pages = "531--550"}

@article{PP95,
  author = "Adam Parusi\'nski and Piotr Pragacz",
   title = "A formula for the {E}uler characteristic of singular hypersurfaces",
 journal = "J. Alg. Geom.",
  volume = 4,
    year = 1995,
   pages = "337-351"}

@article{Bry82,
  author = "Jean-Luc Brylinski",
   title = "({C}o)--{H}omologie d'intersection et faisceaux pervers",
 journal = "S\'eminaire Bourbaki",
  volume = 585,
    year = 1982,
   pages = "129--157"}

@article{Ken90x,
  author = "Gary Kennedy",
   title = "Specialization of {M}ac{P}herson's {C}hern classes",
 journal = "Math. Scand.",
  volume = 66,
    year = 1990,
   pages = "12--16"}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\nocite{*}
\printbibheading\label{scholar}
The following represent my scholarly output over the timeframe from 1965--Present.

\bibbycategory

\end{document}

两张反向编号的号码布。

相关内容