moderncv 中出版物的反向枚举

moderncv 中出版物的反向枚举

我想使用相反的顺序枚举出版物,即假设我有 N 个出版物,底部的出版物将是最旧的,并且旁边会有数字 [1],而最新的出版物将位于顶部,旁边会有数字 [N]。

有人知道怎么做吗?这是我使用的代码:

\documentclass[11pt,a4paper,roman]{moderncv}
\moderncvstyle{banking}                             
\moderncvcolor{blue}                               


\renewcommand{\familydefault}{\rmdefault}         

\usepackage[utf8]{inputenc}                       

\usepackage[style=numeric,sorting=ydnt]{biblatex}
\addbibresource{publications.bib}

\usepackage[scale=0.75]{geometry}

\begin{document}
\makecvtitle

\nocite{*}
\printbibliography[title={Publications}]

\end{document}

谢谢。

答案1

这是一个稍微简单一点的方法这个答案

\documentclass[11pt,a4paper,roman]{moderncv}
\moderncvstyle{banking}                             
\moderncvcolor{blue}                               
\usepackage[utf8]{inputenc}                       
\usepackage[sorting=ydnt]{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage[scale=0.75]{geometry}
\name{Sa\"{i}d}{Maanan}
\title{CV}
\address{Department of Statistics}{University of Auckland}{Private Bag 92019, Auckland 1142, New Zealand}
\phone[mobile]{+64~(022)~1258~144}                   
\email{[email protected]}                                                    
\social[linkedin]{smaanan}                        
\social[github]{smaanan}                              

% Reverse numbering in publications list
\newcounter{entrycount}
\AtDataInput{\stepcounter{entrycount}}
\DeclareFieldFormat{labelnumber}{\mkrevbibnum{#1}}
\newcommand{\mkrevbibnum}[1]{\number\numexpr\value{entrycount}+1-#1}

\begin{document}
\makecvtitle
\nocite{sigfridsson,wilde,worman,geer,baez/article}
\printbibliography[title={Publications}]
\end{document}

在此处输入图片描述

答案2

我找到了答案这里

\documentclass[11pt,a4paper,roman]{moderncv}
\moderncvstyle{banking}                             
\moderncvcolor{blue}                               


\renewcommand{\familydefault}{\rmdefault}         

\usepackage[utf8]{inputenc}                       

\usepackage[style=numeric,sorting=ydnt]{biblatex}
\addbibresource{publications.bib}

\makeatletter
\newcounter{numbibentries}
\renewbibmacro*{finentry}{\stepcounter{numbibentries}\finentry}
\defbibenvironment{bibliography}
 {\list
  {\printtext[labelnumberwidth]{% 
    \printfield{prefixnumber}%
    \number\numexpr\getrefnumber{num-bib-entries}- \abx@field@labelnumber+1\relax}}
  {\setlength{\topsep}{0pt}% 
   \setlength{\labelwidth}{\hintscolumnwidth}%
   \setlength{\labelsep}{\separatorcolumnwidth}%
   \advance\leftmargin\labelsep
  }%
 }
 {\endlist}
 {\item}
\AtEndDocument{% Add reference at end of document to remember number of bib-entries.
\edef\@currentlabel{\thenumbibentries}\label{num-bib-entries}}
\makeatother

\usepackage[scale=0.75]{geometry}                           

\begin{document}
\makecvtitle

\nocite{*}
\printbibliography[title={Publications}]

\end{document}

相关内容