42

I get "There were undefined references" errors and can't fix it after two days of trying. I have tried switching editors from Sublime Text 3 to TeXStudio on a Mac, then trying both on a PC. I am willing to try anything at this point.

My test.tex file:

\documentclass{article}
\usepackage[style=numeric,backend=biber]{biblatex}
\addbibresource{\Username\Dropbox\test.bib}
\begin{document}
  Hello\cite{greenwade93}.
  \printbibliography
\end{document}

My test.bib file:

@ARTICLE{greenwade93,
  author  = "George Greenwade",
  title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
  year    = "1993",
  journal = "TUGBoat",
  volume  = "14",
  number  = "3",
  pages   = "342--351"
}

The pdf shows: Hello[greenwade93 ]

TeXStudio log shows the following errors:

"Citation 'greenwade93' on page 1 undefined.
"Empty bibliography"
"There were undefined references"
"Please (re)run Biber on the file:(biblatex)test(biblatex) and rerun LaTeX afterwards.

I have read about doing a compilation trick but I'm not sure how to do this in either SublimeText or TexStudio. I don't know how to use command line. I have run into many problems and taken many detours that led to other problems. I'm at a loss. Can someone please give me a few hints or keywords I can search for to fix these problems, or a complete solution? I can't even get a minimum working example up. I will install anything.

12
  • First question: what exactly did you run? We can see you ran LaTeX (perhaps pdfLaTeX) at least once, but did you run Biber at all?
    – Joseph Wright
    Jan 12, 2014 at 9:45
  • Thanks for the response JW, I've seen your posts everywhere. I don't know how to run Biber. I know it's installed on my computer. I can't find any guide online on how to run Biber. I'm new to LaTeX. Jan 12, 2014 at 9:53
  • OK, I'll post some instructions for TeXstudio (assuming you are happy with that editor)
    – Joseph Wright
    Jan 12, 2014 at 10:03
  • 2
    I may try to get something organised to cover how to deal with this for a range of editors: am raising in chat and will move to the meta site as needed. This is a challenging area for new users!
    – Joseph Wright
    Jan 12, 2014 at 10:16
  • 1
    I've now opened a 'generic' question for this: tex.stackexchange.com/questions/154751/…. It may be sensible to 'reverse dupe' this question to that one.
    – Joseph Wright
    Jan 18, 2014 at 18:42

8 Answers 8

41

TeXstudio's build process ('Build & View') by default runs pdfLaTeX but not a bibliography tool, which you need to do separately. There is also a need to change the settings to run Biber rather than BibTeX for creating a bibliography. Thus the steps required are as follows:

  1. In the TeXstudio preferences ('Preferences ...' on the Mac or 'Options -> Configure TeXstudio' on Windows), choose the Build tab and alter the 'Default Bibliography' to 'Biber'. Save and close the preferences.

  2. Run 'Build & View' from the 'Tools' menu (or press the two green arrows icon), which will create a PDF but with the bibliography not completed

  3. Run 'Bibliography' from the 'Tools' menu.

  4. Run 'Build & View' again: the bibliography will appear in the PDF.

As noted in comments, it is possible to set up TeXstudio in alternative ways to achieve the same effect. The key is that you have to ensure that the is a sequence

  1. LaTeX
  2. Biber
  3. LaTeX

which can be done 'by hand' (as I have) or can be automated in various ways. Note that the same general idea applies whatever editor is used: this is a feature of LaTeX and not of the editor.


On the question of file paths (a separate issue), it is best not to include a path at all but to place the .bib file where it will be 'found': in the current difrectory or somewhere that TeX searches automatically. That is a separate issue, so I'm assuming a demo file reading:

