3

I am trying to use the apacite package for referencing however I am having some problems getting it to work.

I am using Ubuntu and the Tex Live distribution so I installed the texlive-bibtex-extra Ubuntu package which contains apacite.

I am using a bibtex file that works fine with natbib but for some reason does not work here. Jung2009 is one of my references.

Here is an example:

\documentclass[11pt,a4paper,oldfontcommands]{memoir}

\usepackage{apacite}

\begin{document}

example example example \cite{Jung2009}. 

\bibliographystyle{apacite}%{unsrt}
\bibliography{library}

\end{document}

I initially had problems with citing in captions but solved that by placing \protect in front of the \cite commands.

However I still get the following error when I try to compile

This is BibTeX, Version 0.99d (TeX Live 2013/Debian)
The top-level auxiliary file: apa_practice.aux
The style file: apacite.bst
Database file #1: library.bib
apacite.bst [2013/07/04 v6.02 APA bibliography style]
"" is a string literal, not a function, for entry Jung2009 while executing---line 5144 of file apacite.bst
(There was 1 error message)

EDIT: My .bib file is automatically generated from my reference manager Mendeley. Here is the input for Jung2009.

@article{Jung2009,
abstract = {...},
author = {Jung, Christian and M\"{u}ller, Andreas E},
doi = {10.1016/j.tplants.2009.07.005},
file = {:home/geff/Documents/Mendeley Files/Jung and Muller.pdf:pdf},
issn = {1878-4372},
journal = {Trends Plant Sci.},
keywords = {...},
month = oct,
number = {10},
pages = {563--73},
pmid = {19716745},
title = {{Flowering time control and applications in plant breeding.}},
url = {http://www.ncbi.nlm.nih.gov/pubmed/19716745},
volume = {14},
year = {2009}
}

EDIT2: by running apacite.ins in the folder with my .tex file I can get apacite to run and the above example works great. However now every citation in my real document causes an !Undefined Control Sequence Error. Even when I delete all other related files in the folder. Could it be other packages interfering? Here is my preamble, based off a template:

\documentclass[11pt,a4paper,oldfontcommands]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage[dvips]{graphicx}
\usepackage{xcolor}
\usepackage{times}
\usepackage{parskip}
\usepackage{wrapfig}
\usepackage{tcolorbox}
\usepackage{lipsum}
\usepackage{subfig}
\usepackage[format=hang]{caption}
%\usepackage{cite}
\usepackage{apacite}


\usepackage[
breaklinks=true,colorlinks=true,
linkcolor=black,urlcolor=black,citecolor=blue,
bookmarks=true,bookmarksopenlevel=2]{hyperref}

\usepackage{geometry}

\geometry{total={210mm,297mm},
left=20mm,right=20mm,
bindingoffset=10mm, top=25mm,bottom=25mm}

\OnehalfSpacing
%\linespread{1.3}

%%% CHAPTER'S STYLE
\chapterstyle{brotherton}
%%% STYLE OF SECTIONS, SUBSECTIONS, AND SUBSUBSECTIONS
\setsecheadstyle{\Large\bfseries\sffamily\raggedright}
\setsubsecheadstyle{\large\bfseries\sffamily\raggedright}
\setsubsubsecheadstyle{\bfseries\sffamily\raggedright}


%%% STYLE OF PAGES NUMBERING
\pagestyle{plain}
\makepagestyle{plain}
\makeevenfoot{plain}{\thepage}{}{}
\makeoddfoot{plain}{}{}{\thepage}
\makeevenhead{plain}{}{}{}
\makeoddhead{plain}{}{}{}


\maxsecnumdepth{subsection} 
\maxtocdepth{subsection}

Any help is greatly appreciated.

G_T
  • 465
  • kpsewhich apacite.bst returns /usr/share/texlive/texmf-dist/bibtex/bst/apacite/apacite.bst I am unfamiliar with \listfiles. How do I recognise it in the log as what I think it is is very long – G_T Mar 13 '14 at 22:17
  • 1
    I have 2013/07/21 v6.03 APA bibliography style in my .blg file: I see after a bit of a tweak of the question formatting that you have v6.02. Before pursuing anything else, I'd be tempted to try grabbing the latest version from CTAN and using that (in the same folder as the .tex file). BTW, is that the exact text of your .bib entry: I'm suspicious of the {...} parts. – Joseph Wright Mar 13 '14 at 22:21
  • I think this might be something quite basic or fundamental as now I try it with natbib I get a lot of !Undefined Control Sequence Errors – G_T Mar 13 '14 at 22:24
  • 1
    Did you delete the .bbl file before trying that? apacite includes various special bits and pieces in the auxiliary files: usually for testing it's best to remove all of these when making changes. – Joseph Wright Mar 13 '14 at 22:26
  • Ah, I did not know about the .bbl file. So I can still get a document using natbib. Also its not the exact text of my .bib text I edited out the long abstract and keywords sections. – G_T Mar 13 '14 at 22:29
  • I tried placing the v6.03 files in the folder with my .tex file but there was no change. It still seems like it is trying to use v6.02 – G_T Mar 13 '14 at 22:34
  • @G_T - Did you run the full update cycle -- latex, bibtex, and latex twice more -- after updating the .sty and .bst files? – Mico Mar 13 '14 at 22:41
  • @Mico Yes I am using the Texmaker editor and it is set to do Pdflatex -> bibtex -> Pdflatex -> Pdflatex – G_T Mar 13 '14 at 22:44
  • @G_T - Were you able to ascertain from the .log file whether you're using the 6.02 or the 6.03 files? – Mico Mar 13 '14 at 22:45
  • @Mico - yes, even when I copied the v6.03 into the folder with my .tex file the log still reads english.apc 2013/07/04 v6.02 apacite language file – G_T Mar 13 '14 at 22:54
  • What about copying v6.03 in your local TeXMF instead? – Bernard Mar 13 '14 at 23:53
  • Playing around I found I have to run the apacite.ins. Then apacite works. However now every citation in my document causes a !Undefined Control Sequence Error. Even when I delete all other related files in the folder. – G_T Mar 14 '14 at 00:20
  • Are there any news here? – Johannes_B Oct 05 '15 at 18:49

0 Answers0