2

Reviewing other posts related with APA citation style and parenthetical citation, and packages related with citation style in general, I made a mess, installing too many lines in the code, with natbib, abbrvnat and apacite. Fortunately, I set the code in latex with the functionality of parenthetical citation, which is working correctly, but not with the APA referencing style.

This structure works fine for parenthetical citation:

\begin{document}
 \citep{author}
\end{document}

The thesis.tex document is structured like this:

\documentclass{DissertateB5}
\captionsetup{labelfont=\rmdefault, textfont=\rmdefault }

\begin{document}

% incluude each chapter...
\include{chapters/chapter1}

\singlespacing

% the back matter
\clearpage
\bibliography{mendeley}
\addcontentsline{toc}{chapter}{Bibliografía}
\bibliographystyle{apacite}

\end{document}

The dissertateb5.cls file:

(...)
%Import the natbib package and sets a bibliography  and citation styles
\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={(},close={)}}

(...)

%   list an entire bibliography entry inline. Useful for acknowledging when my paper was previously published

\RequirePackage{bibentry} 
    \nobibliography*  

(...)

Results in the bibliographyare:

Author. Title, Year...

But should be like APA style:

AUTHOR (year). Title...

In this document you can edit the code to try to solve this problem.

https://es.sharelatex.com/project/5847e1b0e473d1cf1e4aee56

enter image description here

6
  • i think that you should include \bibliography{mendeley} \addcontentsline{toc}{chapter}{Bibliografía} \bibliographystyle{apacite} commands in your preamble (e.g. before \begin{document})and not in your main document
    – Yorgos
    Dec 7, 2016 at 12:33
  • i did what you mentioned but not working... Dec 7, 2016 at 17:00
  • 1
    @Yorgos Only the \bibliographystyle{} should be in the preamble. \bibliography{} must appear in the document!
    – Jan
    Dec 8, 2016 at 7:51
  • @JuanLinares I am not used to sharelatex in spanish ... neither did I use apacite style. Could you please insert a MWE (MINIMAL working example) to produce the error?
    – Jan
    Dec 8, 2016 at 7:53
  • 1
    A minor point: In case your bibliography spans more than 1 page, the instruction \addcontentsline{toc}{chapter}{Bibliografía} should before, not after, \bibliography{mendeley}.
    – Mico
    Dec 8, 2016 at 8:55

1 Answer 1

5

Your document class currently loads the natbib citation package and specifies abbrvnat as the bibliography style. Once one \bibliographystyle directive is issued, all later ones are ignored. This happens because LaTeX writes information related to the bibliography style(s) to the aux file; BibTeX then scans the aux file for the applicable style, and it stops scanning once it hits the first such directive.

You should comment out the document class directives

\usepackage{natbib}
\bibliographystyle{abbrvnat}
\setcitestyle{authoryear,open={(},close={)}}

and issue the following instructions in the preamble of your document:

\usepackage[natbibapa]{apacite}
\bibliographystyle{apacite}

Be sure to delete all aux files and to fully recompile your document (latex, bibtex, and latex twice more) to propagate all changes properly.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .