Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
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 '13 at 1:33
    
Some feedback would be kind –  Marco Daniel Mar 6 '13 at 19:40

2 Answers 2

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,
   note = "This is a full ARTICLE entry",
}
@BOOK{book-full,
   author = "Donald E. Knuth",
   title = "Seminumerical Algorithms",
   volume = 2,
   series = "The Art of Computer Programming",
   publisher = "Addison-Wesley",
   address = "Reading, Massachusetts",
   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}                  
\address{street and number}{postcode city}{country}
\mobile{+1~(234)~567~890}                          
\phone{+2~(345)~678~901}                           
\fax{+3~(456)~789~012}                         
\email{john@doe.org}                           
\homepage{www.johndoe.com}                     
\extrainfo{additional information}    
\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}

enter image description here

share|improve this answer
    
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 '13 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 '13 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 '13 at 9:35
    
When I use this, for some reason, it shows me only the item numbers but not the years as shown here. Is there a reason why this might be happening? Thanks! –  Legend Aug 10 '13 at 23:44

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.

share|improve this answer
    
Do you know how to use the \cvitem environment provided by moderncv when using biblatex? –  Legend Aug 11 '13 at 22:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.