0

Problem:

The first reference using apacite is being printed out correctly and subsequent are not.

The code in the PhDthesisSU.cls:

%-------------------------- identification ---------------------
%\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{Latex/Classes/PhDthesisSU}[2011/09/23 PhD thesis class]

%:-------------------------- book style -----------------------

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions\relax
\LoadClass[pdftex, a4paper]{book} 

%:-------------------------- packages for fancy things -----------------------
\usepackage{mathptmx} % Default font for dissertations is Times.
%\usepackage{fourier} % If mathematics don't display well using Times, then use Fourier.
\usepackage{enumitem}
\usepackage{tabularx,ragged2e,booktabs,caption,tabulary}
\usepackage[flushleft]{threeparttable}
%\usepackage{setspace}
\usepackage{geometry}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{atbegshi}
\usepackage{amsmath}
\usepackage{amsbsy}
\usepackage[pdftex]{graphicx} % for improved inclusion of graphics
\usepackage{epstopdf} % converts eps figures to pdf
\usepackage[margin=10pt,font=small,labelfont=bf]{caption} % for improved layout of figure captions with extra margin, smaller font than text
\usepackage{fancyhdr} % for better header layout
\usepackage{eucal}
\usepackage[polutonikogreek,english,swedish]{babel}
\usepackage[usenames, dvipsnames]{color}
\usepackage[perpage]{footmisc}
\usepackage{enumerate} % enumerated list for List of Papers
\usepackage{ifthen}
\usepackage{multicol} % for pages with multiple text columns, e.g. References
\setlength{\columnsep}{20pt} % space between columns; default 10pt quite narrow
\usepackage[nottoc]{tocbibind} % correct page numbers for bib in TOC, nottoc suppresses an entry for TOC itself
%\usepackage{nextpage}
\usepackage[T1]{fontenc}
\usepackage{calligra}

\usepackage[ pdftex, plainpages = false, pdfpagelabels, 
             pdfpagelayout = useoutlines,
             bookmarks,
             bookmarksopen = true,
             bookmarksnumbered = true,
             breaklinks = true,
             linktocpage,
             pagebackref = false,
             colorlinks = false,  % was true
             linkcolor = blue,
             urlcolor  = blue,
             citecolor = red,
             anchorcolor = green,
             hyperindex = true,
             hyperfigures
             ]{hyperref} 

The code in the MacroFile1:

% This file contains macros that can be called up from connected TeX files
% It helps to summarise repeated code, e.g. figure insertion (see below).

