1

I am trying to create my cv using moderncv class. Everything look fine until the publication section. I have a publication database under the title "publications.bib" that is created in JabRef. I want to use import the publications included in this database in my cv. I tried to modify the plainyr.bst file like here Sorted list of publications in moderncv from bibtex but did not work, apparently it leaves the section empty. Here is a MWE:

\documentclass[11pt,a4paper]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{grey}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}

\end{filecontents}
\renewcommand{\familydefault}{\sfdefault}
\nopagenumbers{}

\usepackage[utf8]{inputenc}
\firstname{E}
\familyname{Xample}
\begin{document}

\section{Publications}
\nocite{*}
\bibliographystyle{moderncv}
\bibliography{\jobname}
\end{document}

Even when I don't use the .bib and work just like in the first answer of the above link, having:

\documentclass{moderncv}
\moderncvstyle{classic}  
\moderncvcolor{blue}       

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{A01,
  author = {Author, A.},
  journal = {Good Journal},
  year = {2001},
  title = {Alpha},
}

\end{filecontents}

\firstname{E}
\familyname{Xample}
\begin{document}

\section{Publications}
\nocite{*}
\bibliographystyle{plainyrrev}
\bibliography{\jobname}

\end{document}

In the pdf file, I get just printed the section "Publications" and nothing is included in that. However, a .bib file is created that has the entry of the article.

Any idea?

  • 1
    You're pulling in \jobname.bib, which is not the same as publications.bib. Why not just use \bibliography{publications}? Note that JabRef is just a manager of BibTeX items. You should still compile the .bib file using BibTeX or biber (if you're using biblatex. – Werner Feb 22 '14 at 17:28
  • When I put publications.bib I get a mispelling error. Everytime I compile it, it replaces the .bib file with an empty file. – user_3849 Feb 22 '14 at 17:33
  • I bibtex the file inside TexMaker. \bibliography{publications} compiles, but adds nothing to the cv – user_3849 Feb 22 '14 at 17:36
  • Drop the filecontents part of the setup, since you don't need that. – Werner Feb 22 '14 at 17:41
  • When I skip the filecontents part and still have the publication sections as in the MWE but with \bibliography{\publications} I get a mispelling error again ! Undefined control sequence. <write> \string \bibdata {\publications} l.102 \bibliography{\publications} – user_3849 Feb 22 '14 at 17:46
  • You would need \bibliography{publications}, not \bibliography{\publications}. – Werner Feb 22 '14 at 17:49
  • Right. It was a typo. Still with \bibliography{publications} nothing is added to the Publication section. – user_3849 Feb 22 '14 at 17:51
  • \bibliography{publications} tell TeX that you're using a bibliography named publications.bib. Compile your file.tex once (latex file), and then compile bibtex file, and then again latex file. – Werner Feb 22 '14 at 17:56
  • That's exactly what I do. Seems strange. I have done this many times before, outside moderncv class and it worked. Now if I just use bibliography{\publications} I get errors ! Undefined control sequence. <argument> \@firstname {}~\@lastname {} l.6 \begin{document} – user_3849 Feb 22 '14 at 18:06

1 Answers1

1

I found what the problem was. Everytime I change the .bib file, I have to change into the .aux file the line that defines the style \bibstyle{moderncv} to \bibstyle{plainyr}. Then I compile the .bib file and then I create the pdf. Everything works fine!