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.

The code below shows a .bib file generated with KBibTex which is meant to be a general database for some articles to be written from now on.

@comment{x-kbibtex-personnameformatting=<%l><, %f>}

@book{leh,
author = "Cox, Michael M. and Nelson, David L.",
edition = "5",
publisher = "Omega",
title = "{Lehninger: Principles of Biochemistry}",
year = "2007"
}

@book{lev1,
author = "Levine, Ira N.",
edition = "5",
publisher = "McGraw Hill",
title = "{F{\'i}sicoqu{\'i}mica}",
volume = "1",
year = "2004"
}

@book{lev2,
author = "Levine, Ira N.",
edition = "5",
publisher = "McGraw Hill",
title = "{F{\'i}sicoqu{\'i}mica}",
volume = "2",
year = "2004"
}

@book{reg,
author = "Gonz{\'a}lez, J. R. Regueiro and Lamesa, C. L{\'o}pez and Rodr{\'i}guez, S. Gonz{\'a}lez and Naves, E. Mart{\'i}nez",
booktitle = "{Biolog{\'i}a y patolog{\'i}a del sistema inmune}",
edition = "4",
publisher = "Panamericana",
title = "{Inmunolog{\'i}a}",
year = "2010"
}

I am well able to use it with some styles such as plain, vancouver, ieeetr, etc. However, when using some others, specially chicago and harvard based, I obtain error messages.

For example: when using dcu (harvard based) I get:

! Undefined control sequence. l.3 \harvarditem {Cox \harvardand\ Nelson}{2007}{leh} ?

As that sequence is not written on the .bib, it must be, odd enough, generated by bibtex into .bbl.

Any idea how to fix this? Do I need to edit the .bbl? How to?

Thanks in advance to all of you.

P.S.: might be useful to notice I am using the article template provided by texworks with babel for spanish.

EDIT Oct 9 2013

Here's a MWE:

\documentclass[12pt]{article} 
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc} 

\begin{document}

\nocite{*}

\bibliography{Docs/latex/books.bib}
\bibliographystyle{dcu}
\end{document}

where books.bib is the code I post before.

However, when making the MWE I found that compiling has some sort of influence in the error. I. e.: I was able to run it properly only once right after erasing the useless parts of the document but never after, even though, I 've tried deleting all the auxiliar files. I am even more puzzled than before.

Hope this helps.

share|improve this question
    
Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Marco Daniel Oct 6 '13 at 9:04
    
You're missing \usepackage{harvard}. Don't add the .bib extension in the argument to \bibliography. –  egreg Oct 9 '13 at 19:59
    
@egreg well, the solution was as simple as that. However, .bib extension did no harm to the path. Post an answer and I'll mark it right as soon as possible. –  jasikevicius23 Oct 11 '13 at 15:46

2 Answers 2

up vote 5 down vote accepted

The dcu bibliography style cannot be used “alone”, but it must be supplemented by the call to the harvard package:

\documentclass[12pt]{article} 
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc} 
\usepackage{harvard}

\begin{document}

\nocite{*}

\bibliography{Docs/latex/books.bib}
\bibliographystyle{dcu}
\end{document}

You may be willing to look at the natbib package that also features “Harvard style” citations.

share|improve this answer

In addition to considering the harvard citation management package, as already suggested by @egreg in his answer, you may want to look into using the har2nat and natbib packages. As the package's name suggests, the har2nat package "translates" the commands provided by the harvard package (and used by the bibliography styles that come with the harvard package, such as dcu) into commands understood by the natbib package.

Will you see a big difference in performance between the harvard and natbib/har2nat options. Not really, unless you also use the hyperref package. The hyperref manual has the following to say about its compatibility with citation management packages:

Package hyperref aims to cooperate with other packages, but there are several possible sources for conflict, such as [p]ackages that manipulate the bibliographic mechanism. Peter Williams' harvard package is supported. However, the recommended package is Patrick Daly's natbib package that has specific hyperref hooks to allow reliable interaction. This package covers a very wide variety of layouts and citation styles, all of which work with hyperref.

In short, even though the harvard package is "supported", interoperability and compatibility are most pronounced with the natbib package. It was precisely a need to be able to use hyperref that led me, several years ago by now, to switch from the harvard package to the natbib package (and the har2nat package if I was using a harvard-based style file such as dcu).

share|improve this answer
1  
@jasikevicius23 - that should work. (I can't be entirely sure, of course, since I don't have your .bib file...) Do make sure to use the citation commands provided by the natbib package, such as \citet, \citep, and \citeauthor. When the natbib package is used, the basic-LaTeX \cite command works like \citet. –  Mico Oct 11 '13 at 21:14
    
worked perfectly for me using \cite. @mico You do have the .bib above, at the question, if you're willing to test it yourself. –  jasikevicius23 Oct 11 '13 at 21:28
    
@jasikevicius23 - I tried out @egreg's MWE on the bib items in your posting (with \nocite{*} replaced with the four individual \cite commands), loading either the harvard package or the combination of har2nat and natbib packages. Everything compiled under pdfLaTeX. If harvard is loaded, none of the four citations end up being turned into hyperlinks to the respective bib entries. With har2nat and natbib loaded, the hyperlinking worked flawlessly. –  Mico Oct 11 '13 at 21:53

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.