\documentclass{article}
\begin{filecontents*}{\jobname.bib}
@ARTICLE{greenwade93,
  author  = "George Greenwade",
  title   = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
  year    = "1993",
  journal = "TUGBoat",
  volume  = "14",
  number  = "3",
  pages   = "342--351"
}
\end{filecontents*}
\usepackage[style=numeric,backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
  Hello\cite{greenwade93}.
  \printbibliography
\end{document}

which 'rolls up' the BibTeX database into the LaTeX source.

6
  • 1
    It worked! The simplicity of the solution is depressing. The detail of your answer will be very helpful to other neophytes like myself. Other answers assume a level of computer/LaTeX literacy not all have. Jan 12, 2014 at 10:26
  • 1
    @user2205916 No problem: as I've said in a comment on the question, I think we probably need a more generalised question on this as for newer users it is a real challenge.
    – Joseph Wright
    Jan 12, 2014 at 10:27
  • 1
    Valid point. I was worried about excessive localization. However, I think beginners have trouble implementing generalized answers within the context of their specific editors. I ran across the "pdflatex, biber, pdflatex" recommendation but knew not how to implement. Feel free to edit my original post for maximum relevance though. Jan 12, 2014 at 10:39
  • @user2205916 I think Joseph probably has in mind a single question with a bunch of different answers for different editors. So the instructions would be specific to your editor - you'd just scroll down to find the relevant set. But there would be a single place to point people to when they run into this problem. (But I could be wrong about what he has in mind, obviously.)
    – cfr
    Jan 12, 2014 at 21:00
  • 1
    With TeXstudio, without change to configuration, you may use latexmk (Tools->Commands->Latexmk). Jul 28, 2016 at 9:14
4

To solve the same problem in Sublime Text 3:

  1. Open the LaTeX.sublime-build file. Go to /User/username/Library/Application Support/Sublime Text 3/Packages/LaTeXTools/LaTeX.sublime-build. If you can't find your Library folder, you may have to un-hide it. Type the following into terminal: chflags nohidden ~/Library. Type chflags hidden ~/Library to re-hide.

  2. Find the following block of code near the top of the file, under "osx":

    "cmd": ["latexmk", "-cd", "-e", "\$pdflatex = '%E -interaction=nonstopmode -synctex=1 %S %O'", //"-silent", "-f", "-pdf"],

  3. Make it look like this (only 3 lines are added):

    "cmd": ["latexmk", "latexmk", "biber", "latexmk", "-cd", "-e", "\$pdflatex = '%E -interaction=nonstopmode -synctex=1 %S %O'", //"-silent", "-f", "-pdf"],

  4. Build using the same LaTeXTools system. It should now run pdflatex, biber, pdflatex, pdflatex in that order. Bibliography should be visible!

Related post: Bibliography missing from PDF (Sublime Text 2 and Miktex)

Update:

The alteration to the sublime-build file noted above was derived from a blog. It made my bibliography compile and prevented undefined citations. However, I updated all of my packages via TeXLiveUtility today, reverted back to the default sublime-build file calling 'latexmk' once, and compiled a working bibliography and citations just fine.

0
1

As others already figured out, the problem is that BibTeX/BibLaTeX are not run. The easiest solution for this would be using Texlipse, the LaTeX Eclipse plugin. It has the default process flow:

  1. LaTeX
  2. BibTeX/Biber (depends on which backend you specify on including the package)
  3. LaTeX
  4. LaTeX

This should fit every case. By default this is done every time you save changes.

2
  • But, here, the OP needs latex, biber, latex, latex... Jul 28, 2016 at 9:16
  • @PaulGaborit BibteX and Biber do basically the same. Except that Biber seems to occasionally fail finding BIB files for no apparent reason. But I was a little wrong on that anyway.
    – Egor Hans
    Aug 3, 2016 at 13:43
1

Note it might be as well due to your bibliography being broken: I had this issue due to a JabRef-generated entry: a @Standard. I replaced it with

@techreport{key,
  type = {Standard},
}

I spotted the error via bibtool: https://github.com/ge-ne/bibtool

0

For me the problem was that there was an & symbol in my references:

...
journal = {Information Processing & Management},
...

I fixed the issue by escaping the symbol: \&

0

The cleaner way to what @EZewde suggested would be to add a pre-compile step in TeXstudio.

After you installed biber and set it as 'default bibliography' (See EZewde's answer):

Go to tab Build and add as Precompile: txs:///biber

0

You can add biber to the default build process (green arrows) by following steps:

  1. Go to the preferences Preferences ...(Mac) or Options -> Configure TeXstudio(Windows/Linux), go to tab Build and alter 'Default Bibliography' to txs:///biber.

  2. Go to tab Commands. If there is no path defined to the biber executable, add it as 'Biber'. You may use biber % here.

  3. Go to tab Build and change the command 'Build & View' from txs:///compile | txs:///view to txs:///compile | txs:///biber | txs:///compile | txs:///view.

  4. Click OK and exit Preferences.

  5. Run Build & View (green arrows or F5).

1
  • How do you "edit the metacommand"?
    – Cadoiz
    Aug 19, 2020 at 8:47
0

For anyone landing on this page with this issue in Texpad, the following fixed it for me:

  1. Delete Biber cache from Preferences > External Typesetter > Delete Biber cache.
  2. Typeset > Remove intermediate files.
  3. Typeset again.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .