You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compilation of the main document gives an error when using the bibtex package and the .bib file is located in a parent directory. More precisely, bibtex logs an error about output.aux: "I couldn't open database file [..]". The cause of this issue is that the output.aux file is placed under the root directory and bibtex is now trying to access the .bib file from a parent directory of the root.
Create or move a main.tex file under a subdirectory and refer to the .bib file as \bibliography{../refs.bib} (i.e., using bibtex).
Compile the main.tex file.
Expected Behaviour
The compilation should succeed without errors and produce a PDF with the used reference(s).
Observed Behaviour
The compiled PDF contains undefined citation(s) and logs the following error:
I couldn't open database file ../refs.bib : \bibdata{../refs.bib : }
Context
I want to compile documents with the same content (incl. bibliography) but with different styles. Therefore, I'm placing the content under the root and have multiple subdirectories containing each a single main file. In each main file, I refer to the content using \input{../[filename].tex} (this works as expected) and \bibliography{../[filename].bib} (this does not work as expected).
Technical Info
URL: N/A
Browser Name and version: N/A
Operating System and version (desktop or mobile): N/A
Signed in as: N/A
Project and/or file: N/A
Analysis
The issue comes from this line https://github.com/overleaf/overleaf/blob/main/services/clsi/app/js/LatexRunner.js#L158, where -auxdir= option for latexmk is defined as $COMPILE_DIR, which seems to point to the root directory, thus output.aux is placed there and not next to the main document (see the picture below, where output.aux should be in the "subdirectory" together with the main.tex).
As a solution, I suggest that output.aux is placed in the directory where latexmk is actually processing the main document so that bibtex understands the path correctly. This can be done, e.g., by modifying the option as -auxdir=./ (see the picture below, where output.aux is now in the "subdirectory" and the compilation succeeds).
PR of this fix is coming soon. PR of the fix available at #1068
The text was updated successfully, but these errors were encountered:
rainiemi
added a commit
to rainiemi/overleaf
that referenced
this issue
Dec 12, 2022
Compilation of the main document gives an error when using the bibtex package and the
.bib
file is located in a parent directory. More precisely, bibtex logs an error aboutoutput.aux
: "I couldn't open database file [..]". The cause of this issue is that theoutput.aux
file is placed under the root directory and bibtex is now trying to access the.bib
file from a parent directory of the root.See showcase-bibtex-issue as an example project demonstrating this issue.
Steps to Reproduce
refs.bib
file under the root directory.main.tex
file under a subdirectory and refer to the.bib
file as\bibliography{../refs.bib}
(i.e., using bibtex).main.tex
file.Expected Behaviour
The compilation should succeed without errors and produce a PDF with the used reference(s).
Observed Behaviour
The compiled PDF contains undefined citation(s) and logs the following error:
Context
I want to compile documents with the same content (incl. bibliography) but with different styles. Therefore, I'm placing the content under the root and have multiple subdirectories containing each a single main file. In each main file, I refer to the content using
\input{../[filename].tex}
(this works as expected) and\bibliography{../[filename].bib}
(this does not work as expected).Technical Info
Analysis
The issue comes from this line https://github.com/overleaf/overleaf/blob/main/services/clsi/app/js/LatexRunner.js#L158, where
-auxdir=
option forlatexmk
is defined as$COMPILE_DIR
, which seems to point to the root directory, thusoutput.aux
is placed there and not next to the main document (see the picture below, whereoutput.aux
should be in the "subdirectory" together with themain.tex
).As a solution, I suggest that
output.aux
is placed in the directory wherelatexmk
is actually processing the main document so that bibtex understands the path correctly. This can be done, e.g., by modifying the option as-auxdir=./
(see the picture below, whereoutput.aux
is now in the "subdirectory" and the compilation succeeds).PR of this fix is coming soon.PR of the fix available at #1068The text was updated successfully, but these errors were encountered: