# Bibliography only compiling for apstemplate.tex [duplicate]

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

\bibliography{refs}


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}
\pdfoutput=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.
%\bibliographystyle{apsrev4-1}

\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{color}
\usepackage{soul}
\usepackage{amssymb}
\usepackage{wasysym}
\usepackage{dsfont}
%\usepackage[pstarrows]{curve2e}
\usepackage{multirow}
\usepackage{epsfig}
\usepackage{bm}
\usepackage{amsmath,amsthm,amssymb}
%\usepackage{mathtools}
\usepackage{array,booktabs,longtable}
%\usepackage{abstract}
\usepackage{mathrsfs}
%\usepackage[draft]{fixme}
%\usepackage[numbers]{natbib}
%\usepackage{caption}
\usepackage{subfigure}
\usepackage{color}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{calc,shapes,positioning,arrows,snakes}
\usepackage{array}
\usepackage{verbatim}
%\usepackage{bbold}
\usepackage{dsfont}
\usepackage{ifthen}
%\usepackage{hyperref}

\DeclareMathOperator{\Tr}{Tr}

\makeatletter
\newcommand{\thickhline}{%
\noalign {\ifnum 0=}\fi \hrule height 1.25pt
\futurelet \reserved@a \@xhline
}
\newcolumntype{"}{@{\hskip\tabcolsep\vrule width 1.25pt\hskip\tabcolsep}}
\makeatother

\begin{document}

%Title of paper
\title{Test}
\author{test name}
\begin{abstract}
...
\end{abstract}

\maketitle

\section{Section1}
I refer to Reference \cite{SomeArticle}.

\bibliography{refs}
\end{document}


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

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

\bibdata{apstemplate*-*CopyNotes,refs2}
`

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...