4

I am using a Mac with TeX Live and Mendeley for automatically generating .bib files, some of which have spaces in the file names. I would like to know how to reference such files from LaTeX as using "" or \ doesn't seem to work.

Werner
  • 603,163

1 Answers1

5

This depends on which backend you are using.

If the backend is bibtex then no spaces are allowed in the filename (and there are other restrictions such as the length of the name must not be more than 40 characters). LaTeX will happily write the file name to the .aux file, but bibtex will complain when it reads the resulting \bibdata command.

If you use biber as the backend, which is now the standard for biblatex then this restriction has been removed, you just use \addbibresource as standard:

\documentclass{article}

\usepackage{biblatex}
\addbibresource{file with spaces.bib}

\begin{document}
\nocite{*}
\printbibliography

\end{document}

If file with spaces.bib contains

@Article{Auth,
  author =   {Author},
  title =    {Title},
  journal =  {Jour.},
  year =     2000
}

then you get

Sample output

after running through pdflatex, biber, pdflatex.

Andrew Swann
  • 95,762