The possibility to add publications from several bib files

Asked by Andrey Sobolev on 2009-02-02

Dear Xavier,

Thank you for the moderncv package, it looks very good. But, while creating my CV with it I came across a problem. The problem is that I store my publications in several bib files (one for articles in peer-reviewed journals, one for conference proceedings etc.) I want these publications appear in the CV in section "Publications" under relevant subtitles. Unfortunately, there seems to be no easy way to do it. Every package that allows making several bibliographies in one document (I'm aware of bibtopic, multibib and biblatex) seems to be incompatible with moderncv.

So, is there some way to solve the problem? I'd be very grateful for any help.

Regards,
Andrey Sobolev

Question information

Language:
English Edit question
Status:
Solved
For:
moderncv Edit question
Assignee:
No assignee Edit question
Solved by:
Xavier Danaux
Solved:
2009-02-04
Last query:
2009-02-04
Last reply:
2009-02-03
Best Xavier Danaux (xdanaux) said : #1

Hi Andrey,

You are probably using an old version of moderncv, as the latest version (available on CTAN) is fully compatible with multibib.

Once you have the latest version, there is just one thing that may/need to be tweaked: ensuring the different "bibliographies" appear as subsections of a more general "Publications" section. Basically, you can just copy moderncv's definition of the environment, and replace the call to \section by a call to \subsection, i.e.
\makeatletter
\renewenvironment{thebibliography}[1]%
  {%
    \subsection{\refname}%
    \small%
    \begin{list}{\bibliographyitemlabel}%
      {%
        \setlength{\topsep}{0pt}%
        \setlength{\labelwidth}{\hintscolumnwidth}%
        \setlength{\labelsep}{\separatorcolumnwidth}%
        \leftmargin\labelwidth%
        \advance\leftmargin\labelsep%
        \@openbib@code%
        \usecounter{enumiv}%
        \let\p@enumiv\@empty%
        \renewcommand\theenumiv{\@arabic\c@enumiv}}%
        \sloppy\clubpenalty4000\widowpenalty4000%
  }%
  {%
    \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
    \end{list}%
  }
\makeatother

Once that is done in the header of your file (i.e. before \begin{document}), let's say you want to separate books from other publications. You then just need to tell moderncv to use multibib accordingly in the header of your resumé:
\usepackage{multibib}
\newcites{book,misc}{{Books},{Others}}

and add something like the next couple of lines in the main part of your .tex file
\section{Publications}
\nocitebook{book1,book2} % cite your books
\bibliographystylebook{plain}
\bibliographybook{publications} % 'publications' is the name of a BibTeX file
\nocitemisc{misc1,misc2,misc3} % cite other elements
\bibliographystylemisc{plain}
\bibliographymisc{publications} % 'publications' is the name of a BibTeX file

If you have any more question, don't hesitate to shout back.
Good luck!

Andrey Sobolev (inconnu) said : #2

Thank you very much for you help, now everything works as expected!

Xavier Danaux (xdanaux) said : #3

You're most welcome :-)

Andrew Corrigan (acorriga) said : #4

I tried just this, but I cannot reproduce template_multibib.pdf, instead I get a blank publications section (I uncommented the sections related to multibib from template.tex in the latest verion of moderncv). This occurred both in Ubuntu 10.04 (at home) and on a Mac (at work). I compiled with the usual sequence of pdflatex and bibtex, as well as using rubber -d. Is this feature still working? Could anyone share an example .tex that is working for them. Thanks!

Xavier Danaux (xdanaux) said : #5

Hi Andrew,

The template found on ctan is definitely working, and there is no need to manually add the lines of code from above since version 0.8 (usage of multibib is detected by the package and the bibliography is automatically modified).
However, the compilation sequence when using multibib is slightly different from usual as you have to call bibtex for every bibliography category you are using.

For example, in template_multibib.tex, 2 bibliographical catergories are defined: book and misc. The compilation sequence is therefore as follows:
(pdf)latex template_multibib.tex
bibtex book
bibtex misc
(pdf)latex template_multibib.tex
(pdf)latex template_multibib.tex

Kind regards,

Xavier

Andrew Corrigan (acorriga) said : #6

Thanks Xavier. I just needed to call bibtex as you described, and now it's working.