Given that you've found the source of your error, I'll try to explain you where to put your bibliography file so to let BibTeX find your bibliography.
Put your bibfile.bib
in the same directory where your .tex
file is.
Leave your bibfile.bib
in the directory "C:\filelocation" and call BibTeX in this way (assuming that your .tex
file is test.tex
)
bibtex --include-directory="C:/filelocation" test
In both cases change the offending line:
\bibliography{C:\filelocation\bibfile}
to
\bibliography{bibfile}
Note that the second way works with MiKTeX only (it doesn't with TeX Live).
Unfortunately, using the BIBINPUTS
environmental variable to set extra paths where to search for .bib
files (as suggested by @mapf) works bad with MiKTeX, so it is better don't follow that way. This because MiKTeX has a strange manner to manage variables like BIBINPUTS
. In fact, the search order is:
The current directory.
The directory specified with --include-directory
command-line switch.
Directories in the MiKTeX root folder
Directories specified in BIBINPUTS
variable
In your case, with Complete MiKTeX installed, if you run kpsewhich bibdata.bib
you will get:
C:/Program Files/MiKTeX 2.9/bibtex/bib/mslapa/bibdata.bib
(or something similar) which is the file used by MiKTeX even if you set:
BIBINPUTS=.;C:/filelocation;
ADDENDUM
Just for completeness, I forgot to mention this obvious case:
- Put your
bibfile.bib
in a subdirectory of your .tex
file, let's say biblio
.
In this case, BibTeX finds it if you write
\bibliography{biblio/bibfile}
The following minimal example replicates the problem:
\documentclass{article}
\usepackage{tikz}
\usepackage{preview}
\begin{document}
This is the main text.
\end{document}
It's obviously a bad interaction (incompatibility) between tikz
and preview
. Either drop the loading of preview
, or load it with the [active]
package option.
Best Answer
Your image shows the
pdflatex
command is set up to use pdftex.exe (plain tex) not pdflatex.exe (latex) so latex commands are not defined.