18

Given the directory structure:

B-Galactosidase Report\LaTeX\Min ex\

My .tex file is inside "Min ex" directory.

My .bib file is inside the "B-Galactosidase Report" directory two levels above that.

Then what is the path I should specify for bib.bib in my .tex file? I think the syntax is tripping me up here...

I have tried

\bibliography{"../../B-Galactosidase Report/bib"}{}

which triggers the error

 Non-existent destination files:
      'citing with manual.bbl'
Latexmk: I WON'T RUN 'bibtex citing with manual' because I don't find the following files:
  'bib.bib'
ptrcao
  • 6,603
  • 3
    Don't use spaces in any of your directory or file names. Other than that, specifying ../../mybib should work. – Alan Munn Sep 05 '11 at 07:05
  • I thought spaces should be ok as long as you wrap inverted commas around the pathname? "../../mybib" didn't work in any case... :( – ptrcao Sep 05 '11 at 07:07
  • No. That is the case with working in Windows' command prompt. Then folders/directories require quotes if they include any special characters, including spaces. – Werner Sep 05 '11 at 07:10
  • 1
    ...I have to ask: Did you try ../../bib? I'm pretty sure it does not matter whether you use / or \ under Windows. – Werner Sep 05 '11 at 07:18
  • 1
    I just tried \bibliography{../../bib}{} and got the same error... What could be wrong? – ptrcao Sep 05 '11 at 07:32
  • 1
    For out-of-source latex builds: the env. var. BIBINPUTS can be set to the directory containing the .bib file (equ. to TEXINPUTS). After that the \bibliography entry can contain the bib name without file extension and no subdirectories. The bibtex call should point to the .aux location (i.e. the out-of-source dir) – Oliver Zendel Nov 22 '22 at 12:44

2 Answers2

14

\bibliography{../../bib}{} is correct and works for me, after I correct an unrelated error. The .aux files needed to be cleared and I needed to ammend the bibliography style, then the above works. Thanks a lot guys for your help!

ptrcao
  • 6,603
4

One option is to use the short DOS pathname. Go to the directory above "/B-Galactosidase Report" and open a DOS command window. Run the command:

dir /X *.*

On my computer it gives the short path name of "B-Galactosidase Report" as "B-GALA~1". Now you can use:

\bibliography{\detokenize{../../../B-GALA~1/bib}}

If this works then \bibliography{../../bib} should also work.

Tonechas
  • 976
Danie Els
  • 19,694