# Group bibliography by year and show header as cventry in moderncv

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.

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:

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

-
 Can you please add a MWE to show us how you realized your bibliography in your CV? The style is important. I changed for my CV unsrtdin.bst to show the year (only first one) in the biblable and deleted the year in the following datas. So I'm able to use \bibitem to show literatur in my cv. Perhaps I can help you if you give me more information ... – Kurt Mar 3 at 1:33 Some feedback would be kind – Marco Daniel Mar 6 at 19:40

The package usebib will help you. Use the following code:

\makeatletter
\AtBeginDocument{%
\def\@lbibitem[#1]#2{\item[\usebibentry{#2}{year}]\if@filesw
{\let\protect\noexpand
\immediate
\write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
}
\makeatother


The labeled is replaced by the field year which is extracted by the package usebib.

Here a complete MWE:

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@ARTICLE{article-full,
author = {L[eslie] A. Aamport},
title = {The Gnats and Gnus Document Preparation System},
journal = {\mbox{G-Animal's} Journal},
year = 1986,
volume = 41,
number = 7,
pages = "73+",
month = jul,
}
@BOOK{book-full,
author = "Donald E. Knuth",
title = "Seminumerical Algorithms",
volume = 2,
series = "The Art of Computer Programming",
edition = "Second",
month = "10~" # jan,
year = 1981,
note = "This is a full BOOK entry",
}

\end{filecontents*}

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}

% personal data
% personal data
\firstname{John}
\familyname{Doe}
\title{Resumé title}
\mobile{+1~(234)~567~890}
\phone{+2~(345)~678~901}
\fax{+3~(456)~789~012}
\email{john@doe.org}
\homepage{www.johndoe.com}
\photo[64pt][0.4pt]{example-image-a} % change image name
\quote{Some quote}
%\photo[64pt][0.4pt]{example-image-a} % change image name
\quote{Some quote}

\bibliographystyle{unsrtdin}
\usepackage{usebib}
\bibinput{\jobname}%name of the bib file
\makeatletter
\AtBeginDocument{%
\def\@lbibitem[#1]#2{\item[\usebibentry{#2}{year}]\if@filesw
{\let\protect\noexpand
\immediate
\write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
}
\makeatother

\begin{document}
\nocite{*}
\bibliography{\jobname}
\end{document}


-
 Sorry for the late reply. I tried this solution as it is but it does not work as expected. I mean, if I use your MWE it does work but in my model it doesn't. That's why I was taking some time to reply because I wanted to figure out where the problem was. In my preamble I use three packages to setup the bibliography jabbrv (not in CTAN) and multibib and I don't use unsrtdin for bibliography style. – Katuyci Mar 6 at 23:48 it seems that the problem is with my bibliography style as it does not show anything on the left of each reference entry (even without this hack). – Katuyci Mar 8 at 0:03 @Katuyci: What's your style? Please add a full minimal example to your previous question or ask a new one which references to this question. – Marco Daniel Mar 8 at 9:35