3

I try to use bib file to do my reference in latex, it was fine for a test document I did, the test document is shown as following

\documentclass[12pt]{article}

\usepackage{apacite}

\usepackage{natbib}

\begin{document}

\title{Investigations of parametric similar waves}

\date{\today}

\maketitle

Blah blah blah blah \citet{Turner2009}

\bibliography{MyCollection}

\bibliographystyle{apacite}


\end{document}

However, when I tried to implement it in another report, it does not work. The following are all the packages I used in my report. I suspect the problem is caused by one of package i used to do plots, but i am not sure how to fix it, anyone has any suggestions?

\documentclass[12pt]{article}
\usepackage{apacite}
\usepackage{natbib}

\usepackage[margin=0.85in, paperwidth=8.5in, paperheight=11in ]{geometry}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{subcaption}
\newsavebox{\largestimage}
\usepackage{tocloft}
\newlength{\mylen}

\renewcommand{\cftfigpresnum}{\figurename\enspace}
\renewcommand{\cftfigaftersnum}{:}
\settowidth{\mylen}{\cftfigpresnum\cftfigaftersnum}
\addtolength{\cftfignumwidth}{\mylen}

\renewcommand{\cfttabpresnum}{\tablename\enspace}
\renewcommand{\cfttabaftersnum}{:}
\settowidth{\mylen}{\cfttabpresnum\cfttabaftersnum}
\addtolength{\cfttabnumwidth}{\mylen}

\usepackage{verbatim}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{pdflscape}
\usepackage{soul}
\usepackage{color}
\usepackage{url}

\renewcommand{\baselinestretch}{1.5}
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\numberwithin{table}{section}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[backref=true,backend=biber,natbib=true,hyperref=true]{biblatex}
\bibliography{refs}
\usepackage{float}
\usepackage{hyperref}
\hypersetup{
     colorlinks   = true,
     citecolor    = gray
}
\begin{document}

\title{Investigations of parametric similar waves}

\date{\today}

\maketitle

Blah blah blah blah \citet{Turner2009}




 \bibliography{MyCollection.bib}
 \bibliographystyle{apacite}
 \end{document}
Mico
  • 506,678

1 Answers1

1

Some comments about the first document: You may claim that "it was fine for a test document I did". However, this can't be the case except maybe for an extremely limited test document. Specifically, you should never load both the apacite package and the natbib package. In fact, since you're specifying apacite as the bibliography style, you should definitely not load the natbib package. If you prefer using natbib's citation commands \citet and \citep, you should load the apacite package as follows:

\usepackage[natbibapa]{apacite}

The second document suffers from an even bigger problem: Not only do you again load both apacite and natbib, you then load biblatex as well. The three packages are mutually incompatible. Another major problem is that the document features not one but two [!] \bibliography statements. No wonder things went haywire. Your conjecture, "I suspect the problem is caused by one of package i used to do plots", does not appear to be supported by the facts on the ground.

If you've had otherwise good experiences with the apacite citation management package and the apacite bibliography style, you should definitely not be loading either the biblatex or the natbib package.

Your second document suffers from some additional problems. For instance, I can think of no valid reason whatsoever for loading the latexsym package in a LaTeX2e document, the more so since you're also loading the amssymb package. There can also be no justification for loading the color package if you're going to override all of its capabilities by subsequently loading the xcolor package.

Mico
  • 506,678