我目前正在使用我所在大学的 Overleaf 模板撰写我的硕士论文,该模板使用 BibTex 来引用参考文献。文档类是 scrrprt。对于我的一些参考文献I get the error You cant pop an empty literal stack for entry XXX
,而其他参考文献则工作正常。我该如何摆脱这个错误?
下面是我得到错误的一个 mwe:
\documentclass[a4paper,headsepline,bibtotoc]{scrreprt}
\begin{document}
bla \cite{abdullah_technological_2023}, \cite{meredith_numerical_2011}, \cite{iskra_convective_2007}, \cite{stull_wet-bulb_2011}
% References
\bibliographystyle{refstyle}
\bibliography{refs}
\end{document}
一切运行正常的参考资料包括:
@article{iskra_convective_2007,
title = {Convective mass transfer coefficient for a hydrodynamically developed airflow in a short rectangular duct},
volume = {50},
issn = {00179310},
url = {https://linkinghub.elsevier.com/retrieve/pii/S0017931006005990},
doi = {10.1016/j.ijheatmasstransfer.2006.10.026},
language = {en},
number = {11-12},
urldate = {2023-05-30},
journal = {International Journal of Heat and Mass Transfer},
author = {Iskra, Conrad R. and Simonson, Carey J.},
month = jun,
year = {2007},
pages = {2376--2393}
}
@article{stull_wet-bulb_2011,
title = {Wet-{Bulb} {Temperature} from {Relative} {Humidity} and {Air} {Temperature}},
volume = {50},
issn = {1558-8424, 1558-8432},
url = {https://journals.ametsoc.org/view/journals/apme/50/11/jamc-d-11-0143.1.xml},
doi = {10.1175/JAMC-D-11-0143.1},
number = {11},
urldate = {2023-05-30},
journal = {Journal of Applied Meteorology and Climatology},
author = {Stull, Roland},
month = nov,
year = {2011},
pages = {2267--2269}
}
对于以下参考文献,Overleaf 显示错误:
@article{abdullah_technological_2023,
title = {Technological development of evaporative cooling systems and its integration with air dehumidification processes: {A} review},
volume = {283},
issn = {03787788},
shorttitle = {Technological development of evaporative cooling systems and its integration with air dehumidification processes},
url = {https://linkinghub.elsevier.com/retrieve/pii/S037877882300035X},
doi = {10.1016/j.enbuild.2023.112805},
language = {en},
urldate = {2023-07-18},
journal = {Energy and Buildings},
author = {Abdullah, Shekh and Zubir, Mohd Nashrul Bin Mohd and Muhamad, Mohd Ridha Bin and Newaz, Kazi Md Salim and Öztop, Hakan F. and Alam, Md Shadab and Shaikh, Kaleemullah},
month = mar,
year = {2023},
pages = {112805--112832}
}
@article{meredith_numerical_2011,
title = {A {Numerical} {Model} for {Simulation} of {Thin}-{Film} {Water} {Transport} {Over} {Solid} {Fuel} {Surfaces}},
volume = {10},
issn = {18174299},
url = {http://iafss.haifire.com/wordpress/digitalarchive/view.php?c=1&v=10&p=415},
doi = {10.3801/IAFFS.FSS.10-415},
language = {en},
urldate = {2023-08-14},
journal = {Fire Safety Science},
author = {Meredith, K. and Xin, Y. and de Vries, J.},
year = {2011},
pages = {415--428}
}
用于参考书目样式的 bst 文件如下:
ENTRY
{ address
author
booktitle
chapter
edition
editor
howpublished
institution
journal
key
month
note
number
organization
pages
publisher
school
series
title
type
volume
year
}
{}
{ label }
INTEGERS { output.state before.all mid.sentence after.sentence after.block before.title}
FUNCTION {init.state.consts}
{ #0 'before.all :=
#1 'mid.sentence :=
#2 'after.sentence :=
#3 'after.block :=
#4 'before.title :=
}
STRINGS { s t }
FUNCTION {output.nonnull}
{ 's :=
output.state mid.sentence =
{ ", " * write$ }
{ output.state after.block =
{ add.period$ write$
newline$
"\newblock " write$
}
{ output.state before.all =
'write$
% next if is for use with `new' FUNCTION {after.authors}
{ output.state before.title =
{ ": " * write$ }
{ add.period$ " " * write$ }
if$
}
if$
}
if$
mid.sentence 'output.state :=
}
if$
s
}
FUNCTION {output}
{ duplicate$ empty$
'pop$
'output.nonnull
if$
}
FUNCTION {output.check}
{ 't :=
duplicate$ empty$
{ pop$ "empty " t * " in " * cite$ * warning$ }
'output.nonnull
if$
}
FUNCTION {output.bibitem}
{ newline$
"\bibitem{" write$
cite$ write$
"}" write$
newline$
""
before.all 'output.state :=
}
FUNCTION {fin.entry}
{ add.period$
write$
newline$
}
FUNCTION {new.block}
{ output.state before.all =
'skip$
{ after.block 'output.state := }
if$
}
FUNCTION {new.sentence}
{ output.state after.block =
'skip$
{ output.state before.all =
'skip$
{ after.sentence 'output.state := }
if$
}
if$
}
% new one -> sets what is specified in FUNCTION {output.nonnull}
% if `before.title 'output.state = ... if$' is true
FUNCTION {after.authors}
{ output.state before.all =
'skip$
{ before.title 'output.state := }
if$
}
FUNCTION {not}
{ { #0 }
{ #1 }
if$
}
FUNCTION {and}
{ 'skip$
{ pop$ #0 }
if$
}
FUNCTION {or}
{ { pop$ #1 }
'skip$
if$
}
FUNCTION {new.block.checka}
{ empty$
'skip$
'new.block
if$
}
FUNCTION {field.or.null}
{ duplicate$ empty$
{ pop$ "" }
'skip$
if$
}
FUNCTION {emphasize}
{ duplicate$ empty$
{ pop$ "" }
{ "{\em " swap$ * "}" * }
if$
}
FUNCTION {scapify}
{ duplicate$ empty$
{ pop$ "" }
{ "{\sc " swap$ * "}" * }
if$
}
INTEGERS { nameptr namesleft numnames }
FUNCTION {format.names}
{ 's :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ numnames #2 >
{ " " * }
'skip$
if$
t "others" =
{ " et~al." * }
{ " und " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
STRINGS { last.authors }
FUNCTION {init.last.authors}
{ "" 'last.authors :=
}
FUNCTION {format.authors}
{ author empty$
{ "" }
{ author format.names scapify }
if$
}
FUNCTION {format.organization}
{ organization empty$
{ "" 'last.authors :=
""
}
{ organization last.authors =
{ "\leavevmode\vrule height 2pt depth -1.6pt width 23pt" }
{ organization scapify }
if$
organization 'last.authors :=
}
if$
}
FUNCTION {format.editors}
{ editor empty$
{ "" 'last.authors :=
""
}
{ editor last.authors =
{ "\leavevmode\vrule height 2pt depth -1.6pt width 23pt" }
{ editor format.names scapify }
if$
editor num.names$ #1 >
{ ", eds." * }
{ ", ed." * }
if$
editor 'last.authors :=
}
if$
}
FUNCTION {format.ineditors}
{ editor empty$
{ "" }
{ editor format.names
editor num.names$ #1 >
{ ", eds." * }
{ ", ed." * }
if$
}
if$
}
FUNCTION {format.title}
{ title emphasize
}
FUNCTION {n.dashify}
{ 't :=
""
{ t empty$ not }
{ t #1 #1 substring$ "-" =
{ t #1 #2 substring$ "--" = not
{ "--" *
t #2 global.max$ substring$ 't :=
}
{ { t #1 #1 substring$ "-" = }
{ "-" *
t #2 global.max$ substring$ 't :=
}
while$
}
if$
}
{ t #1 #1 substring$ *
t #2 global.max$ substring$ 't :=
}
if$
}
while$
}
FUNCTION {format.date}
{ year empty$
{ month empty$
{ "" }
{ "there's a month but no year in " cite$ * warning$
month
}
if$
}
{ month empty$
'year
{ month " " * year * }
if$
}
if$
}
FUNCTION {format.btitle}
{ title emphasize
}
FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #3 <
{ "~" }
{ " " }
if$
swap$ * *
}
FUNCTION {either.or.check}
{ empty$
'pop$
{ "can't use both " swap$ * " fields in " * cite$ * warning$ }
if$
}
FUNCTION {format.bvolume}
{ volume empty$
{ "" }
{ "Vol.~" volume *
series empty$
'skip$
{ " of " * series * }
if$
"volume and number" number either.or.check
}
if$
}
FUNCTION {format.number.series}
{ volume empty$
{ number empty$
{ series field.or.null }
{ "no.~" number *
series empty$
{ "there's a number but no series in " cite$ * warning$ }
{ " in " * series * }
if$
}
if$
}
{ "" }
if$
}
FUNCTION {format.edition}
{ edition empty$
{ "" }
{ edition "l" change.case$ ".~Auflage" * }
if$
}
INTEGERS { multiresult }
FUNCTION {multi.page.check}
{ 't :=
#0 'multiresult :=
{ multiresult not
t empty$ not
and
}
{ t #1 #1 substring$
duplicate$ "-" =
swap$ duplicate$ "," =
swap$ "+" =
or or
{ #1 'multiresult := }
{ t #2 global.max$ substring$ 't := }
if$
}
while$
multiresult
}
FUNCTION {format.pages}
{ pages empty$
{ "" }
{ pages multi.page.check
{ "S.~" pages n.dashify * }
{ "S.~" pages * }
if$
}
if$
}
FUNCTION {format.vol.year}
{ volume empty$
{ "empty volume in " cite$ * warning$ }
{ ", Vol.~" * volume * }
if$
number empty$
{ "empty number in " cite$ * warning$ }
{ "No.~" number * }
if$
}
FUNCTION {format.chapter.pages}
{ chapter empty$
'format.pages
{ type empty$
{ "ch.~" chapter * }
{ type "l" change.case$ chapter tie.or.space.connect }
if$
pages empty$
'skip$
{ ", " * format.pages * }
if$
}
if$
}
FUNCTION {format.in.ed.booktitle}
{ booktitle empty$
{ "" }
{ editor empty$
{ "In: " booktitle * }
{ "In: " booktitle * ", " * format.ineditors * }
if$
}
if$
}
FUNCTION {empty.misc.check}
{ author empty$ title empty$ howpublished empty$
month empty$ year empty$ note empty$
and and and and and
key empty$ not and
{ "all relevant fields are empty in " cite$ * warning$ }
'skip$
if$
}
FUNCTION {format.thesis.type}
{ type empty$
'skip$
{ pop$
type
}
if$
}
FUNCTION {format.tr.number}
{ type empty$
{ "Tech. Rep." }
'type
if$
number empty$
{ "l" change.case$ }
{ number tie.or.space.connect }
if$
}
FUNCTION {format.article.crossref}
{ key empty$
{ journal empty$
{ "need key or journal for " cite$ * " to crossref " * crossref *
warning$
""
}
{ "in " journal * }
if$
}
{ "in " key * }
if$
" \cite{" * crossref * "}" *
}
FUNCTION {format.crossref.editor}
{ editor #1 "{vv~}{ll}" format.name$
editor num.names$ duplicate$
#2 >
{ pop$ " et~al." * }
{ #2 <
'skip$
{ editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
{ " et~al." * }
{ " and " * editor #2 "{vv~}{ll}" format.name$ * }
if$
}
if$
}
if$
}
FUNCTION {format.book.crossref}
{ volume empty$
{ "empty volume in " cite$ * "'s crossref of " * crossref * warning$
"in "
}
{ "vol.~" volume *
" of " *
}
if$
editor empty$
editor field.or.null author field.or.null =
or
{ key empty$
{ series empty$
{ "need editor, key, or series for " cite$ * " to crossref " *
crossref * warning$
"" *
}
{ series * }
if$
}
{ key * }
if$
}
{ format.crossref.editor * }
if$
" \cite{" * crossref * "}" *
}
FUNCTION {format.incoll.inproc.crossref}
{ editor empty$
editor field.or.null author field.or.null =
or
{ key empty$
{ booktitle empty$
{ "need editor, key, or booktitle for " cite$ * " to crossref " *
crossref * warning$
""
}
{ "in " booktitle * }
if$
}
{ "in " key * }
if$
}
{ "in " format.crossref.editor * }
if$
" \cite{" * crossref * "}" *
}
FUNCTION {article}
{ output.bibitem
format.authors "author" output.check
after.authors
format.title "title" output.check
new.block
crossref missing$
{ journal "journal" output.check
format.vol.year output
}
{ format.article.crossref output.nonnull }
if$
format.pages output
format.date output
new.block
note output
fin.entry
}
FUNCTION {book}
{ output.bibitem
author empty$
{ format.editors "author and editor" output.check }
{ format.authors output.nonnull
crossref missing$
{ "author and editor" editor either.or.check }
'skip$
if$
}
if$
after.authors
format.btitle "title" output.check
new.block
crossref missing$
{ format.bvolume output
format.number.series output
publisher "publisher" output.check
address output
}
{ new.block
format.book.crossref output.nonnull
}
if$
format.edition output
format.date "year" output.check
new.block
note output
fin.entry
}
FUNCTION {booklet}
{ output.bibitem
format.authors output
after.authors
format.title "title" output.check
new.block
howpublished new.block.checka
howpublished output
address output
format.date output
new.block
note output
fin.entry
}
FUNCTION {inbook}
{ output.bibitem
author empty$
{ format.editors "author and editor" output.check }
{ format.authors output.nonnull
crossref missing$
{ "author and editor" editor either.or.check }
'skip$
if$
}
if$
after.authors
format.btitle "title" output.check
crossref missing$
{ format.bvolume output
format.number.series output
publisher "publisher" output.check
address output
}
{ format.chapter.pages "chapter and pages" output.check
new.block
format.book.crossref output.nonnull
}
if$
format.edition output
format.date "year" output.check
new.block
note output
fin.entry
}
FUNCTION {incollection}
{ output.bibitem
format.authors "author" output.check
after.authors
format.title "title" output.check
new.block
crossref missing$
{ format.in.ed.booktitle "booktitle" output.check
format.bvolume output
format.number.series output
publisher "publisher" output.check
address output
format.edition output
format.date "year" output.check
}
{ format.incoll.inproc.crossref output.nonnull }
if$
format.chapter.pages output
new.block
note output
fin.entry
}
FUNCTION {inproceedings}
{ output.bibitem
format.authors "author" output.check
after.authors
format.title "title" output.check
new.block
crossref missing$
{ format.in.ed.booktitle "booktitle" output.check
format.bvolume output
format.number.series output
address empty$
{ organization output
publisher output
format.date "year" output.check
}
{ address output.nonnull
format.date "year" output.check
organization output
publisher output
}
if$
}
{ format.incoll.inproc.crossref output.nonnull }
if$
format.pages output
new.block
note output
fin.entry
}
FUNCTION {conference} { inproceedings }
FUNCTION {manual}
{ output.bibitem
author empty$
{ format.organization output }
{ format.authors output.nonnull }
if$
after.authors
format.btitle "title" output.check
author empty$
'skip$
{ organization output }
if$
address output
format.edition output
format.date output
new.block
note output
fin.entry
}
FUNCTION {mastersthesis}
{ output.bibitem
format.authors "author" output.check
after.authors
format.title "title" output.check
new.block
"Master's thesis" format.thesis.type output.nonnull
school "school" output.check
address output
format.date "year" output.check
new.block
note output
fin.entry
}
FUNCTION {misc}
{ output.bibitem
format.authors output
after.authors
format.title output
new.block
howpublished new.block.checka
howpublished output
format.date output
new.block
note output
fin.entry
empty.misc.check
}
FUNCTION {phdthesis}
{ output.bibitem
format.authors "author" output.check
after.authors
format.btitle "title" output.check
new.block
"PhD thesis" format.thesis.type output.nonnull
school "school" output.check
address output
format.date "year" output.check
new.block
note output
fin.entry
}
FUNCTION {proceedings}
{ output.bibitem
editor empty$
{ format.organization output }
{ format.editors output.nonnull }
if$
after.authors
format.btitle "title" output.check
new.block
format.bvolume output
format.number.series output
address empty$
{ editor empty$
'skip$
{ organization output }
if$
publisher output
format.date "year" output.check
}
{ address output.nonnull
format.date "year" output.check
editor empty$
'skip$
{ organization output }
if$
publisher output
}
if$
new.block
note output
fin.entry
}
FUNCTION {techreport}
{ output.bibitem
format.authors "author" output.check
after.authors
format.title "title" output.check
new.block
format.tr.number output.nonnull
institution "institution" output.check
address output
format.date "year" output.check
new.block
note output
fin.entry
}
FUNCTION {unpublished}
{ output.bibitem
format.authors "author" output.check
after.authors
format.title "title" output.check
new.block
note "note" output.check
format.date output
fin.entry
}
FUNCTION {default.type} { misc }
MACRO {jan} {"Januar"}
MACRO {feb} {"Februar"}
MACRO {mar} {"Maerz"}
MACRO {apr} {"April"}
MACRO {may} {"Mai"}
MACRO {jun} {"Juni"}
MACRO {jul} {"Juli"}
MACRO {aug} {"August"}
MACRO {sep} {"September"}
MACRO {oct} {"Oktober"}
MACRO {nov} {"November"}
MACRO {dec} {"Dezember"}
MACRO {jan-feb} {"Januar--Februar"}
MACRO {mar-apr} {"Maerz--April"}
MACRO {mai-jun} {"Mai-Juni"}
MACRO {jun-jul} {"Juni--Juli"}
MACRO {jul-aug} {"Juli--August"}
MACRO {sep-oct} {"September--Oktober"}
MACRO {nov-dec} {"November--Dezember"}
MACRO {jac} {"Journal of Aicraft"}
MACRO {aiaaj} {"AIAA Journal"}
MACRO {acmcs} {"ACM Comput. Surveys"}
MACRO {acta} {"Acta Inf."}
MACRO {cacm} {"Comm. ACM"}
MACRO {ibmjrd} {"IBM J. Res. Dev."}
MACRO {ibmsj} {"IBM Syst.~J."}
MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
MACRO {ieeetc} {"IEEE Trans. Comput."}
MACRO {ieeetcad}
{"IEEE Trans. Comput.-Aided Design Integrated Circuits"}
MACRO {ipl} {"Inf. Process. Lett."}
MACRO {jacm} {"J.~Assoc. Comput. Mach."}
MACRO {jcss} {"J.~Comput. System Sci."}
MACRO {scp} {"Sci. Comput. Programming"}
MACRO {sicomp} {"SIAM J. Comput."}
MACRO {tocs} {"ACM Trans. Comput. Syst."}
MACRO {tods} {"ACM Trans. Database Syst."}
MACRO {tog} {"ACM Trans. Gr."}
MACRO {toms} {"ACM Trans. Math. Softw."}
MACRO {toois} {"ACM Trans. Office Inf. Syst."}
MACRO {toplas} {"ACM Trans. Prog. Lang. Syst."}
MACRO {tcs} {"Theoretical Comput. Sci."}
READ
FUNCTION {sortify}
{ purify$
"l" change.case$
}
INTEGERS { len }
FUNCTION {chop.word}
{ 's :=
'len :=
s #1 len substring$ =
{ s len #1 + global.max$ substring$ }
's
if$
}
FUNCTION {sort.format.names}
{ 's :=
#1 'nameptr :=
""
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ nameptr #1 >
{ " " * }
'skip$
if$
s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't :=
nameptr numnames = t "others" = and
{ "et al" * }
{ t sortify * }
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
FUNCTION {sort.format.title}
{ 't :=
"A " #2
"An " #3
"The " #4 t chop.word
chop.word
chop.word
sortify
#1 global.max$ substring$
}
FUNCTION {author.sort}
{ author empty$
{ key empty$
{ "to sort, need author or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ author sort.format.names }
if$
}
FUNCTION {author.editor.sort}
{ author empty$
{ editor empty$
{ key empty$
{ "to sort, need author, editor, or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ editor sort.format.names }
if$
}
{ author sort.format.names }
if$
}
FUNCTION {author.organization.sort}
{ author empty$
{ organization empty$
{ key empty$
{ "to sort, need author, organization, or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ "The " #4 organization chop.word sortify }
if$
}
{ author sort.format.names }
if$
}
FUNCTION {editor.organization.sort}
{ editor empty$
{ organization empty$
{ key empty$
{ "to sort, need editor, organization, or key in " cite$ * warning$
""
}
{ key sortify }
if$
}
{ "The " #4 organization chop.word sortify }
if$
}
{ editor sort.format.names }
if$
}
FUNCTION {presort}
{ type$ "book" =
type$ "inbook" =
or
'author.editor.sort
{ type$ "proceedings" =
'editor.organization.sort
{ type$ "manual" =
'author.organization.sort
'author.sort
if$
}
if$
}
if$
" "
*
year field.or.null sortify
*
" "
*
title field.or.null
sort.format.title
*
#1 entry.max$ substring$
'sort.key$ :=
}
ITERATE {presort}
SORT
STRINGS { longest.label }
INTEGERS { number.label longest.label.width }
FUNCTION {initialize.longest.label}
{ "" 'longest.label :=
#1 'number.label :=
#0 'longest.label.width :=
}
FUNCTION {longest.label.pass}
{ number.label int.to.str$ 'label :=
number.label #1 + 'number.label :=
label width$ longest.label.width >
{ label 'longest.label :=
label width$ 'longest.label.width :=
}
'skip$
if$
}
EXECUTE {initialize.longest.label}
ITERATE {longest.label.pass}
FUNCTION {begin.bib}
{ preamble$ empty$
'skip$
{ preamble$ write$ newline$ }
if$
"\begin{thebibliography}{" longest.label * "}" * write$ newline$
}
EXECUTE {begin.bib}
EXECUTE {init.state.consts}
EXECUTE {init.last.authors}
ITERATE {call.type$}
FUNCTION {end.bib}
{ newline$
"\end{thebibliography}" write$ newline$
}
EXECUTE {end.bib}
错误表明问题就出在 bst 文件末尾的以下一行ITERATE {call.type$}
。
根据解决方案这文章 我尝试将文章更改为杂项。此方法有效,到目前为止可以消除错误,但随后有关期刊、卷等的所有信息都会丢失。
这文章指出日-月-年的表示法可能存在问题,但使用所提出的代码片段,BibTex 根本找不到任何参考文献。
我还比较了所有出现错误的参考文献和没有出现错误的参考文献,但没有发现巨大的差异。
非常感谢您的帮助!
编辑:包含 bst-file,因为它之前被标记为垃圾邮件。
答案1
问题number
在于文件如何处理空字段.bst
。我无法识别您使用的 .bst,但以下技巧似乎可以解决问题。
将此代码插入到.bst
文件中的函数之后format.vol.year
(大约第 401 行之后):
FUNCTION {format.vol.num}
{ volume field.or.null
duplicate$ empty$ 'skip$
{ ", Vol.~" swap$ * }
if$
number field.or.null
duplicate$ empty$ 'skip$
{ ", No.~" swap$ * }
if$ *
}
并将FUNCTION {article}
替换format.vol.year output
为format.vol.num output
。这解决了我的问题。