# Do spaces in \cite make a difference?

I just found the hard way that it matters.

For example,

\cite{aref, bref}


is different from

\cite{aref,bref}


Notice the space after the comma in first one. If it does matter, this looks real silly to me.

I just need to verify if this is the case.

Just to add, I am using Miktex and Texmaker

This is how it's looking now:

\cite{jiang2006research,datta2006distributed,bandyopadhyay2006clustering}


Before it was:

\cite{jiang2006research, datta2006distributed, bandyopadhyay2006clustering}


Here is a full example of code which fails:

\documentclass[twoside,11pt]{article}

\usepackage{jair, theapa, rawfonts}

\begin{document}

\begin{abstract}
Abstracts will go here.

\end{abstract}

\section{Introduction}
\label{Introduction}

\subsection{Thesis Background}

As expected, most of the work involved combination of the disciplines of \textit{Data Mining} and \textit{Computer Networks} \cite{jiang2006research, datta2006distributed, bandyopadhyay2006clustering}.

\vskip 0.2in
\bibliographystyle{theapa}
\bibliography{refs}

\end{document}


refs.bib looks as follows:

@article{bandyopadhyay2006clustering,
title={Clustering distributed data streams in peer-to-peer environments},
author={Bandyopadhyay, S. and Giannella, C. and Maulik, U. and Kargupta, H. and Liu, K. and Datta, S.},
journal={Information Sciences},
volume={176},
number={14},
pages={1952--1985},
year={2006},
publisher={Elsevier}
}

@article{datta2006distributed,
title={Distributed data mining in peer-to-peer networks},
author={Datta, S. and Bhaduri, K. and Giannella, C. and Wolff, R. and Kargupta, H.},
journal={Internet Computing, IEEE},
volume={10},
number={4},
pages={18--26},
year={2006},
publisher={IEEE}
}

@article{jiang2006research,
title={Research issues in data stream association rule mining},
author={Jiang, N. and Gruenwald, L.},
journal={ACM Sigmod Record},
volume={35},
number={1},
pages={14--19},
year={2006},
publisher={ACM}
}

@book{datta2008probabilistic,
title={Probabilistic approximate algorithms for distributed data mining in peer-to-peer networks},
author={Datta, S.},
year={2008},
publisher={ProQuest}
}

-
Can you please give the code that you found the hard way ? –  Harish Kumar Oct 28 '12 at 23:51
Oh!. This won't help. Can you please give a code from \doumentclass...\end{document} like I gave in the answer? Also include those packages which are suspects!. If they are not standard packages (i.e., not found on CTAN), you may give their link also. –  Harish Kumar Oct 28 '12 at 23:58
Dear @Shamim Hafiz, where can we find jair and theapa? They don't look standard. –  Harish Kumar Oct 29 '12 at 8:14
@ShamimHafiz You are using a very old package theapa.sty that redefines \cite in a wrong way. There are more recent packages that provide APA citation style. –  egreg Oct 29 '12 at 8:44
@ShamimHafiz I don't know about JAIR; but the file they provide is from 1993 and is written in ugly LaTeX. However it's not responsible for the failure of \cite with spaces in its argument. –  egreg Oct 29 '12 at 22:50

Trust your own eyes ;-)

\documentclass[
12pt,a4paper]{scrartcl}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}

@ARTICLE{mwe2012,
author = {Smith, A. and Johnson, B. and Willians, C.},
title = {The three most common surnames in the United States of America},
journal = {Review of Useless Knowledge},
year = {2012},
volume = {8},
number = {1},
pages = {290--290}
}

