Closed alfureu closed 9 years ago
Hi DOFfactory,
thanks for the bug report. This issue might be the result of a non-existent bibliography file. If that is indeed the case, then commit 0532e59d should fix your issue.
Could you please prove a (minimal) example project that shows this behaviour?
Kind regards, René
Hi Rene, thanks for the reply, I changed the latex.rb file to the commit mentioned. Now the error shows "Could not locate any file named Bibliography". You are right, it seems TextMate 2 cannot locate the bib file.
However I have a %!TEX root defined in the particular file, the path is correct. Also I did not change the BIBINPUTS variable in TextMate. I noticed in the changelogs and issues that there have been some updates to the citations, but could not figure it out why my previously working project cannot locate the bib file anymore. It is still there on its original location (in the project folder) ... Any ideas?
Ok, I noticed in the latex.rb file that it does not look for BIBINPUTS variable anymore, but a new variable has been introduced like TM_LATEX_BIB. Am I correct? What is the syntax expected in this?
As far as I know BIBINPUTS
was never (directly) used in the citation completion code. BIBINPUTS
might be read by kpsewhich
though. Maybe I introduced a bug in the code that searches for files via kpsewhich
. It would be super nice of you if you could provide steps to reproduce your problem.
... but a new variable has been introduced like TM_LATEX_BIB. Am I correct?
TM_LATEX_BIB
was also used in the “old” code — see commit 59191ffc.
What is the syntax expected in this?
According to the code you can specify the path to an (additional) bib file in this variable.
Hi Rene,
thanks for your reply. Unfortunately I cannot produce now easily a test-environment, I am in the middle of doing something else.
In short, I am using the classicthesis folder structure:
classicthesis.tex – master file bibliography.bib chapters\chapter1.tex chapters\chapter2.tex frontbackmatter\bibliography.tex
In the classicthesis.tex I am calling the bib file through bibliography.tex, and the chapters. So far, when I was writing a chapter, and I needed a reference from the bib, I hit alt+esc and TextMate autocompleted the reference. This is now broken.
I tried using the TM_LATEX_BIB instead of BIBINPUTS, but no luck, the same error. I had it set up on folder paths, but even defining the specific file does not help.
IMHO the latex.rb somehow fails to follow-up on the call of the bib file in bibliography.tex that is called then again in the master file.
I used the folder structure you provided and created classicthesis.tex
with the following content:
\documentclass{report}
\begin{document}
\input{chapters/chapter1}
\input{chapters/chapter2}
\input{frontbackmatter/bibliography}
\end{document}
The file bibliography.bib
contains the following code:
%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/
%% Created for René Schwaiger at 2015-04-20 19:35:21 +0200
%% Saved with string encoding Unicode (UTF-8)
@electronic{citekey,
Author = {Mr. Author},
Date-Added = {2015-04-20 17:34:08 +0000},
Date-Modified = {2015-04-20 17:35:02 +0000},
Title = {Mrs. Title}}
chapter1.tex
and chapter2.tex
both contain the following:
%!TEX root = ../classicthesis.tex
Chapter~
bibliography.tex
is a tex file with the following content:
\bibliographystyle{alpha}
\bibliography{bibliography}
If I invoke use “Insert Citation” in the file chapter1.tex
after ~
, then TextMate correctly inserts the following code \cite{citekey}
.
I tried using the TM_LATEX_BIB instead of BIBINPUTS, but no luck, the same error. I had it set up on folder paths, but even defining the specific file does not help.
Could you please specify what you used as value for BIBINPUTS
? Is there a reason why you set this variable explicitly?
Hi Rene,
Thanks for creating this. I have everything exactly the same, except I did not have the \addbibresource{bibliography.bib} defined.
My BIBINPUTS look the following: /Users/N/Documents:/Users/N/Dropbox/PhD:. I set this variable ages ago (times of TextMate 1), and it always worked, so there was no need to change.
I tried to set the same for TM_LATEX_BIB, tried removing the colon, removed the full stop at the end, tried defining the full path to the file, nothing worked. It seems TextMate recognises the path set by the variable, but the script cannot find the file :-/
One more thing. If I do not trigger the alt+esc buttons within the \cite{} command, but instead I select under Bundles > Select Bundle Item > Action: BibDesk Completion, this method works. Though I liked the autocomplete trigger more, instead of opening a new window.
I have everything exactly the same, except I did not have the \addbibresource{bibliography.bib} defined.
The \addbibresource{bibliography.bib}
was actually left from my first try to reproduce the error. I corrected the above to my current version of the sample project. Does the code from the sample project work for you?
My BIBINPUTS look the following: /Users/N/Documents:/Users/N/Dropbox/PhD:. I set this variable ages ago (times of TextMate 1), and it always worked, so there was no need to change.
latex.rb
should actually never (directly or indirectly) use the content of this variable if you use the folder structure you specified above, since bibliography.bib
is in the same folder as the master file.
It also works for me if I move the bibliography file into ~/Documents
(~
= /Users/rene
= $HOME
) and set BIBINPUTS
to $HOME/Documents:$HOME/Dropbox/:.
:
Could you please recheck the value of BIBINPUTS
:
echo $BIBINPUTS
BIBINPUTS
e.g.:echo $BIBINPUTS
/Users/rene/Documents:/Users/rene/Dropbox/:.
Ok, I recreated a dummy folder structure, as described above in your example and it worked. I was testing until now, when I think I found the bug.
Again, the example above, with the following file structure:
classicthesis.tex – master file bibliography.bib chapters\chapter1.tex chapters\chapter2.tex frontbackmatter\bibliography.tex
Now the content of the frontbackmatter\bibliography.tex is the following:
\bibliographystyle{alpha}
\bibliography{bibliography}
... and as a result everything works.
However, if the content of the frontbackmatter\bibliography.tex contains an even commented-out bibliography command, then it fails to load, e.g.:
\bibliographystyle{alpha}
\bibliography{bibliography}
% \bibliography{dummy}
... and it says "Could not locate any file named dummy".
Voila.
Hi DOFfactory,
thanks for taking the time to recreate the buggy example code! Commit d1311b86 fixes the issue. The official bundle will be updated when Michael (infininight) or Allan (sorbits) have time to push out the changes.
Kind regards, René
Deployed
Hi, after updating the bundle I am getting this error when asking for bib autocomplete: