plk / biblatex

biblatex is a sophisticated bibliography system for LaTeX users. It has considerably more features than traditional bibtex and supports UTF-8
518 stars 118 forks source link

Citation undefined - on a simple one page document and also on 100+ page document #1394

Open ShlomiRex opened 4 days ago

ShlomiRex commented 4 days ago

Ok so I don't know where to post this, but I encounter this problem already multiple times over the past months, maybe even weekly. I am working on my thesis and I'm using TeX Live distribution. This problem occurs on my Windows machine (Windows 10) but also on my macOS M1.

I have a 100+ pdf document that I'm working on. Long story short, I tested this issue on a single .tex file and it was reproduced also there.

Here is my main.tex file:

\documentclass[]{article}
\usepackage{biblatex}
\bibliography{test.bib}
\begin{document}
test \cite{ddpm}.
\end{document}

Here is my test.bib:

@article{ddpm,
  title={Denoising diffusion probabilistic models},
  author={Ho, Jonathan and Jain, Ajay and Abbeel, Pieter},
  journal={Advances in neural information processing systems},
  volume={33},
  pages={6840--6851},
  year={2020}
}

I am using TeX Workshop on vscode to compile the latex document. But in order to help you guys diagnose the problem I also manually ran:

pdflatex main.tex

And I get the same error:

LaTeX Warning: Citation 'ddpm' on page 1 undefined on input line 9.

Although its a warning, its a huge problem on my 100+ document.

Here is the logs in the terminal:

This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./main.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-09-10>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2024/02/08 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/biblatex.sty
(/usr/local/texlive/2024/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
(/usr/local/texlive/2024/texmf-dist/tex/generic/infwarerr/infwarerr.sty)
(/usr/local/texlive/2024/texmf-dist/tex/generic/iftex/iftex.sty)
(/usr/local/texlive/2024/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty))
(/usr/local/texlive/2024/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/kvoptions/kvoptions.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty))
(/usr/local/texlive/2024/texmf-dist/tex/latex/logreq/logreq.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/logreq/logreq.def))
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/url/url.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/blx-dm.def)
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/blx-compat.def)
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/biblatex.def)
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/bbx/numeric.bbx
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/bbx/standard.bbx))
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/cbx/numeric.cbx)
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/biblatex.cfg)
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def))
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/blx-case-expl3.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)))
(./main.aux)
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/lbx/english.lbx)
(./main.bbl)

LaTeX Warning: Citation 'ddpm' on page 1 undefined on input line 9.

[1{/usr/local/texlive/2024/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./main.aux)

LaTeX Warning: There were undefined references.

Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)                main
(biblatex)                and rerun LaTeX afterwards.

 )</usr/local/texlive/2024/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb
></usr/local/texlive/2024/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on main.pdf (1 page, 22238 bytes).
Transcript written on main.log.

Here is the main.log:

This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=pdflatex 2024.10.11)  8 NOV 2024 14:32
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**main.tex
(./main.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-09-10>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2024/02/08 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2024/02/08 v1.4n Standard LaTeX file (size option)
)
\c@part=\count194
\c@section=\count195
\c@subsection=\count196
\c@subsubsection=\count197
\c@paragraph=\count198
\c@subparagraph=\count199
\c@figure=\count266
\c@table=\count267
\abovecaptionskip=\skip49
\belowcaptionskip=\skip50
\bibindent=\dimen141
)
(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/biblatex.sty
Package: biblatex 2024/03/21 v3.20 programmable bibliographies (PK/MW)

(/usr/local/texlive/2024/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)

(/usr/local/texlive/2024/texmf-dist/tex/generic/infwarerr/infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
(/usr/local/texlive/2024/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2022/02/03 v1.0f TeX engine tests
)
(/usr/local/texlive/2024/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2023-12-04 v1.26 LaTeX kernel commands for general use (HO)
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(/usr/local/texlive/2024/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count268
)
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2022/05/29 v1.15 key=value parser (DPC)
\KV@toks@=\toks17
)
(/usr/local/texlive/2024/texmf-dist/tex/latex/kvoptions/kvoptions.sty
Package: kvoptions 2022-06-15 v3.15 Key value format for package options (HO)

(/usr/local/texlive/2024/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty
Package: kvsetkeys 2022-10-05 v1.19 Key value parser (HO)
))
(/usr/local/texlive/2024/texmf-dist/tex/latex/logreq/logreq.sty
Package: logreq 2010/08/04 v1.0 xml request logger
\lrq@indent=\count269

(/usr/local/texlive/2024/texmf-dist/tex/latex/logreq/logreq.def
File: logreq.def 2010/08/04 v1.0 logreq spec v1.0
))
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/ifthen.sty
Package: ifthen 2024/03/16 v1.1e Standard LaTeX ifthen package (DPC)
)
(/usr/local/texlive/2024/texmf-dist/tex/latex/url/url.sty
\Urlmuskip=\muskip17
Package: url 2013/09/16  ver 3.4  Verb mode for urls, etc.
)
\c@tabx@nest=\count270
\c@listtotal=\count271
\c@listcount=\count272
\c@liststart=\count273
\c@liststop=\count274
\c@citecount=\count275
\c@citetotal=\count276
\c@multicitecount=\count277
\c@multicitetotal=\count278
\c@instcount=\count279
\c@maxnames=\count280
\c@minnames=\count281
\c@maxitems=\count282
\c@minitems=\count283
\c@citecounter=\count284
\c@maxcitecounter=\count285
\c@savedcitecounter=\count286
\c@uniquelist=\count287
\c@uniquename=\count288
\c@refsection=\count289
\c@refsegment=\count290
\c@maxextratitle=\count291
\c@maxextratitleyear=\count292
\c@maxextraname=\count293
\c@maxextradate=\count294
\c@maxextraalpha=\count295
\c@abbrvpenalty=\count296
\c@highnamepenalty=\count297
\c@lownamepenalty=\count298
\c@maxparens=\count299
\c@parenlevel=\count300
\blx@tempcnta=\count301
\blx@tempcntb=\count302
\blx@tempcntc=\count303
\c@blx@maxsection=\count304
\blx@maxsegment@0=\count305
\blx@notetype=\count306
\blx@parenlevel@text=\count307
\blx@parenlevel@foot=\count308
\blx@sectionciteorder@0=\count309
\blx@sectionciteorderinternal@0=\count310
\blx@entrysetcounter=\count311
\blx@biblioinstance=\count312
\labelnumberwidth=\skip51
\labelalphawidth=\skip52
\biblabelsep=\skip53
\bibitemsep=\skip54
\bibnamesep=\skip55
\bibinitsep=\skip56
\bibparsep=\skip57
\bibhang=\skip58
\blx@bcfin=\read2
\blx@bcfout=\write3
\blx@langwohyphens=\language89
\c@mincomprange=\count313
\c@maxcomprange=\count314
\c@mincompwidth=\count315
Package biblatex Info: Trying to load biblatex default data model...
Package biblatex Info: ... file 'blx-dm.def' found.

(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/blx-dm.def
File: blx-dm.def 2024/03/21 v3.20 biblatex datamodel (PK/MW)
)
Package biblatex Info: Trying to load biblatex custom data model...
Package biblatex Info: ... file 'biblatex-dm.cfg' not found.
\c@afterword=\count316
\c@savedafterword=\count317
\c@annotator=\count318
\c@savedannotator=\count319
\c@author=\count320
\c@savedauthor=\count321
\c@bookauthor=\count322
\c@savedbookauthor=\count323
\c@commentator=\count324
\c@savedcommentator=\count325
\c@editor=\count326
\c@savededitor=\count327
\c@editora=\count328
\c@savededitora=\count329
\c@editorb=\count330
\c@savededitorb=\count331
\c@editorc=\count332
\c@savededitorc=\count333
\c@foreword=\count334
\c@savedforeword=\count335
\c@holder=\count336
\c@savedholder=\count337
\c@introduction=\count338
\c@savedintroduction=\count339
\c@namea=\count340
\c@savednamea=\count341
\c@nameb=\count342
\c@savednameb=\count343
\c@namec=\count344
\c@savednamec=\count345
\c@translator=\count346
\c@savedtranslator=\count347
\c@shortauthor=\count348
\c@savedshortauthor=\count349
\c@shorteditor=\count350
\c@savedshorteditor=\count351
\c@labelname=\count352
\c@savedlabelname=\count353
\c@institution=\count354
\c@savedinstitution=\count355
\c@lista=\count356
\c@savedlista=\count357
\c@listb=\count358
\c@savedlistb=\count359
\c@listc=\count360
\c@savedlistc=\count361
\c@listd=\count362
\c@savedlistd=\count363
\c@liste=\count364
\c@savedliste=\count365
\c@listf=\count366
\c@savedlistf=\count367
\c@location=\count368
\c@savedlocation=\count369
\c@organization=\count370
\c@savedorganization=\count371
\c@origlocation=\count372
\c@savedoriglocation=\count373
\c@origpublisher=\count374
\c@savedorigpublisher=\count375
\c@publisher=\count376
\c@savedpublisher=\count377
\c@language=\count378
\c@savedlanguage=\count379
\c@origlanguage=\count380
\c@savedoriglanguage=\count381
\c@pageref=\count382
\c@savedpageref=\count383
\shorthandwidth=\skip59
\shortjournalwidth=\skip60
\shortserieswidth=\skip61
\shorttitlewidth=\skip62
\shortauthorwidth=\skip63
\shorteditorwidth=\skip64
\locallabelnumberwidth=\skip65
\locallabelalphawidth=\skip66
\localshorthandwidth=\skip67
\localshortjournalwidth=\skip68
\localshortserieswidth=\skip69
\localshorttitlewidth=\skip70
\localshortauthorwidth=\skip71
\localshorteditorwidth=\skip72
Package biblatex Info: Trying to load compatibility code...
Package biblatex Info: ... file 'blx-compat.def' found.

(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/blx-compat.def
File: blx-compat.def 2024/03/21 v3.20 biblatex compatibility (PK/MW)
)
Package biblatex Info: Trying to load generic definitions...
Package biblatex Info: ... file 'biblatex.def' found.

(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/biblatex.def
File: biblatex.def 2024/03/21 v3.20 biblatex compatibility (PK/MW)
\c@textcitecount=\count384
\c@textcitetotal=\count385
\c@textcitemaxnames=\count386
\c@biburlbigbreakpenalty=\count387
\c@biburlbreakpenalty=\count388
\c@biburlnumpenalty=\count389
\c@biburlucpenalty=\count390
\c@biburllcpenalty=\count391
\biburlbigskip=\muskip18
\biburlnumskip=\muskip19
\biburlucskip=\muskip20
\biburllcskip=\muskip21
\c@smartand=\count392
)
Package biblatex Info: Trying to load bibliography style 'numeric'...
Package biblatex Info: ... file 'numeric.bbx' found.

(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/bbx/numeric.bbx
File: numeric.bbx 2024/03/21 v3.20 biblatex bibliography style (PK/MW)
Package biblatex Info: Trying to load bibliography style 'standard'...
Package biblatex Info: ... file 'standard.bbx' found.

(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/bbx/standard.bbx
File: standard.bbx 2024/03/21 v3.20 biblatex bibliography style (PK/MW)
\c@bbx:relatedcount=\count393
\c@bbx:relatedtotal=\count394
))
Package biblatex Info: Trying to load citation style 'numeric'...
Package biblatex Info: ... file 'numeric.cbx' found.

(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/cbx/numeric.cbx
File: numeric.cbx 2024/03/21 v3.20 biblatex citation style (PK/MW)
Package biblatex Info: Redefining '\cite'.
Package biblatex Info: Redefining '\parencite'.
Package biblatex Info: Redefining '\footcite'.
Package biblatex Info: Redefining '\footcitetext'.
Package biblatex Info: Redefining '\smartcite'.
Package biblatex Info: Redefining '\supercite'.
Package biblatex Info: Redefining '\textcite'.
Package biblatex Info: Redefining '\textcites'.
Package biblatex Info: Redefining '\cites'.
Package biblatex Info: Redefining '\parencites'.
Package biblatex Info: Redefining '\smartcites'.
)
Package biblatex Info: Trying to load configuration file...
Package biblatex Info: ... file 'biblatex.cfg' found.

(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/biblatex.cfg
File: biblatex.cfg 
)
Package biblatex Info: Input encoding 'utf8' detected.
Package biblatex Info: Document encoding is UTF8 ....

(/usr/local/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2024-09-10 L3 programming layer (loader) 

(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
File: l3backend-pdftex.def 2024-05-08 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count395
\l__pdf_internal_box=\box52
))
Package biblatex Info: ... and expl3
(biblatex)             2024-09-10 L3 programming layer (loader) 
(biblatex)             is new enough (at least 2020/04/06),
(biblatex)             setting 'casechanger=expl3'.

(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/blx-case-expl3.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
Package: xparse 2024-08-16 L3 Experimental document command parser
)
Package: blx-case-expl3 2024/03/21 v3.20 expl3 case changing code for biblatex
))
\@quotelevel=\count396
\@quotereset=\count397

(./main.aux)
\openout1 = `main.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info:    ... okay on input line 7.
Package biblatex Info: Trying to load language 'english'...
Package biblatex Info: ... file 'english.lbx' found.

(/usr/local/texlive/2024/texmf-dist/tex/latex/biblatex/lbx/english.lbx
File: english.lbx 2024/03/21 v3.20 biblatex localization (PK/MW)
)
Package biblatex Info: Input encoding 'utf8' detected.
Package biblatex Info: Automatic encoding selection.
(biblatex)             Assuming data encoding 'utf8'.
\openout3 = `main.bcf'.

Package biblatex Info: Trying to load bibliographic data...
Package biblatex Info: ... file 'main.bbl' found.

(./main.bbl)
Package biblatex Info: Reference section=0 on input line 7.
Package biblatex Info: Reference segment=0 on input line 7.

LaTeX Warning: Citation 'ddpm' on page 1 undefined on input line 9.

[1

{/usr/local/texlive/2024/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./main.aux)
 ***********
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-09-10>
 ***********

LaTeX Warning: There were undefined references.

Package biblatex Warning: Please (re)run Biber on the file:
(biblatex)                main
(biblatex)                and rerun LaTeX afterwards.

Package logreq Info: Writing requests to 'main.run.xml'.
\openout1 = `main.run.xml'.

 ) 
Here is how much of TeX's memory you used:
 8549 strings out of 473579
 168402 string characters out of 5728227
 977986 words of memory out of 5000000
 31435 multiletter control sequences out of 15000+600000
 558377 words of font info for 37 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 66i,5n,81p,693b,1162s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/local/texlive/2024/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb
></usr/local/texlive/2024/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on main.pdf (1 page, 22238 bytes).
PDF statistics:
 18 PDF objects out of 1000 (max. 8388607)
 10 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

All of the packages are up to date.

I get this error:

Screenshot 2024-11-08 at 14 39 56

And the PDF doesn't have the citation:

Screenshot 2024-11-08 at 14 40 21
plk commented 4 days ago

Did you run biber? You have to run latex and then biber to generate the .bbl file. Then when you run latex again, it will pick up the references.

ShlomiRex commented 4 days ago

Did you run biber? You have to run latex and then biber to generate the .bbl file. Then when you run latex again, it will pick up the references.

No, but when I run it I get:

➜  latex_test biber test.bib 
INFO - This is Biber 2.20
INFO - Logfile is 'test.bib.blg'
ERROR - Cannot find 'test.bib.bcf'!
INFO - ERRORS: 1
plk commented 4 days ago

Check the biber docs - you don't run it on the .bib but on the .bcf that biblatex produces. You can just run it without the extension too.

moewew commented 13 hours ago

For most people it is usually the most convenient to run Biber on the basename of your main .tex file. So when your document is called myproject.tex just run

biber myproject

this is completely independent of the file name of your .bib file(s). Note that the Biber run needs the .bcf file, which is produced by a successful LaTeX (pdfLaTeX, LuaLaTeX, XeLaTeX, ...) run. So you can only run Biber if you ran LaTeX before without errors. (See https://tex.stackexchange.com/q/63852/35864 for a very nice explanation.)

Most editors can be configured to run Biber for you if you click a button: https://tex.stackexchange.com/q/154751/35864.

Note that mac OS sometimes messes with Biber's cache, which may result in Biber simply not working any more without any proper indication as to what is wrong. In that case you need to clear the cache and rerun Biber. See https://tex.stackexchange.com/q/543837/35864 and linked questions.