% insert a centered figure with caption and description
% parameters 1:filename, 2:title, 3:description and label
\newcommand{\figuremacro}[3]{
    \begin{figure}[htbp]
        \centering
        \includegraphics[width=1\textwidth]{#1}
        \caption[#2]{\textbf{#2} - #3}
        \label{#1}
    \end{figure}
}

% insert a centered figure with caption and description AND WIDTH
% parameters 1:filename, 2:title, 3:description and label, 4: textwidth
% textwidth 1 means as text, 0.5 means half the width of the text
\newcommand{\figuremacroW}[4]{
    \begin{figure}[htbp]
        \centering
        \includegraphics[width=#4\textwidth]{#1}
        \caption[#2]{\textbf{#2} - #3}
        \label{#1}
    \end{figure}
}

% inserts a figure with wrapped around text; only suitable for NARROW figs
% o is for outside on a double paged document; others: l, r, i(inside)
% text and figure will each be half of the document width
% note: long captions often crash with adjacent content; take care
% in general: above 2 macro produce more reliable layout
\newcommand{\figuremacroN}[3]{
    \begin{wrapfigure}{o}{0.5\textwidth}
        \centering
        \includegraphics[width=0.48\textwidth]{#1}
        \caption[#2]{{\small\textbf{#2} - #3}}
        \label{#1}
    \end{wrapfigure}
}

% predefined commands by Harish
\newcommand{\PdfPsText}[2]{
  \ifpdf
     #1
  \else
     #2
  \fi
}

\newcommand{\IncludeGraphicsH}[3]{
  \PdfPsText{\includegraphics[height=#2]{#1}}{\includegraphics[bb = #3, height=#2]{#1}}
}

\newcommand{\IncludeGraphicsW}[3]{
  \PdfPsText{\includegraphics[width=#2]{#1}}{\includegraphics[bb = #3, width=#2]{#1}}
}

\newcommand{\InsertFig}[3]{
  \begin{figure}[!htbp]
    \begin{center}
      \leavevmode
      #1
      \caption{#2}
      \label{#3}
    \end{center}
  \end{figure}
}

\newcommand\blankpage{%
    \null
    \thispagestyle{empty}%
    \addtocounter{page}{-1}%
    \newpage}

The code in thesis.tex:

%Default style using S5 paper
%\documentclass[twoside,11pt]{Latex/Classes/PhDthesisSU_A4}
%Use this instead if you need A4 paper.
\documentclass[twoside,11pt]{Latex/Classes/PhDthesisSU}

%: Macro file for Latex
% Macros help you summarize frequently repeated Latex commands.
% Here, they are placed in an external file /Latex/Macros/MacroFile1.tex
% An macro that you may use frequently is the figuremacro
\input{Latex/Macros/MacroFile1}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pdfpages}
\usepackage{afterpage}
\usepackage{emptypage}
\usepackage{apacite}

...

%: ----------------------- ´Bibliography ------------------------

% The section below defines how references are listed and formatted.

%\begin{multicols}{2} % \begin{multicols}{ # columns}[ header text][ space] %uncomment to have 2 columns
\begin{scriptsize} % tiny(5) < scriptsize(7) < footnotesize(8) < small (9)

%Default style file. Change according to you preferences.
\bibliographystyle{apacite}

% Changes the header from Bibliography to References
\renewcommand{\bibname}{References}

% File containing all references in BibTex format
\bibliography{thesisref} 

\end{scriptsize}

The code in introduction.tex:

Media have always been an essential element of democracy \cite{load05}. The Internet
as a medium has given individuals the opportunity to integrate, interact, network and
participate in wider communities for various democratic purposes \cite{nau12}. It has
been argued that “the widespread use of the Internet for social networking, blogging,
video-sharing and tweeting has an elective affinity with participatory democracy”
\cite{cast12, mast12}.

The BibTex code in thesisref.bib:

@book{load05,
   author = {Loader, B. D.},
   title = {The governance of cyberspace: Politics, technology and global restructuring},
   publisher = {Routledge},
   address = {New York},
   year = {2005},
   type = {Book}
}

@book{nau12,
   author = {Naughton, J.},
   title = {What you really need to know about the Internet: From Guttenberg to Zuckerberg},
   publisher = {Quercus},
   address = {London},
   year = {2012},
   type = {Book}
}

@book{cast12,
   author = {Castells, M. and Caraca, J. and Cardoso, G.},
   title = {Aftermath: The cultures of the economic crisis.},
   publisher = {Oxford University Press},
   address = {Oxford},
   year = {2012},
   type = {Book}
}

@book{mast12,
   author = {Mason, P.},
   title = {Why it's kicking off everywhere: The new global revolutions},
   publisher = {Verso},
   address = {London},
   year = {2012},
   type = {Book}
}

Output in text:

All references outputs correctly in text.

Output in the reference list (end of thesis):

  • Castells, M., Caraca, J. & Cardoso, G. (2012). Aftermath: The cultures of the economic crisis. [Book]. Oxford: Oxford University Press. 1
  • Loader, B. D. (2005). The governance of cyberspace: Politics, technology and global restructuring [Book]. New York: Routledge. 1
  • Mason, P. (2012). Why it’s kicking off everywhere: The new global revolutions [Book]. London: Verso. 1
  • Naughton, J. (2012). What you really need to know about the internet: From guttenberg to zuckerberg [Book]. London: Quercus. 1

Questions:

Why does apacite add the number 1 at the end of the first reference?

11
  • you have several questions without answer, they would have a better chance of being answered if you provided usable examples that reproduced the problem. – David Carlisle Feb 7 '15 at 12:42
  • \cite{governance} seems unlikely to have made the output you show of (?,?) (and the bibtex you show has no entry for governance) Please make a complete usable example that demonstrates the problem. – David Carlisle Feb 7 '15 at 12:44
  • @DavidCarlisle Managed to solve a problem related to the inclusion of references. It seems the issue was that I put \usepackage{apacite} before other packages in the .tex file. When I moved it below \usepackage{emptypage} it worked. Now the issue with the number 1 remains. – kexxcream Feb 7 '15 at 13:30
  • It seems another user had this issue as well (tex.stackexchange.com/questions/95934/…) the problem there was using the package \citeref to refer back to the page number where the reference was used. That package is, however, not used in my example. – kexxcream Feb 7 '15 at 13:34
  • 1
    @kexxcream if you expect someone to trace what is happening you could make a far more minimal example. Is it really necessary to have \usepackage[polutonikogreek,english,swedish]{babel} to show this (if it is necessary that is useful information about a clash with babel) if it isn't necessary remove it. In fact do you need the custom class at all, or can you demonstrate the issue using article the idea of a "Minimal Working Example" is that you remove everything that isn't needed. – David Carlisle Feb 7 '15 at 13:53
1

The first problem was getting APACite to work and the solution is:

% Use package for APA Cite
\usepackage{apacite}
% Default style file. Change according to you preferences.
\bibliographystyle{apacite}
% Changes the header from Bibliography to References
\renewcommand{\bibname}{References}
% File containing all references in BibTex format
\bibliography{thesisref}

The second problem was that the number one (1) was added after each reference. The solution for this is to declare the value false for the option pagebackref as indicated below:

\usepackage[ pdftex, plainpages = false, pdfpagelabels, 
             pdfpagelayout = useoutlines,
             bookmarks,
             bookmarksopen = true,
             bookmarksnumbered = true,
             breaklinks = true,
             linktocpage,
             pagebackref = false,
             colorlinks = false,  % was true
             linkcolor = blue,
             urlcolor  = blue,
             citecolor = red,
             anchorcolor = green,
             hyperindex = true,
             hyperfigures
             ]{hyperref} 

The third problem in using apacite was removing the reference type ([Book], [Journal Article], etc) from the reference list. This is done by removing it from the BibTex file (if you export it from Endnote).

Instead of:

@book{
   author = {Straubhaar, Joseph  and Larose, Robert  and Davenporta, Lucinda },
   title = {Media now: Understanding media, culture, and technology},
   publisher = {Cengage Learning},
   address = {Boston, MA},
   edition = {7},
   year = {2012},
   type = {**Book**}
}

It should be:

@book{
   author = {Straubhaar, Joseph  and Larose, Robert  and Davenporta, Lucinda },
   title = {Media now: Understanding media, culture, and technology},
   publisher = {Cengage Learning},
   address = {Boston, MA},
   edition = {7},
   year = {2012},
   type = {}
}

The fourth and final problem was that some references (for instance when it's a book section), the references is added the word "In (editors name here)" but the word "In" is displayed in another language. The solution for this is to remove that language in the .cls file. In my case it was Swedish and there were not great need for it:

Instead of:

\usepackage[polutonikogreek,english,swedish]{babel}

It should be:

\usepackage[polutonikogreek,english]{babel}

In case one might need the Swedish letters (åäö) this can be easily achieved by using:

The letter å is \r{a}
The letter ä is \"a 
The letter ö is \"o

In order not to waste time, write the entire page in Swedish then use the find/replace function to quickly format it in a correct way.

1
  • Put differently, the problem for the readers of your initial posting (i.e., before you applied an important edit) was that you failed to mention a crucial piece of information -- that the hyperref package was being loaded with the option pagebackref. Do you expect your readers to be psychics? – Mico Feb 7 '15 at 15:36

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.