[Tex/LaTex] Bibtex (apacite) problem – unwanted space between volume and number

apa-stylebibliographiesbibtexciting

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.

Best Answer

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.