# Configure kile and biblatex

How do people configure kile to work with biblatex? I have two bibliographies

\begin{refsection}
...
\end{refsection}

\begin{refsection}
...
\end{refsection}


and to get this to compile I need to run at least

pdflatex file

bibtex file1-blx

bibtex file2-blx

pdflatex file


Can this be made automatic in kile?

(I am on ubuntu.)

EDIT: Herbert gives a method using biber which works. However it is a pain to get the latest biber and biblatex in ubuntu as I mention in the comments. However, his method also suggests that a similar custom build option for kile could be made to work for biblatex+bibtex too which would enable you to keep the ubuntu version of texlive.

-
Consider to switch from BibTeX to biber -- with biber, subdivided bibliographies should be processed in a single pass. – lockstep Jun 9 '11 at 16:18
Is it obvious how to do that in kile? The normal pdflatex build option in kile just runs "pdflatex -interaction=nonstopmode %source" and there is a tick box on the same page for "Automatically run additional tools" but I don't know how to configure what that does. – Raphael Jun 9 '11 at 16:28
Sorry -- I don't use kile. Maybe this link is helpful. – lockstep Jun 9 '11 at 16:35
New Kile and new texlive/biblatex both uses logreq. Kile will recompile as necessary automatically. No extra tools necessary. – Mikael Öhman Jun 10 '11 at 17:19
@Raphael The installation of the latest TeX Live version is not too complicated. Please follow this short tutorial and you certainly will be successful as I have been. – JJD Sep 2 '12 at 1:28

• Go to Settings->Configure Kile
• Choose on the left Build
• Choose New and insert the name biber
• Now click on this new item and insert on the right into the field for the command /usr/local/texlive/2010/bin/x86_64-linux/biber (this example shows my path)
• Into the parameter field insert "%S"
• Now enable the Quick Build item on the left and add biber in the field on the right.

Close the windows and everything should work. At the first time when running biber it takes a lot of time because it has to unpack all included files into a temporary directory. In your document do not forget to set

\usepackage[backend=biber,...]{biblatex}


With the latest version of biblatex it should be the default.

-
If I have to move to biber, how do you use it from the command line? I set \usepackage[backend=biber, arxiv=pdf, firstinits=true]{biblatex} but pdflatex file gives me Package biblatex Warning: Please (re)run Biber on the file(s): (biblatex) file2-blx.aux . But biber file2-blx gives me an error FATAL - Cannot find control file 'file2-blx.bcf'! - did you pass the "backend=biber" option to BibLaTeX? – Raphael Jun 9 '11 at 18:06
First delete old auxiliary files. It is safe to delete all files except the .tex one. Then run pdflatex file, then run biber file and again twice pdflatex, that is all. – Herbert Jun 9 '11 at 19:33
Being on ubuntu I have now removed all installed texlive packages, installed texlive from the official website, removed kile ubuntu packages, compiled kile from source and installed. biber now works :) Kile also appears to but I notice Quickbuild is making a ps and then converting it to pdf. I would prefer it to use pdflatex if possible. – Raphael Jun 10 '11 at 9:11
Thanks. Got it to work in the end. The secret seems to be to use '%S' with a capital S for the biber tool config. – Raphael Jun 10 '11 at 12:43
I found a slightly better but not good way: you can make biber one "configuration" for the BibTeX command. This should make kile treat biber like the regular bibtex. Unfortunately it doesn't work. My guess is that kile doesn't recognize the "Package biblatex Warning: Please (re)run Biber on the file" line because it doesn't say "please (re)run bibtex on the file". – Christian Aug 5 '12 at 16:21

EDIT: It seems like my method calls biber every time it compiles after all, so scratch this. I was pretty certain I checked that it worked like I wanted, but it seems like I was wrong. I'll leave my answer below anyway.

Since this is the top result in Google for "kile biber" and "kile biblatex", and the question doesn't have a perfect solution (@Herbert's answer seems to run biber every time I compile, which is unnecessary), I'll try and explain my solution to this problem. I'm not completely certain I understand how my solution works, but at least it seems to do what I want, which is:

• Automatically run biber and rerun pdflatex when needed (when I change my bibliography or citations) when I run the tool PDFLaTeX in Kile

To make Kile work as wanted this is what I did:

First we make a new configuration for the BibTeX tool:

• Go to Settings -> Configure Kile... -> Tools -> Build
• Select BibTeX in the window under Select a tool
• On the right side under Choose a configuration for the tool BibTeX, press the New button
• Enter the name Biber
• In the General tab:
• in the Commmand field enter biber, in the Options field enter "%S"
• In the Advanced tab
• Set everything equal to the Default configuration, except the Source extension, which should be bcf
• Set everything equal to the Default configuration in the Menu tab

Now just make sure that this new configuration is selected in the drop down box Choose a configuration for the tool BibTeX, and that the box Automatically run additional tools is ticked off in the configuration you use for the PDFLaTeX tool. Now the tool PDFLaTeX can be run by itself, or used in another tool like QuickBuild, and it will automatically run biber and rerun pdflatex when needed.

I'm on Linux Mint 15 (olivia) (basically Ubuntu 13.04), using Kile version 2.1.3, pdflatex version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian), and biber version 0.9.9. I think those are the versions from the default repositories, but I'm not certain.

-

I wrote a simple python script (which you can find here) that calls bibtex for every .aux corresponding to some latex file. I have special reasons for not being able to use biber. So for your example,

multi-bibtex [options] file


is equivalent to

bibtex [options] file1-blx
bibtex [options] file2-blx


Now in Kile (which I don't use) you should be able to change instances of bibtex to multi-bibtex, and of course, get biblatex to use the bibtex backend.

To install on ubuntu,

git clone https://gist.github.com/9e5bb2ec0dd49a2c574b.git /tmp/mbibtex
chmod a+x /tmp/mbibtex/multi-bibtex
sudo mv /tmp/mbibtex/multi-bibtex /usr/local/bin/


Which downloads the python script and puts it in /sur/local/bin. Usual disclaimer about how you should be careful about downloading scripts and using them yadda yadda.

-

Go to Settings, Configure Kile. In the left panel, select Tools and Build. Press the "New..." button. Follow the next image instructions:

Now, from "Select a tool" listbox, select QuickBuild. Perform the necessary changes to have the same that the illustration:

Press OK and compile your file/project :)

Reference: Florian Schöngaßner webpage.

-