Tx · LaTeX & TikZ

How to Automate the LaTeX–Biber Compilation Sequence in TeXstudio

Published By the 9to5Science editorial team

At a glance

  1. 1. Enable Biber

    Set TeXstudio’s default bibliography tool to Biber in the Build settings.

  2. 2. Set Quick Build

    Use a sequence that runs LaTeX, Biber, LaTeX twice, then opens the PDF.

  3. 3. Build the document

    Run Quick Build and check the log if Biber reports that it cannot find the control file.

  4. 4. Confirm biblatex setup

    Use biblatex with backend=biber; Biber is not a direct replacement for BibTeX in every project.

To automate bibliography compilation in TeXstudio, configure Quick Build to run the LaTeX compiler, Biber, and the LaTeX compiler two more times. The first LaTeX run writes a control file for Biber; Biber processes the citation data; the later LaTeX runs incorporate the bibliography and resolve references.

Set Biber as TeXstudio’s bibliography tool

Open Options → Configure TeXstudio → Build. In the Default Bibliography Tool setting, select Biber. The exact label or location can vary slightly between TeXstudio versions.

This setting tells TeXstudio what to run when a build sequence invokes its bibliography command. It does not change a document configured for traditional BibTeX into a Biber project: Biber is normally used with the biblatex package and its backend=biber option.

A minimal biblatex setup looks like this:

\documentclass{article}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{references.bib}

\begin{document}
A cited work \cite{sample}.

\printbibliography
\end{document}

Here, references.bib is the bibliography database, and sample must match an entry key in that file. For example, the database could contain an entry beginning @book{sample, ...}.

Configure an automatic build sequence

In the same Build settings, find the Quick Build option. Choose a preset that runs LaTeX, the bibliography tool, and LaTeX again if it uses the selected default bibliography tool. If you want to specify the sequence directly, select the user-defined option and enter:

txs:///compile | txs:///bibliography | txs:///compile | txs:///compile | txs:///view

The txs:///bibliography command uses the bibliography tool selected in TeXstudio’s settings. Since you selected Biber, this command runs Biber. The two final compiler runs help LaTeX resolve both the bibliography information and other references. txs:///compile uses the configured default compiler, so the same sequence can work with pdfLaTeX, XeLaTeX, or LuaLaTeX.

Save the settings, return to the document, and use the Quick Build button or its assigned shortcut. TeXstudio should run the entire sequence and then display the updated PDF. The first build may take longer because it is generating the auxiliary files for the first time.

Worked example: what the sequence does

Suppose your main file is paper.tex and it cites the key sample from references.bib. The automated build performs these steps:

  1. LaTeX compiles paper.tex and writes auxiliary data, including a .bcf control file for Biber.
  2. Biber reads the control file and bibliography database, then writes processed bibliography data for LaTeX.
  3. LaTeX reads that data and places the citation and bibliography in the document.
  4. LaTeX runs again to settle references and update the final output.
  5. View opens or refreshes the PDF, if that command is included in your sequence.

You normally do not need to type biber paper yourself. TeXstudio’s bibliography command uses the document’s job name and runs the configured bibliography tool.

Common mistakes

  • Biber is selected, but the document uses BibTeX commands or packages. Check that the project uses biblatex with backend=biber, and that it loads its database with \addbibresource.
  • Biber says it cannot find a .bcf file. The first LaTeX run may have failed, or TeXstudio may be compiling a different root file. Fix the LaTeX error and confirm that the main document is set as the master/root document before running the sequence again.
  • The bibliography is still missing. Check that the cited key exists in the .bib file, that the database filename and path are correct, and that the document contains \printbibliography where the bibliography should appear.
  • You run Biber manually on the wrong name. Biber expects the job name, not the .bib filename. For a main file named paper.tex, the job name is usually paper.
  • You expect every project to use Biber. Traditional BibTeX projects should use a BibTeX-compatible setup and bibliography command instead. Choose the tool that matches the document’s bibliography system.

If the labels in your TeXstudio version differ, the essential setup is unchanged: select Biber as the bibliography tool, and make Quick Build call that tool between LaTeX runs.

References

  1. TeXstudio User Manual
  2. The biblatex Package: Programmable Bibliographies and Citations

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.