我是第一次使用 LaTeX 制作参考书目,我需要稍微修改一下 APA,所以我决定使用 biblatex。现在我只是想弄清楚它是如何工作的,但是当我从这网站,我的 LaTeX 编译器出现很多编译错误,似乎是内部错误。我使用的是 TexStudio,并将默认参考书目工具设置为 biber。这是我的代码:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[
backend=biber,
style=alphabetic,
citestyle=authoryear
]{biblatex}
\addbibresource{sample.bib} %Imports bibliography file
\begin{document}
\section{First section}
This document is an example, two items are cited: \textit{The \LaTeX\ Companion} book
is \cite{latexcompanion}, and Einstein's journal paper is \cite{einstein}.
\medskip
\printbibliography
\end{document}
这是我的 .bib 文件
@article{einstein,
author = "Albert Einstein",
title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal = "Annalen der Physik",
volume = "322",
number = "10",
pages = "891--921",
year = "1905",
DOI = "http://dx.doi.org/10.1002/andp.19053221004",
keywords = "physics"
}
@book{latexcompanion,
author = "Michel Goossens and Frank Mittelbach and Alexander Samarin",
title = "The \LaTeX\ Companion",
year = "1993",
publisher = "Addison-Wesley",
address = "Reading, Massachusetts",
keywords = "latex"
}
最后,这是日志文件:
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7000 64-bit) (preloaded format=pdflatex 2020.2.26) 4 OCT 2020 18:08
entering extended mode
**"./Humanities Research Paper.tex"
("Humanities Research Paper.tex"
LaTeX2e <2018-12-01>
("C:\Program Files\MiKTeX 2.9\tex/latex/base\article.cls"
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex/latex/base\size10.clo"
File: size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files\MiKTeX 2.9\tex/latex/base\inputenc.sty"
Package: inputenc 2018/08/11 v1.3c Input encoding file
\inpenc@prehook=\toks14
\inpenc@posthook=\toks15
)
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\babel.sty"
Package: babel 2019/04/03 3.29 The Babel package
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\switch.def"
File: switch.def 2019/04/03 3.29 Babel switching mechanism
)
*************************************
* Local config file bblopts.cfg used
*
("C:\Program Files\MiKTeX 2.9\tex/latex/arabi\bblopts.cfg"
File: bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of
babel
)
("C:\Program Files\MiKTeX 2.9\tex/latex/babel-english\english.ldf"
Language: english 2017/06/06 v3.3r English support from the babel system
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\babel.def"
File: babel.def 2019/04/03 3.29 Babel common definitions
\babel@savecnt=\count88
\U@D=\dimen103
("C:\Program Files\MiKTeX 2.9\tex/generic/babel\txtbabel.def")
\bbl@dirlevel=\count89
)
\l@canadian = a dialect from \language\l@american
\l@australian = a dialect from \language\l@british
\l@newzealand = a dialect from \language\l@british
))
("C:\Program Files\MiKTeX 2.9\tex/latex/biblatex\biblatex.sty"
Package: biblatex 2018/11/02 v3.12 programmable bibliographies (PK/MW)
(C:\Users\natma\AppData\Roaming\MiKTeX\2.9\tex/generic/pdftexcmds\pdftexcmds.st
y
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)
("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\infwarerr.sty"
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
)
("C:\Program Files\MiKTeX 2.9\tex/latex/iftex\iftex.sty"
Package: iftex 2013/04/04 v0.2 Provides if(tex) conditional for PDFTeX, XeTeX,
and LuaTeX
)
LaTeX Warning: You have requested, on input line 185, version
`2019/11/07' of package iftex,
but only version
`2013/04/04 v0.2 Provides if(tex) conditional for PDFTeX, XeTeX,
and LuaTeX'
is available.
("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\ltxcmds.sty"
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
)
! Undefined control sequence.
l.188 \ifluatex
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
("C:\Program Files\MiKTeX 2.9\tex/latex/base\ltluatex.tex"
File: ltluatex.tex 2018/10/21 v1.1i LuaTeX support for plain TeX (core)
! Undefined control sequence.
l.55 \ifnum\luatexversion
<60 %
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
<
l.55 \ifnum\luatexversion<
60 %
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
***************************************************
* LuaTeX version too old for ltluatex support *
***************************************************
)
! Extra \else.
l.190 \else
I'm ignoring this; it doesn't match any \if.
! Extra \fi.
l.272 \fi
I'm ignoring this; it doesn't match any \if.
! Undefined control sequence.
l.273 \ifluatex
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
l.274 \ifnum\luatexversion
<36 %
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Missing number, treated as zero.
<to be read again>
<
l.274 \ifnum\luatexversion<
36 %
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
! Undefined control sequence.
\pdftexcmds@directlua ->\directlua
0
l.282 \pdftexcmds@directlua
{%
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.282 \pdftexcmds@directlua
{%
You're in trouble here. Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! Extra \fi.
l.292 \fi
I'm ignoring this; it doesn't match any \if.
! Undefined control sequence.
l.317 \ifluatex
\else
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Extra \else.
l.317 \ifluatex\else
I'm ignoring this; it doesn't match any \if.
! Extra \fi.
l.341 \fi
I'm ignoring this; it doesn't match any \if.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
! Undefined control sequence.
l.422 \ifluatex
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Extra \else.
l.426 \else
I'm ignoring this; it doesn't match any \if.
! Extra \fi.
l.428 \fi
I'm ignoring this; it doesn't match any \if.
! Undefined control sequence.
<argument> \ifpdf
\let \pdftexcmds@temp \ltx@one \@PackageInfoNoLine {pdftex...
l.441 }
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Package pdftexcmds Info: \pdfdraftmode found.
! Extra \else.
<argument> ...kslashchar pdfdraftmode found}\else
\@PackageInfoNoLine {pdfte...
l.441 }
I'm ignoring this; it doesn't match any \if.
Package pdftexcmds Info: \pdfdraftmode is ignored in DVI mode.
! Extra \fi.
<argument> ...raftmode is ignored in DVI mode}\fi
l.441 }
I'm ignoring this; it doesn't match any \if.
! Undefined control sequence.
l.486 \ifluatex
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Extra \else.
l.487 \else
I'm ignoring this; it doesn't match any \if.
! Extra \fi.
l.489 \fi
%
I'm ignoring this; it doesn't match any \if.
) ("C:\Program Files\MiKTeX 2.9\tex/latex/etoolbox\etoolbox.sty"
Overfull \hbox (0.4174pt too wide) in paragraph at lines 282--12
[]\OT1/cmr/m/n/10 0 if tex.enableprimitives then
tex.enableprimitives(
'pdf@',
'primitive', 'if-
[]
Overfull \hbox (46.86205pt too wide) in paragraph at lines 282--12
\OT1/cmr/m/n/10 prim-i-tive', 'pdf-draft-mode','draftmode'
)
tex.enableprimitives('', 'lu-aescapestring')
end
[]
Underfull \hbox (badness 10000) in paragraph at lines 282--12
[]
Package: etoolbox 2018/08/19 v2.5f e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count90
) ("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\keyval.sty"
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks16
)
("C:\Program Files\MiKTeX 2.9\tex/latex/oberdiek\kvoptions.sty"
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)
("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\kvsetkeys.sty"
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)
("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\etexcmds.sty"
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\ifluatex.sty"
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
))))
("C:\Program Files\MiKTeX 2.9\tex/latex/logreq\logreq.sty"
Package: logreq 2010/08/04 v1.0 xml request logger
\lrq@indent=\count91
("C:\Program Files\MiKTeX 2.9\tex/latex/logreq\logreq.def"
File: logreq.def 2010/08/04 v1.0 logreq spec v1.0
))
("C:\Program Files\MiKTeX 2.9\tex/latex/base\ifthen.sty"
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
("C:\Program Files\MiKTeX 2.9\tex/latex/url\url.sty"
\Urlmuskip=\muskip10
Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc.
)
\c@tabx@nest=\count92
\c@listtotal=\count93
\c@listcount=\count94
\c@liststart=\count95
\c@liststop=\count96
\c@citecount=\count97
\c@citetotal=\count98
\c@multicitecount=\count99
\c@multicitetotal=\count100
\c@instcount=\count101
\c@maxnames=\count102
\c@minnames=\count103
\c@maxitems=\count104
\c@minitems=\count105
\c@citecounter=\count106
\c@maxcitecounter=\count107
\c@savedcitecounter=\count108
\c@uniquelist=\count109
\c@uniquename=\count110
\c@refsection=\count111
\c@refsegment=\count112
\c@maxextratitle=\count113
\c@maxextratitleyear=\count114
\c@maxextraname=\count115
\c@maxextradate=\count116
\c@maxextraalpha=\count117
\c@abbrvpenalty=\count118
\c@highnamepenalty=\count119
\c@lownamepenalty=\count120
\c@maxparens=\count121
\c@parenlevel=\count122
\blx@tempcnta=\count123
\blx@tempcntb=\count124
\blx@tempcntc=\count125
\blx@maxsection=\count126
\blx@maxsegment@0=\count127
\blx@notetype=\count128
\blx@parenlevel@text=\count129
\blx@parenlevel@foot=\count130
\blx@sectionciteorder@0=\count131
\blx@entrysetcounter=\count132
\labelnumberwidth=\skip43
\labelalphawidth=\skip44
\biblabelsep=\skip45
\bibitemsep=\skip46
\bibnamesep=\skip47
\bibinitsep=\skip48
\bibparsep=\skip49
\bibhang=\skip50
\blx@bcfin=\read1
\blx@bcfout=\write3
\c@mincomprange=\count133
\c@maxcomprange=\count134
\c@mincompwidth=\count135
Package biblatex Info: Trying to load biblatex default data model...
Package biblatex Info: ... file 'blx-dm.def' found.
("C:\Program Files\MiKTeX 2.9\tex/latex/biblatex\blx-dm.def"
File: blx-dm.def 2018/11/02 v3.12 biblatex localization (PK/MW)
)
Package biblatex Info: Trying to load biblatex style data model...
Package biblatex Info: ... file 'alphabetic.dbx' not found.
Package biblatex Info: Trying to load biblatex custom data model...
Package biblatex Info: ... file 'biblatex-dm.cfg' not found.
\c@afterword=\count136
\c@savedafterword=\count137
\c@annotator=\count138
\c@savedannotator=\count139
\c@author=\count140
\c@savedauthor=\count141
\c@bookauthor=\count142
\c@savedbookauthor=\count143
\c@commentator=\count144
\c@savedcommentator=\count145
\c@editor=\count146
\c@savededitor=\count147
\c@editora=\count148
\c@savededitora=\count149
\c@editorb=\count150
\c@savededitorb=\count151
\c@editorc=\count152
\c@savededitorc=\count153
\c@foreword=\count154
\c@savedforeword=\count155
\c@holder=\count156
\c@savedholder=\count157
\c@introduction=\count158
\c@savedintroduction=\count159
\c@namea=\count160
\c@savednamea=\count161
\c@nameb=\count162
\c@savednameb=\count163
\c@namec=\count164
\c@savednamec=\count165
\c@translator=\count166
\c@savedtranslator=\count167
\c@shortauthor=\count168
\c@savedshortauthor=\count169
\c@shorteditor=\count170
\c@savedshorteditor=\count171
\c@labelname=\count172
\c@savedlabelname=\count173
\c@institution=\count174
\c@savedinstitution=\count175
\c@lista=\count176
\c@savedlista=\count177
\c@listb=\count178
\c@savedlistb=\count179
\c@listc=\count180
\c@savedlistc=\count181
\c@listd=\count182
\c@savedlistd=\count183
\c@liste=\count184
\c@savedliste=\count185
\c@listf=\count186
\c@savedlistf=\count187
\c@location=\count188
\c@savedlocation=\count189
\c@organization=\count190
\c@savedorganization=\count191
\c@origlocation=\count192
\c@savedoriglocation=\count193
\c@origpublisher=\count194
\c@savedorigpublisher=\count195
\c@publisher=\count196
\c@savedpublisher=\count197
\c@language=\count198
\c@savedlanguage=\count199
\c@origlanguage=\count266
\c@savedoriglanguage=\count267
\c@pageref=\count268
\c@savedpageref=\count269
\shorthandwidth=\skip51
\shortjournalwidth=\skip52
\shortserieswidth=\skip53
\shorttitlewidth=\skip54
\shortauthorwidth=\skip55
\shorteditorwidth=\skip56
\locallabelnumberwidth=\skip57
\locallabelalphawidth=\skip58
\localshorthandwidth=\skip59
\localshortjournalwidth=\skip60
\localshortserieswidth=\skip61
\localshorttitlewidth=\skip62
\localshortauthorwidth=\skip63
\localshorteditorwidth=\skip64
Package biblatex Info: Trying to load compatibility code...
Package biblatex Info: ... file 'blx-compat.def' found.
("C:\Program Files\MiKTeX 2.9\tex/latex/biblatex\blx-compat.def"
File: blx-compat.def 2018/11/02 v3.12 biblatex compatibility (PK/MW)
)
Package biblatex Info: Trying to load generic definitions...
Package biblatex Info: ... file 'biblatex.def' found.
("C:\Program Files\MiKTeX 2.9\tex/latex/biblatex\biblatex.def"
File: biblatex.def 2018/11/02 v3.12 biblatex compatibility (PK/MW)
\c@textcitecount=\count270
\c@textcitetotal=\count271
\c@textcitemaxnames=\count272
\c@biburlnumpenalty=\count273
\c@biburlucpenalty=\count274
\c@biburllcpenalty=\count275
\c@smartand=\count276
)
Package biblatex Info: Trying to load bibliography style 'alphabetic'...
Package biblatex Info: ... file 'alphabetic.bbx' found.
("C:\Program Files\MiKTeX 2.9\tex/latex/biblatex/bbx\alphabetic.bbx"
File: alphabetic.bbx 2018/11/02 v3.12 biblatex bibliography style (PK/MW)
Package biblatex Info: Trying to load bibliography style 'standard'...
Package biblatex Info: ... file 'standard.bbx' found.
("C:\Program Files\MiKTeX 2.9\tex/latex/biblatex/bbx\standard.bbx"
File: standard.bbx 2018/11/02 v3.12 biblatex bibliography style (PK/MW)
\c@bbx:relatedcount=\count277
\c@bbx:relatedtotal=\count278
))
Package biblatex Info: Trying to load citation style 'authoryear'...
Package biblatex Info: ... file 'authoryear.cbx' found.
("C:\Program Files\MiKTeX 2.9\tex/latex/biblatex/cbx\authoryear.cbx"
File: authoryear.cbx 2018/11/02 v3.12 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 '\textcite'.
Package biblatex Info: Redefining '\textcites'.
)
Package biblatex Info: Trying to load configuration file...
Package biblatex Info: ... file 'biblatex.cfg' found.
("C:\Program Files\MiKTeX 2.9\tex/latex/biblatex\biblatex.cfg"
File: biblatex.cfg
))
Package biblatex Info: Trying to load language 'english'...
Package biblatex Info: ... file 'english.lbx' found.
("C:\Program Files\MiKTeX 2.9\tex/latex/biblatex/lbx\english.lbx"
File: english.lbx 2018/11/02 v3.12 biblatex localization (PK/MW)
)
Package biblatex Warning: 'babel/polyglossia' detected but 'csquotes' missing.
(biblatex) Loading 'csquotes' recommended.
\@quotelevel=\count279
\@quotereset=\count280
("Humanities Research Paper.aux")
\openout1 = `"Humanities Research Paper.aux"'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
Package biblatex Info: Input encoding 'utf8' detected.
Package biblatex Info: Automatic encoding selection.
(biblatex) Assuming data encoding 'utf8'.
\openout3 = `"Humanities Research Paper.bcf"'.
Package biblatex Info: Trying to load bibliographic data...
Package biblatex Info: ... file '"Humanities Research Paper".bbl' not found.
No file "Humanities Research Paper".bbl.
Package biblatex Info: Reference section=0 on input line 13.
Package biblatex Info: Reference segment=0 on input line 13.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 16.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 16.
LaTeX Warning: Citation 'latexcompanion' on page 1 undefined on input line 17.
LaTeX Warning: Citation 'einstein' on page 1 undefined on input line 17.
LaTeX Warning: Empty bibliography on input line 21.
[1
{C:/Users/natma/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
("Humanities Research Paper.aux")
LaTeX Warning: There were undefined references.
Package biblatex Warning: Please (re)run Biber on the file:
(biblatex) "Humanities Research Paper"
(biblatex) and rerun LaTeX afterwards.
Package logreq Info: Writing requests to '"Humanities Research Paper".run.xml'.
\openout1 = `"Humanities Research Paper.run.xml"'.
)
Here is how much of TeX's memory you used:
7810 strings out of 492942
141570 string characters out of 3135497
566325 words of memory out of 3000000
11678 multiletter control sequences out of 15000+200000
5248 words of font info for 19 fonts, out of 3000000 for 9000
1141 hyphenation exceptions out of 8191
37i,4n,34p,818b,1590s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmbx10.pfb><C:/Pr
ogram Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmbx12.pfb><C:/Program Fi
les/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb><C:/Program Files/MiKTe
X 2.9/fonts/type1/public/amsfonts/cm/cmti10.pfb><C:/Program Files/MiKTeX 2.9/fo
nts/type1/public/amsfonts/cm/cmti7.pfb>
Output written on "Humanities Research Paper.pdf" (1 page, 58315 bytes).
PDF statistics:
26 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
任何帮助都将不胜感激。如果我没有提供足够的信息,请随时提问。
答案1
如果有人发现这个问题并且有类似的问题,请在用户和管理员模式下更新 MiKTeX。 https://miktex.org/howto/miktex-console。