@ARTICLE{mwe2011,
author = {Miller, J. and Brown, D.},
title = {Most used surnames in fake passports},
journal = {Journal of Nosense Ranks},
year = {2011},
volume = {5},
number = {3},
pages = {1--130},
pmid = {1234567},
url = {http://www.mwe.com/mwe2011},
doi = {http://dx.doi.org/10.1016/jnr.2011.01.01},
}
\end{filecontents*}
%----------------------------------------------------------------------

\begin{document}

\section{First section}
nonumy eirmod tempor invidunt~\cite{mwe2011,mwe2012}.

\noindent nonumy eirmod tempor invidunt~\cite{mwe2011,   mwe2012}.

\bibliographystyle{unsrt}
\bibliography{\jobname}

\end{document}


Update:

From the comments above, it seems you want to use APA style citations. The following code illustrates the solution (where I used apacite package)

\documentclass{article}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage{apacite} %% for APA style
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
title={Clustering distributed data streams in peer-to-peer environments},
author={Bandyopadhyay, S. and Giannella, C. and Maulik, U. and Kargupta, H. and Liu, K. and Datta, S.},
journal={Information Sciences},
volume={176},
number={14},
pages={1952--1985},
year={2006},
publisher={Elsevier}
}

@article{datta2006distributed,
title={Distributed data mining in peer-to-peer networks},
author={Datta, S. and Bhaduri, K. and Giannella, C. and Wolff, R. and Kargupta, H.},
journal={Internet Computing, IEEE},
volume={10},
number={4},
pages={18--26},
year={2006},
publisher={IEEE}
}

@article{jiang2006research,
title={Research issues in data stream association rule mining},
author={Jiang, N. and Gruenwald, L.},
journal={ACM Sigmod Record},
volume={35},
number={1},
pages={14--19},
year={2006},
publisher={ACM}
}

@book{datta2008probabilistic,
title={Probabilistic approximate algorithms for distributed data mining in peer-to-peer networks},
author={Datta, S.},
year={2008},
publisher={ProQuest}
}
\end{filecontents*}
%----------------------------------------------------------------------

\begin{document}

\section{First section}
tempor invidunt~\cite{jiang2006research,datta2008probabilistic}.

\noindent
tempor invidunt~\cite{jiang2006research,   datta2006distributed}.

\bibliographystyle{apacite}
\bibliography{\jobname}

\end{document}


And your code (with apacite) will be

\documentclass{article}
\usepackage{apacite} %% for APA style
\usepackage{jair,rawfonts}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
title={Clustering distributed data streams in peer-to-peer environments},
author={Bandyopadhyay, S. and Giannella, C. and Maulik, U. and Kargupta, H. and Liu, K. and Datta, S.},
journal={Information Sciences},
volume={176},
number={14},
pages={1952--1985},
year={2006},
publisher={Elsevier}
}

@article{datta2006distributed,
title={Distributed data mining in peer-to-peer networks},
author={Datta, S. and Bhaduri, K. and Giannella, C. and Wolff, R. and Kargupta, H.},
journal={Internet Computing, IEEE},
volume={10},
number={4},
pages={18--26},
year={2006},
publisher={IEEE}
}

@article{jiang2006research,
title={Research issues in data stream association rule mining},
author={Jiang, N. and Gruenwald, L.},
journal={ACM Sigmod Record},
volume={35},
number={1},
pages={14--19},
year={2006},
publisher={ACM}
}

@book{datta2008probabilistic,
title={Probabilistic approximate algorithms for distributed data mining in peer-to-peer networks},
author={Datta, S.},
year={2008},
publisher={ProQuest}
}
\end{filecontents*}
%----------------------------------------------------------------------
\begin{document}

\begin{abstract}
Abstracts will go here.

\end{abstract}

\section{Introduction}
\label{Introduction}

\subsection{Thesis Background}

As expected, most of the work involved combination of the disciplines of \textit{Data Mining} and \textit{Computer Networks} \cite{jiang2006research,         datta2006distributed,                                          bandyopadhyay2006clustering}.

\vskip 0.2in

\bibliographystyle{apacite}
\bibliography{\jobname}

\end{document}


Compile and see for yourself. Don't use theapa.bst and theapa.sty They are old. Instead use apacite.

-
Hey, I want to read these journals regularly !!!11 ;-D –  Speravir Oct 29 '12 at 0:21
@Speravir: :-). I picked up[ those in this site only. Liked them very much and using them ;-) –  Harish Kumar Oct 29 '12 at 0:26
Thanks for the code update. Here is the link that you requested: "www.cs.cmu.edu/afs/cs/project/jair/pub/information/.../jair.sty " You would need to actually google it and it's not a raw link which would open up straightway. –  Shamim Hafiz Oct 29 '12 at 17:21
@ShamimHafiz: See the update. Don't use theapa. –  Harish Kumar Oct 29 '12 at 22:47
@HarishKumar: Thanks for the update and advice. egreg mentioned that, jair.sty is too old. Do you have any suggestion for it's alternative. As for a bit of humor, if I try to Google jair style, I get an alternate suggestion for hairstyle :P. The concerning part is, the phrase jair style might be outdated. –  Shamim Hafiz Oct 29 '12 at 23:45