This question already has an answer here:

I'm using the APS template, apstemplate.tex (found here).

I have a bib file called refs.bib file located in the same folder, and in the tex file if I call


all the references are generated fine (pdflatex, bibtex, pdflatex x2 yada). Great!

However, once I change the name of the tex file from apstemplate.tex to something else, like "SomeOtherName.tex", then the bibliography is not created in the output!

That is really surprising and weird, why should the ability to create a bibliography be linked to what I call the main tex file? Everything else in the tex file is unchanged.

Here's what's in the body, if it's of any relevance:

\documentclass[aps,prl, reprint, superscriptaddress]{revtex4-1}

% You should use BibTeX and apsrev.bst for references
% Choosing a journal automatically selects the correct APS
% BibTeX style file (bst file), so only uncomment the line
% below if necessary.



    \noalign {\ifnum 0=`}\fi \hrule height 1.25pt
    \futurelet \reserved@a \@xhline
\newcolumntype{"}{@{\hskip\tabcolsep\vrule width 1.25pt\hskip\tabcolsep}}


%Title of paper
\author{test name}


I refer to Reference \cite{SomeArticle}.


marked as duplicate by egreg, darthbith, Svend Tveskæg, Mensch, Zarko Mar 28 '16 at 22:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Ok I solved my own problem. But, I don't quite understand why it's a problem.

It turns out that one cannot have spaces in the name of the tex file. I had been naming my files with spaces in between. For example, if the file name is "apstemplate - Copy.tex", then the aux file will have a line

\bibdata{"apstemplate - Copy"Notes,refs}

which screws things up, and then doesn't generate the bilbiography.

Still, this is really really weird, because on a different computer, the same aux file has a line that reads


and everything works out fine, the bibliography is generated and all.

The only difference I can pinpoint is arising either from the OS (Windows 10 for the former and Windows 7 for the latter) or the version of MikTeX (but.. both are 2.9), so I really don't know why one version of MikTeX handles spaces in names just fine but not the other version. Bugs...

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