In my current work, I cannot seem to get the packages harvard and hyperref to work together properly.
A small example:
\documentclass[12pt,a4paper]{scrreprt}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{times}
\usepackage[hyphens]{url}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{listings}
\usepackage{fancyhdr}
\usepackage{cite}
\usepackage{harvard}
\citationmode{abbr}
\bibliographystyle{dcu}
\usepackage{setspace}
\onehalfspacing
\usepackage[pdfborder={0 0 0},pdftitle={the document title},pdfauthor={the author}]{hyperref}
\hypersetup{colorlinks=false}
\begin{document}
test
\end{document}
The error message I get is:
! LaTeX Error: Missing \begin{document}.
in the line right after \usepackage[...]{hyperref}.
As soon as I either remove the harvard package, the document compiles flawlessly. The same happens when I remove the hyperref package.
What bugs me: When I remove the options from \usepackage[...]{hyperref}, it also works.
Does anybody know what problem I am facing?
EDIT:
Sometimes, reading the error log in more detail helps. Seems, that missing \begin{document} was not the root cause, but rather the error further down in the log:
! LaTeX Error: Option clash for package hyperref.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.43
The package hyperref has already been loaded with options:
[pdftex]
There has now been an attempt to load it with options
[pdfborder={0 0 0},pdftitle={the document title},pdfauthor={the author}]
Adding the global options:
pdftex,pdfborder={0 0 0},pdftitle={the document title},pdfauthor={the author}
to your \documentclass declaration may fix this.
I have no idea why, but the package seems to be loaded automatically, when I use pdflatex to compile my document. I ended up using
\usepackage{hyperref}
\hypersetup{colorlinks=false}
\hypersetup{pdfborder={0 0 0}}
\hypersetup{pdftitle={\thetitle}}
\hypersetup{pdfauthor={\theauthor}}
EDIT 2
As per Marco Daniel's request:
*File List*
scrreprt.cls 2009/07/24 v3.04a KOMA-Script document class (report)
scrkbase.sty 2009/07/24 v3.04a KOMA-Script package (KOMA-Script-dependent ba
sics and keyval usage)
scrbase.sty 2009/07/24 v3.04a KOMA-Script package (KOMA-Script-independent
basics and keyval usage)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
scrlfile.sty 2009/03/25 v3.03 KOMA-Script package (loading files)
tocbasic.sty 2009/06/08 v3.03b KOMA-Script package (handling toc-files)
scrsize12pt.clo 2009/07/24 v3.04a KOMA-Script font size class option (12pt)
typearea.sty 2009/07/24 v3.04a KOMA-Script package (type area)
inputenc.sty 2008/03/30 v1.1d Input encoding file
utf8x.def 2004/10/17 UCS: Input encoding UTF-8
ucs.sty 2004/10/17 UCS: Unicode input support
uni-global.def 2004/10/17 UCS: Unicode global data
times.sty 2005/04/12 PSNFSS-v9.2a (SPQR)
url.sty 2006/04/12 ver 3.3 Verb mode for urls, etc.
xcolor.sty 2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
dvipsnam.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2009/08/28 v1.8 graphics configuration of TeX Live
rotating.sty 2009/03/28 v2.16a rotated objects in LaTeX
ifthen.sty 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
listings.sty 2007/02/22 1.4 (Carsten Heinz)
lstmisc.sty 2007/02/22 1.4 (Carsten Heinz)
listings.cfg 2007/02/22 1.4 listings configuration
fancyhdr.sty
cite.sty 2009/08/29 v 5.2
harvard.sty
html.sty 1999/07/19 v1.38 hypertext commands for latex2html (nd, hws, rr
m)
setspace.sty 2000/12/01 6.7 Contributed and Supported LaTeX2e package
hyperref.sty 2009/10/09 v6.79a Hypertext links for LaTeX
ifpdf.sty 2009/04/10 v2.0 Provides the ifpdf switch (HO)
ifvtex.sty 2008/11/04 v1.4 Switches for detecting VTeX and its modes (HO)
ifxetex.sty 2009/01/23 v0.5 Provides ifxetex conditional
hycolor.sty 2009/10/02 v1.5 Code for color options of hyperref/bookmark (HO
)
xcolor-patch.sty 2009/10/02 xcolor patch
pd1enc.def 2009/10/09 v6.79a Hyperref: PDFDocEncoding definition (HO)
etexcmds.sty 2007/12/12 v1.2 Prefix for e-TeX command names (HO)
infwarerr.sty 2007/09/09 v1.2 Providing info/warning/message (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
kvoptions.sty 2009/08/13 v3.4 Keyval support for LaTeX options (HO)
kvsetkeys.sty 2009/07/30 v1.5 Key value parser with default handler support
(HO)
bitset.sty 2007/09/28 v1.0 Data type bit set (HO)
intcalc.sty 2007/09/27 v1.1 Expandable integer calculations (HO)
bigintcalc.sty 2007/11/11 v1.1 Expandable big integer calculations (HO)
pdftexcmds.sty 2009/09/23 v0.6 LuaTeX support for pdfTeX utility functions (
HO)
ifluatex.sty 2009/04/17 v1.2 Provides the ifluatex switch (HO)
ltxcmds.sty 2009/08/05 v1.0 Some LaTeX kernel commands for general use (HO)
atbegshi.sty 2008/07/31 v1.9 At begin shipout hook (HO)
hdvips.def 2009/10/09 v6.79a Hyperref driver for dvips
pdfmark.def 2009/10/09 v6.79a Hyperref definitions for pdfmark specials
ot1ptm.fd 2001/06/04 font definitions for OT1/ptm.
ucsencs.def 2003/11/29 Fixes to fontencodings LGR, T3
nameref.sty 2007/05/29 v2.31 Cross-referencing by name of section
refcount.sty 2008/08/11 v3.1 Data extraction from references (HO)
minimalbeispiel.out
minimalbeispiel.out
html.stythat harvard loads. – egreg Nov 09 '11 at 21:22harvardto load thehtmlpackage that was giving me grief a couple of years ago. I ended up switching to thenatbibandhar2natpackages and haven't experienced those difficulties since. :-) See my answer for more details. – Mico Nov 09 '11 at 21:55