[Tex/LaTex] Group bibliography by year and show header as cventry in moderncv

bibliographiesbibtexmoderncv

My idea is to get the same output as in this previous post but with a different approach as the previous has some limitations.

So the goal is to have the first reference of each year in my bibliography showing the correspondent year on the left, as it was a normal cventry.

enter image description here

The problem is I have multiple bibliographies and I use multibib with \newcites so I can have different headings in each one of them (ex, "oral presentations", "poster presentations", etc). But because the previous approach removes the thebibliography environment I loss the heading information as well.

I know that I could just simply insert a new heading manually but I would prefer a different solution (more automatic lets say).

The previous post (one of the answers) suggested this code "If you want each year to appear only for the first paper of that year"

STRINGS {oldyear}

FUNCTION {year.or.none}
{ 's :=
    oldyear empty$
     { s 'oldyear := s }
     { s oldyear =
         { "" }
         { s 'oldyear := s }
       if$
     }
    if$
}

I was wondering if one could use the year.or.none function and biblabel together and display the year (or none) in the following code line:

\renewcommand\bibliographyitemlabel{\@biblabel{XXX}}


EDITED I

Here is a mock-up of what I want to achieve: enter image description here

Please let me know if you need the code I am using. Note that the years shown were added manually on Photoshop.


EDITED II

The .bst file I used can be found here. I have made some modifications to achieve the final style I wanted. Below is a link to the actual bibliography style in use (because there is a limitation to the number of characters that can be used in this post I could not paste it here).

https://www.dropbox.com/s/evvx9dr7qhpbz2h/simon_bonner_cv.bst

Best Answer

After playing with it a bit myself, I found two solutions:

  1. Use the previous post you mentioned with a bit more tweaking to match multibib.
  2. Use biblatex (I prefer this solution).

For the first solution, see answer to Sorted list of publications in moderncv from bibtex and plainyr-rev bibliography style (by Christian Plessl, see here). I used the combination of the two solutions as none of them worked by itself. Basically, I used the solution given in the answer, added the reverse sorting by year, and change one thing in the original answer - instead of leaving the FUNCTION {begin.bib} empty, use the following:

FUNCTION {begin.bib}
{ preamble$ empty$
    'skip$
    { preamble$ write$ newline$ }
  if$
  "\bibliographyhead{\refname}" write$ newline$
}

Now, you can use multibib normally, and you can remove the thebibliography environment defined in moderncv.cls.


The second solution is more elegant, and uses biblatex functionality. You can look at the answer given in Sorted list of publications in moderncv from bibtex to setup biblatex and moderncv, and use the answer in Multibib reverse label or sort order to understand how to use sectioned multi-bibliography with biblatex.

It simply works "out of the box". The only disadvantage I can think of is that this solution does not use the \cvitem environment provided by moderncv, but I don't think this is a real issue.