4

I've been requested to change the bibliographic reference style of one of my papars to APA style, but when using the apacite command the document is not compiling. A MWE is shown below.

My problems are:

1) when using \usepackage{apacite} and \bibliographystyle{apacite} with a \citep reference, I obtain an error:

! "Argument of \citeauthoryear has an extra }."

2) If I change the reference style to \cite or \citeA, styles corresponding to apacite package, I obtain another error:

! Extra \endgroup.

3) When trying to use the option \usepackage[natbibapa]{apacite}, it doesn´t recognise the option

! LaTeX Error: Unknown option `natbibapa' for package `apacite'.

although the package apacite is actualized from 2013.

I would thank any help since I have a short due date to present it and after a long search for a similar problem in forums I couldn't find any working answer.

Thanks in advance

\documentclass[english]{elsarticle}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{array}
\usepackage{units}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{esint}
\usepackage{babel}
\usepackage{apacite}
%\usepackage[natbibapa]{apacite}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

\usepackage{endfloat}
\usepackage{array}

\makeatother

\begin{document}

\title{Title of my paper}

\author[rvt]{M.~Surname\corref{cor1}}
\ead{aaaaa@aaaa.com}
\author[focal]{A.B.~Doe}
\author[rvt]{C.D.~Smith}
\cortext[cor1]{Corresponding author}


\address[rvt]{Department of Physics, University of Aaaaa, Aaaaa St,
1234 City, Country }

\address[focal]{Institute of Technology, University of Bbbb,
Bbbb St, 4321 City, Country}

\begin{abstract}
The analysis of data from measurements is analyzed. 
\end{abstract}

\begin{keyword}
key1\sep key2\sep key3\sep key4\sep key5.
\end{keyword}

\maketitle

\section{Section 1 of my paper}

Lorem ipsum ad his scripta blandit partiendo, eum fastidii accumsan euripidis in, eum liber hendrerit an. Qui ut wisi vocibus suscipiantur, quo dicit ridens inciderint id. Quo mundi lobortis reformidans eu, legimus senserit definiebas an eos \citep{author99,author05}. Eu sit tincidunt incorrupte definitionem, vis mutat affert percipit cu, eirmod consectetuer signiferumque eu per. In usu latine equidem dolores. Quo no falli viris intellegam, ut fugit veritus placerat per.

Ius id vidit volumus mandamus, vide veritus democritum te nec, ei eos debet libris consulatu. No mei ferri graeco dicunt, ad cum veri accommodare. Sed at malis omnesque delicata, usu et iusto zzril meliore. 

\begin{equation}
A_{b}=\frac{B_{c}}{2\pi\mu}.\label{eq:Eq-classic}
\end{equation}

Dicunt maiorum eloquentiam cum cu, sit summo dolor essent te. Ne quodsi nusquam legendos has, ea dicit voluptua eloquentiam pro, ad sit quas qualisque. Eos vocibus deserunt quaestio ei.

\section*{References}

\bibliographystyle{apacite}
\bibliography{bibliotest}

\end{document}

And the bibliotest.bib file:

@article{author99,
title = {A fine title},
year = {1899},
volume = {40},
number = {12},
pages = {1052-1057},
author = {A.B. Cdefg and W. Z. John},
journal = {Madness}
}


@article{author05,
title = {The best title},
year = {1905},
volume = {40},
number = {12},
pages = {1052-1057},
author = {Doe, J. and Kirk, J.P.},
journal = {Insanity}
}
  • Welcome to TeX.SX! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Martin Schröder Jul 31 '14 at 23:11
  • 2
    Are you sure you should be using apacite along with elsarticle? – egreg Aug 1 '14 at 10:32
  • To get the apacite package to work alongside the elsarticle document class, I find it's necessary to load it before the \documentclass instruction is executed, via the statement \RequirePackage{apacite}. Even so, I get error messages about \thebibliography already being defined, etc. In short, echoing @egreg's comment, you may want to use a different bibliography and citation management package. natbib along with elsarticle-harv.bst, would be such a candidate. – Mico Aug 1 '14 at 13:47
5

I finally solved this problem using the apalike package.

As Mico commented, elsarticle has embebed the natbib package, which crashes somehow when using the apacite package. My solution was to add the option authoryear to the elsarticle documentclass:

\documentclass[english,authoryear]{elsarticle} 

and include the apalike package:

\usepackage{babel} 
\usepackage{apalike}

and in \bibliographystyle{apalike}.

In this way I could compile the document with the required reference style.

Thanks anyway to all and hope this helps someone in my situation ;)

Regards

| improve this answer | |
2

I struggled with this issue also. Unfortunately, the answers here didn't help me out. What worked for me was to replace the

%\RequirePackage[\@biboptions]{natbib}

line in elsarticle.cls (line 642) with

\RequirePackage[natbibapa]{apacite}

This makes the biboptionscommand nonfunctionally, though, and in general might not be a good solution, as it changes the elsarticle.cls itself (but this seems to be an unmaintained class file anyway; installed from CTAN gives me a version from 2009 ...)

| improve this answer | |
0

you can solve this problem (using elsarticle.cls along with APA bibliographic reference style) as follows:

\documentclass[preprint,authoryear,12pt]{elsarticle}
\usepackage{natbib}

\begin{document}
 bla bla bla \cite{author99}

\newpage

\bibliographystyle{dcu}
\bibliography{refs}

\end{document}

====================================

And the refs.bib file:

@article{author99,
title = {A fine title},
year = {1899},
volume = {40},
number = {12},
pages = {1052-1057},
author = {A.B. Cdefg and W. Z. John},
journal = {Madness}
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.