ModernCV 按年份和月份对出版物进行排序

ModernCV 按年份和月份对出版物进行排序

我在我的简历中采用了这个解决方案:

来自 bibtex 的 moderncv 出版物排序列表

并根据我的需要修改了 plainyr.bst。

但是,论文仅按年份和作者排序。但如果先按年份排序,然后按月份排序会更好。我正在使用用 JabRef 创建的全球 bib 数据库。

是否可以按年份和月份对 bib 文件中的条目进行排序?

这是我的示例文本:

\documentclass[11pt,a4paper,roman]{moderncv}
\moderncvstyle{casual} 
\moderncvcolor{black} 
\usepackage[utf8]{inputenc} 
\usepackage[scale=0.75]{geometry}

% personal data
\name{A}{B}
\title{C}                               
\address{D}{E}{F}
\phone[mobile]{G}
\phone[fixed]{H} 
\email{I} 
\homepage{J}

\begin{document}
\makecvtitle
\pagestyle{empty}

\section{Publications}

\nocite{december_15}
\nocite{june_15}
\nocite{january_15}
\nocite{may_14}

\bibliographystyle{moderncv}
\bibliography{main}

\clearpage
\end{document}

这是 bibtex 文件:

@InProceedings{june_15,
  Title                    = {Example Publication 2},
  Author                   = {A, B. and C, D.},
  Booktitle                = {Fancy Publication Example},
  Year                     = {2015},
  Month                    = {June},
}

@InProceedings{january_15,
  Title                    = {Example Publication 1},
  Author                   = {Z, Z. and Z, D.},
  Booktitle                = {Fancy Publication Example},
  Year                     = {2015},
  Month                    = {January},
}

@InProceedings{december_15,
  Title                    = {Example Publication 3},
  Author                   = {D, B. and C, D.},
  Booktitle                = {Fancy Publication Example},
  Year                     = {2015},
  Month                    = {December},
}

@InProceedings{may_14,
  Title                    = {Example Publication 1},
  Author                   = {U, B. and C, D.},
  Booktitle                = {Fancy Publication Example},
  Year                     = {2014},
  Month                    = {May},
}

这是我根据上述答案编写的 BST 文件。

moderncv.bst:hxxp://tmp.jung.ms/moderncv.bst

这是我得到的实际输出:

实际产量

它应该是这样的(经过 Photoshop 处理):

预期输出

答案1

实现此目的的一种方法是稍微改变预排序函数位于 bibTeX 样式文件中。这里我使用 keflavich 在下面答案中建议的基于月份的排序函数。

https://tex.stackexchange.com/a/33332/84764

代码:

FUNCTION {sort.format.month}
{ 't :=
  t #1 #3 substring$ "l" change.case$ "jan" =
    { "01"  }
    { t #1 #3 substring$ "l" change.case$ "feb" =
      { "02"  }
      { t #1 #3 substring$ "l" change.case$ "mar" =
        { "03"  }
        { t #1 #3 substring$ "l" change.case$ "apr" =
          { "04"  }
          { t #1 #3 substring$ "l" change.case$ "may" =
            { "05"  }
            { t #1 #3 substring$ "l" change.case$ "jun" =
              { "06"  }
              { t #1 #3 substring$ "l" change.case$ "jul" =
                { "07"  }
                { t #1 #3 substring$ "l" change.case$ "aug" =
                  { "08"  }
                  { t #1 #3 substring$ "l" change.case$ "sep" =
                    { "09"  }
                    { t #1 #3 substring$ "l" change.case$ "oct" =
                      { "10"  }
                      { t #1 #3 substring$ "l" change.case$ "nov" =
                        { "11"  }
                        { t #1 #3 substring$ "l" change.case$ "dec" =
                          { "12"  }
                          { "00"  } % No match
                        if$
                        }
                      if$
                      }
                    if$
                    }
                  if$
                  }
                if$
                }
              if$
              }
            if$
            }
          if$
          }
        if$
        }
      if$
      }
    if$
    }
  if$
}

FUNCTION {presort}
{ type$ "book" =
  type$ "inbook" =
  or
    'author.editor.sort
    { type$ "proceedings" =
        'editor.organization.sort
        { type$ "manual" =
            'author.organization.sort
            'year.sort
          if$
        }
      if$
    }
  if$
  "    "
  *
  month field.or.null
  sort.format.month
  *
  "    "
  *
  author field.or.null
  sort.format.names
  *
  "    "
  *
  title field.or.null
  sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
}

相关内容