3

I use the following packages in my document:

\documentclass[a4paper,12pt,twoside,BCOR=10mm]{scrbook}
% Packages
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[icelandic, english]{babel}
\usepackage{t1enc}
\usepackage{graphicx}
\usepackage[intoc]{nomencl}
\usepackage{enumerate,color}
\usepackage{url}
\usepackage[pdfborder={0 0 0}]{hyperref}
\usepackage{appendix}
\usepackage{eso-pic}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[nottoc]{tocbibind}
\usepackage[sort&compress,authoryear]{natbib}
\usepackage[sf,normalsize]{subfigure}
\usepackage[format=plain,labelformat=simple,labelsep=colon]{caption}
\usepackage{placeins}
\usepackage{tabularx}
% Configurations
\graphicspath{{figs/}}

When I add

\usepackage{apacite}

I get a bunch of errors, starting with:

! Undefined control sequence.
l.1203 \st@rtbibchapter

Note that apacite should be correctly included in my system as I use it without problems on another document.

Do you have any idea where is the problem?

Niccolò
  • 187
  • 3
    As discussed at length in the apacite manual, don't load natbib separately, instead use apacite with the natbibapa option like so: \usepackage[natbibapa]{apacite}. – Paul Gessler Aug 22 '14 at 18:32
  • 2
    likewise, as has been in the uk faq since 1994, don't use t1enc -- it's long been replaced by fontenc: see the faq answer on t1enc – wasteofspace Aug 22 '14 at 19:06
  • The use of both suggestions made the doc compile. Thanks a lot @PaulGessler and wasteofspace. I'm actually using an official template from my university, I had no idea of the purpose of those packages and recommendations. You saved me a lot of latex-research. I'd be glad to upvote/accept your answers if you provide one. – Niccolò Aug 22 '14 at 20:37
  • @wasteofspace see up, cannot tag multiple users in one comment. – Niccolò Aug 22 '14 at 20:37

1 Answers1

2

From the apacite package documentation:

When you want to use natbib for citation and apacite for the reference list, you still need to load the LaTeX package apacite.sty (with \usepackage), because of the commands that are included in the BibTeX output. The best interoperability is obtained by loading apacite with the natbibapa option. There is then no need to load natbib explicitly, because apacite already does this.

So you should replace

\usepackage[sort&compress,authoryear]{natbib}
\usepackage{apacite}

with

\usepackage[natbibapa]{apacite}

From the t1enc package page on CTAN:

Ob­so­lete pack­age for ac­ti­vat­ing T1 font en­cod­ing. The re­place­ment fontenc pack­age with (op­tional) ar­gu­ment T1 does this task more sat­is­fac­to­rily.

So you should replace

\usepackage{t1enc}

with

\usepackage[T1]{fontenc}

Other notes on your omnibus preamble:

  1. I don't use utf8 encoding in my source files often enough to provide a definitive answer on this point, but you may want to consider utf8x vs. utf8 (inputenc) for a discussion of the relative merits of utf8x/ucs and inputenc.
  2. subfigure is deprecated; use subfig or subcaption instead.
  3. koma-script (of which your class, scrbook, is a part) implements nearly all functionality from the caption package, so you should consider using the built-in class options instead of using caption.
  4. hyperref should be loaded last, with only a few exceptions.

Here's the complete code:

\documentclass[a4paper,12pt,twoside,BCOR=10mm]{scrbook}
% Packages
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[icelandic, english]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[intoc]{nomencl}
\usepackage{enumerate,color}
\usepackage{url}
\usepackage{appendix}
\usepackage{eso-pic}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[nottoc]{tocbibind}
%\usepackage[sort&compress,authoryear]{natbib}
\usepackage[natbibapa]{apacite} % use `natbibapa' option instead of `natbib` package
%\usepackage[sf,normalsize]{subfigure} % deprecated; use other means
%\usepackage[format=plain,labelformat=simple,labelsep=colon]{caption} % use class commands instead
\usepackage{placeins}
\usepackage{tabularx}

\usepackage[pdfborder={0 0 0}]{hyperref} % moved to end of packages

\begin{document}
Test
\end{document}
Paul Gessler
  • 29,607