SUMMARY Some of my source files need Biber to be run after `pdflatex` and some other need BibTeX to be run instead. I would like a way for Kile to detect when to use which for the Live Preview. STEPS TO REPRODUCE 1. Open a .tex file that uses biblatex the following way: \usepackage[backend=biber, style=alphabetic]{biblatex} \addbibresource{Reference.bib} \begin{document} ... \printbibliography \end{document} 2. Enable Live Preview, set it to "Compile documents after saving". Also set Live Preview to use pdflatex by default (in Build-> Live Preview -> PDFLaTeX) 3. Add a citation and save. OBSERVED RESULT Kile runs BibTeX automatically after running pdflatex. BibTeX fails with error message: ***** ***** BibTeX output: ***** cd "/tmp/kile-livepreview.HiIqoP" ***** bibtex notes ***** This is BibTeX, Version 0.99d (TeX Live 2018/Arch Linux) The top-level auxiliary file: notes.aux I found no \citation commands---while reading file notes.aux I found no \bibdata command---while reading file notes.aux I found no \bibstyle command---while reading file notes.aux (There were 3 error messages) EXPECTED RESULT Kile detects that the biblatex package is in use and runs Biber instead of BibTeX (or runs both and continues running pdflatex for a second time) SOFTWARE/OS VERSIONS Linux/KDE Plasma: Arch Linux (available in About System) KDE Plasma Version: 5.16.0-1 KDE Frameworks Version: 5.59.0-1 Qt Version: 5.12.4-1 ADDITIONAL INFORMATION
I discovered something that changes the behaviour. The output of `which biber` is `/usr/bin/vendor_perl/biber`. In the Build settings for Biber, the "Command" section had this full path. When I change this to simply `biber` instead of the full path, LivePreview works well and the bug disappears. Curiously, the previous setting (having the full path to the executable) was not causing problems when manually running Biber from the menu.
@abyss Except for the fact that running Biber from the menu doesn't work for me (maybe it was a fluke), I am able to reproduce your issue on 2.9.93. You're right. It does seem like giving the full path to Biber makes the difference. First I made a healthy LaTeX document like this with all of my settings normal and it was able to build fine: \documentclass{article}`` \usepackage[backend=biber, style=alphabetic]{biblatex} \addbibresource{Reference.bib} \begin{document} \begin{abstract} \end{abstract} Test \cite{whomstever} \section{One} \end{document} After that, I go to the settings and change Biber to its full path, /usr/bin/biber in my case. I go down the Build menu to Reset Auto-Detected Back End, and typing a little more, the live preview still works fine. If I take out the \cite{} and save, then it breaks as you described. Resetting the auto-detected backend doesn't make a difference. Changing the setting to Biber explicitly makes it work. Switching it to Auto-Detect after that keeps using Biber. But if you try to write \cite{} again, it will switch to BibTeX. Kile always does the right thing if Biber isn't given as a full path.
Five years since the original bug report, and I just run across the same bug with kile 2.9.94. When using biblatex with the biber backend in my source latex file, pressing "latex" button still runs bibtex instead of biber, which results in the error message "[BibTex] Finished with the exit code 2". Inspecting logs shows that (quite naturally) bibtex did not find any citations. The difference with the bug report above is that in my case the Build->Biber setting includes "biber" in the command line (not /usr/bin/biber). For the bug report author this solved the problem. For me, it does not. The rough workaround is to change "bibtex" by "biber" in the command line of the Build->Bibtex setting. This is clearly not the best solution.
I want to second the previous comment, also on 2.9.94. The original fix did not work for me either.
> Five years since the original bug report, and I just run across the same bug with kile 2.9.94. > The original fix did not work for me either. I think this is a new issue, with the same symptoms. About a month ago it worked fine, then some upgrade broke the auto-detection of biber vs biblatex. Though I'm not sure if the problem was caused by an upgrade of kile or an upgrade of texlive/biber.
As a workaround: In ~/.config/kilerc there will be a section for your document(s) with a line "bibliographyBackendAutoDetected=", change this to: "bibliographyBackendAutoDetected=biber" while Kile is not running, then start Kile.
(In reply to Andrew Nowa Ammerlaan from comment #6) > As a workaround: In ~/.config/kilerc ... Thanks for your comments. With this workaround, will bibtex be also auto-detected? If not, it has no advantage over my workaround - to replace "bibtex" by "biber" in the Build-BibTex setting.
> With this workaround, will bibtex be also auto-detected? No, it is just manually setting it correct for the current document. > If not, it has no advantage over my workaround - to replace "bibtex" by "biber" in the Build-BibTex setting. Doing that makes it impossible to use bibtex.
At least part of this bug is related to Bug 307437. You can override the autodetection in "Build -> Bibliography Backend", but like in Bug 307437, that setting is not actually stored in kilerc. Nor does changing it in kilerc manually effect what is graphically shown in that menu (though it does effect the behaviour of kile). Then there is the second part of this bug where the autodetection does not work, looking at the code it is supposed to take a hint from the document and then loop over all build tools in the Category "Bibliography" to return which one fits the hint. If that fails then the fallback is Bibtex. I suspect that this part of the bug is also related to the settings not being properly stored and read. I have also noticed that changing the Category of a build tool is another setting that does not "stick", i.e. it is not written to kilerc.
There seem to be (at least) two separate issues at hand, both with similar symptoms. First, Biber doesn't work in the live preview: this is caused by a greedy wildcard match in the log parsing, which causes the entire line that is used for detecting the bibliography backend to be omitted. Kile then automatically falls back to BibTeX, as it can't ever detect anything. This has already been fixed in https://invent.kde.org/office/kile/-/merge_requests/85, where I've added some commentary if you want to know the issue details: https://invent.kde.org/office/kile/-/merge_requests/85#note_1033005. Now, this has still not made its way into a release (PR is from 5 months ago, last tag is from 6 months ago), so you'll need to build from master to get the fix. The Flatpak at https://cdn.kde.org/flatpak/kile-nightly/ also seems to be broken right now... Second, the full path to `biber`: I located where this is being caused in the code: there is a check that compares the full command input field for Biber to the literal string "biber" for detecting its presence, this obviously won't work if a full path given. Fix incoming...
Fix submitted for the second issue: https://invent.kde.org/office/kile/-/merge_requests/102