Biblatex 带标签的参考文献降序排列不起作用

Biblatex 带标签的参考文献降序排列不起作用

我刚刚下载了 TeX Live 2016,它破坏了我的简历,简历上有我按类型划分的出版物(单个 .bib 文件)。它以前会打印

Refereed Conference Publications
[C1]

Miscellaneous
[M5]
[M4]
[M3]
[M2]
[M1]

然而在更新之后,数字变得乱七八糟。比如

Refereed Conference Publications
[C3]

Miscellaneous
[M13]
[M12]
[M11]
[M10]
[M9]

我在网上查看后发现他们改变了\printbibliography工作方式。现在,我们不允许将prefixnumber作为选项。

在浏览这个网站后,我发现了这个问题和答案。现在对我来说这有效,但我无法打印标签,即

Refereed Conference Publications
[1]

Miscellaneous
[5]
[4]
[3]
[2]
[1]

有没有办法让它与标签一起工作?

谢谢!

编辑1:这是 MWE

%% pdflatex MWE
%% biber MWE
%% pdflatex MWE
%% pdflatex MWE
\documentclass[11pt,letterpaper,roman]{moderncv}       

\moderncvstyle{classic}
\moderncvcolor{blue} 
\renewcommand{\rmdefault}{ppl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[scale=0.8]{geometry}
\setlength{\hintscolumnwidth}{2.5cm}

\name{Miguel}{Velez}

\usepackage[defernumbers=true,sorting=none,backend=biber,style=numeric]{biblatex}

\AtDataInput{%
  \csnumgdef{entrycount:\therefsection:\thefield{entrytype}}{%
    \csuse{entrycount:\therefsection:\thefield{entrytype}}+1}}

\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}    
\newrobustcmd*{\mkbibdesc}[1]{%
  \number\numexpr\csuse{entrycount:\therefsection:\thefield{entrytype}}+1-#1\relax}

\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{% label format from numeric.bbx
        \printfield{labelprefix}%
        \printfield{labelnumber}}}
     {\setlength{\topsep}{0pt}% layout parameters from moderncvstyleclassic.sty
      \setlength{\labelwidth}{\hintscolumnwidth}%
      \setlength{\labelsep}{\separatorcolumnwidth}%
      \leftmargin\labelwidth%
      \advance\leftmargin\labelsep}%
      \sloppy\clubpenalty4000\widowpenalty4000}
  {\endlist}
  {\item}  

\addbibresource{bibliography.bib}  

\begin{document}
\makecvtitle

\section{Publications}
%\newrefcontext[labelprefix=C]
\nocite{WLS:ICSE76}%,VS:IUST16,VS:CCSC15,VS:MSRP15,V:SUMMA15,VGS:IUST14}
\printbibliography[heading=subbibliography,title={Refereed Conference     Publications},type=inproceedings,resetnumbers=true]
%\newrefcontext[labelprefix=M]
\nocite{VS:IUST16,VS:CCSC15,VS:MSRP15,V:SUMMA15,VGS:IUST14}
\printbibliography[heading=subbibliography,title={Miscellaneous},
type=misc,resetnumbers=true]

\end{document}

编辑2:这是 MWE 中使用的 .bib 文件

 @inproceedings{WLS:ICSE76,
 author = {Wulf, Wm. A. and London, Ralph L. and Shaw, Mary},
 title = {An Introduction to the Construction and Verification of Alphard Programs},
 booktitle = {Proceedings of the 2Nd International Conference on Software Engineering},
 series = {ICSE '76},
 year = {1976},
 location = {San Francisco, California, USA},
 pages = {390--},
 url = {http://dl.acm.org/citation.cfm?id=800253.807708},
 acmid = {807708},
 publisher = {IEEE Computer Society Press},
 address = IEEEAddr,
}

@misc{VS:IUST16,
 author = {Velez, Miguel and Sawin, Jason},
 title = {Improving the Efficiency of CHA through Parallelization},
 howpublished = {Poster. Inquiry at St. Thomas},
 month = {May},
 year = {2016},
}

@misc{VS:CCSC15,
 author = {Velez, Miguel and Sawin, Jason},
 title = {Faster {WAH} Compression Querying through the Use of Metadata},
 howpublished = {Poster. Consortium for Computing Sciences in Colleges Midwest Region},
 year = {2015},
 note = {{1$^{st}$} place Discovery Track},
}

@misc{VS:MSRP15,
 author = {Velez, Miguel and Solar-Lezama, Armando},
 title = {Simpler Implementation of {Sketches} through Enhanced Expressiveness},
 howpublished = {Poster. MIT Summer Research Poster Session},
 year = {2015},
}

@misc{V:SUMMA15,
 author = {Velez, Miguel},
 title = {Current and Future Relationships Between Robots and Humans},
 howpublished = {Summa Cum Laude Paper},
 month = {April},
 year = {2015},
}

@misc{VGS:IUST14,
 author = {Velez, Miguel and Gittins, Peter and Sawin, Jason},
 title = {Extending {SMILES} to Encode Reaction Mechanisms},
 howpublished = {Poster. Inquiry at St. Thomas},
 month = {May},
 year = {2014},
}

答案1

如果您在序言中添加以下代码,这应该可以解决您的问题。然而,不可能正确引用这些条目。引用参考文献时会得到错误的负数。

\makeatletter
\patchcmd{\blx@printbibliography}
  {\blx@bibliography\blx@tempa}
  {\setcounter{bibitemtotal}{0}%
   \begingroup
   \def\do##1{\stepcounter{bibitemtotal}}%
   \dolistloop{\blx@tempa}%
   \endgroup
   \blx@bibliography\blx@tempa}{}{}
\makeatother

\newcounter{bibitemtotal}
\newrobustcmd*{\mkbibdesc}[1]{%
  \number\numexpr\value{bibitemtotal}+1-#1\relax}
\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}

\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{\printfield{labelprefix}\printfield{labelnumber}}}
     {}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

然后,您只需使用以下命令通过过滤器打印参考书目:

\newrefcontext[labelprefix=B]
\printbibliography[type=book,resetnumbers=true]

\newrefcontext[labelprefix=J]
\printbibliography[type=article,resetnumbers=true]

\newrefcontext[labelprefix=C]
\printbibliography[type=inproceedings,resetnumbers=true]

编辑1:

完整最小示例如下:

%% pdflatex MWE
%% biber MWE
%% pdflatex MWE
%% pdflatex MWE
\documentclass{article}

\usepackage[
    backend=biber, 
    style=numeric,
    giveninits=true,
    maxcitenames=99,
    maxbibnames=99,
    sorting=ydnt,
    defernumbers=true,
    isbn=false,
]{biblatex}
\addbibresource{bibliography.bib}


\makeatletter
\patchcmd{\blx@printbibliography}
  {\blx@bibliography\blx@tempa}
  {\setcounter{bibitemtotal}{0}%
   \begingroup
   \def\do##1{\stepcounter{bibitemtotal}}%
   \dolistloop{\blx@tempa}%
   \endgroup
   \blx@bibliography\blx@tempa}{}{}
\makeatother

\newcounter{bibitemtotal}
\newrobustcmd*{\mkbibdesc}[1]{%
  \number\numexpr\value{bibitemtotal}+1-#1\relax}
\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}

\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{\printfield{labelprefix}\printfield{labelnumber}}}
     {}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}


\begin{document}

\cite{A01} \cite{B02} \cite{C03}

\nocite{*}

\newrefcontext[labelprefix=B]
\printbibliography[title={Books},type=book,resetnumbers=true]

\newrefcontext[labelprefix=J]
\printbibliography[title={Journals},type=article,resetnumbers=true]

\newrefcontext[labelprefix=C]
\printbibliography[title={Conferences},type=inproceedings,resetnumbers=true]

\end{document}

这里使用的.bib文件是:

@book{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}

@article{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
  journal = {Journal B},
  url = {tex.stackexchange.com},
}

@inproceedings{C03,
  author = {Cesar, C.},
  year = {2003},
  title = {Copter},
  booktitle = {Conference C},
}

@inproceedings{D04,
  author = {Diocleziano, D.},
  year = {2004},
  title = {De rerum naturae},
  booktitle = {Conference D},
}

@inproceedings{E04,
  author = {Eloise, E.},
  year = {2004},
  title = {Evidence},
  booktitle = {Conference E},
}

生成的pdf如下。 编译后得到的pdf。

相关内容