Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am writing my thesis with LaTeX. I'm citing the used references with apacite. All in all it worked all perfectly. However I'm facing one problem:

In the bibliography I always have space between the volume and the number of an article.

So it looks like this:

Mustermann, M. (2013). Title of the article. Journal of the article, 4 (2), 28-35.

It, however, should look like this:

Mustermann, M. (2013). Title of the article. Journal of the article, 4(2), 28-35.

Here is my TeX file:

    \documentclass[a4paper,11pt]{article}

    \usepackage{fullpage}
    \usepackage[ngerman]{babel}
    \usepackage{apacite}


    \begin{document}


    \section{First Chapter}

    Any Text which is cited \cite{test}.     


        \bibliographystyle{apacite}
    \bibliography{apa}

\end{document}

And the related file is this:

@article{test,
  title={{Title of the article}},
  author={Mustermann, Max},
  journal={Journal of the article},
  volume={4},
  number={2},
  pages={28--35},
  year={2013}
}

I know it's not much, but my professor criticized it and I want to change it. I read, that I need to alter the .bst-File of apacite, but I have no idea in which way.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

Fortunately, you do not even have to modify any .bst files, the relevant macro can be found in apacite.sty.

Add the following code to your preamble.

\makeatletter
\AtBeginDocument{%
  \renewcommand{\APACjournalVolNumPages}[4]{%
    \Bem{#1}%             journal
    \ifx\@empty#2\@empty
    \else
      \unskip, \Bem{#2}%  volume
    \fi
    \ifx\@empty#3\@empty
    \else
      \unskip({#3})%      issue number
    \fi
    \ifx\@empty#4\@empty
    \else
      \unskip, {#4}%      pages
    \fi
  }
}
\makeatother

It is an exact copy of the \APACjournalVolNumPages from apacite.sty but for some reason the code does not work properly when executed by apacite.sty, it needs to be hooked in via \AtBeginDocument{...}.

The MWE

\documentclass[a4paper,11pt]{article}
\usepackage[ngerman]{babel}
\usepackage{apacite}

\begin{filecontents}{\jobname.bib}
@article{test,
  title={{Title of the article}},
  author={Mustermann, Max},
  journal={Journal of the article},
  volume={4},
  number={2},
  pages={28--35},
  year={2013}
}
\end{filecontents}

\makeatletter
\AtBeginDocument{%
  \renewcommand{\APACjournalVolNumPages}[4]{%
    \Bem{#1}%             journal
    \ifx\@empty#2\@empty
    \else
      \unskip, \Bem{#2}%  volume
    \fi
    \ifx\@empty#3\@empty
    \else
      \unskip({#3})%      issue number
    \fi
    \ifx\@empty#4\@empty
    \else
      \unskip, {#4}%      pages
    \fi
  }
}
\makeatother

\begin{document}
Any Text which is cited \cite{test}.

\bibliographystyle{apacite}
\bibliography{\jobname}
\end{document}

yields enter image description here

without a space.

share|improve this answer
1  
\AtBeginDocument{% \makeatletter needs to be \makeatletter\AtBeginDocument{% catcode changes do nothing in a macro argument. As written \ifx\@empty... compares \@ with e so all the tests are false. –  David Carlisle Oct 15 '13 at 17:43
    
@DavidCarlisle Oh, thank you very much for pointing that out. Can you explain why hooking an exact copy of the macro from apacite.sty into \AtBeginDocument{ makes the macro works as expected? –  moewe Oct 15 '13 at 17:57
1  
You restore the original definition overwriting the one from apacite/german.apc –  David Carlisle Oct 15 '13 at 20:02
    
@DavidCarlisle Ahh, thank you! Good to know. –  moewe Oct 15 '13 at 20:06

The reason for this behavior is a conflict between the DGP (Deutsche Gesellschaft fuer Psychologie/ German Association of Psychology) and APA. If you use the ngerman option in babel, the apacite-package is switching to the rules of the DGP. I had the same problem and fixed it this way (compare the issue number line for nongerman and german option):

%---- remove space between volume and issue of a journal ----
\makeatletter
\renewcommand{\APACjournalVolNumPages}[4]{%
  \Bem{#1}%             journal
  \ifx\@empty#2\@empty
  \else
    \unskip, \Bem{#2}%  volume
  \fi
  \ifx\@empty#3\@empty
  \else
%    \unskip\ ({#3})%    issue number, with the added leading space
    \unskip({#3})%    issue number, without the added leading space
  \fi
  \ifx\@empty#4\@empty
  \else
    \unskip, {#4}%      pages
  \fi
}%
\makeatother
%---- end space correction ----
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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