因此,我需要为我的论文使用自定义的 bibtex 样式,并且我有一个像这样的 bibtex 条目
@book{Grupen,
author={Grupen, Claus},
title={{Big Bang Nucleosynthesis}},
publisher={Astroparticle Physics, Springer},
date={2005},
}
可以编译,但会给出警告
Warning--empty year in Grupen
并且,从逻辑上讲,不会在引文中显示该条目的年份。如果我尝试将条目更改为
@book{Grupen,
author={Grupen, Claus},
title={{Big Bang Nucleosynthesis}},
publisher={Astroparticle Physics, Springer},
year={2005},
}
date
用替换year
,然后出现错误:
You can't pop an empty literal stack for entry Grupen
while executing---line 2529 of file mitthesis.bst
但mitthesis.bst
只有大约 1200 行,所以我完全搞不懂问题出在哪里。条目book
如下所示:
FUNCTION {book}
{ output.bibitem
author empty$
{ format.editors "author and editor" output.check
add.blank
}
{ format.authors output.nonnull
crossref missing$
{ "author and editor" editor either.or.check }
'skip$
if$
}
if$
format.btitle "title" output.check
crossref missing$
{ format.bvolume output
format.number.series output
format.publisher.address output
}
{
format.book.crossref output.nonnull
format.date "year" output.check
}
if$
format.edition output
format.note output
fin.entry
}
提前致谢!---------- 编辑以添加最小测试用例:
主要.bib:
@book{Grupen,
author={Grupen, Claus},
title={{Big Bang Nucleosynthesis}},
publisher={Astroparticle Physics, Springer},
year={2005}
}
测试.tex
\documentclass[12pt, twoside, singlespace]{article}
\begin{document}
asdf\cite{Grupen}
\bibliographystyle{mitthesis}
\bibliography{main}
\cleardoublepage
\thispagestyle{empty}
\mbox{}
\end{document}
mitthesis.bst 太大了,无法粘贴在这里,但它是这里
答案1
我将把此标记为重复,因为它是同样的错误Johannes_B 在上面的评论中提到了这一点。为了使修复更清晰,我还将在下面发布答案:
您mitthesis.bst
需要format.org.or.pub
用以下内容替换该函数:
FUNCTION {format.org.or.pub}
{ 't :=
""
year empty$
{ "empty year in " cite$ * warning$ }
'skip$
if$
address empty$ t empty$ and
year empty$ and
'skip$
{
add.blank "(" *
t empty$
{ address "address" bibinfo.check *
}
{ t *
address empty$
'skip$
{ ", " * address "address" bibinfo.check * }
if$
}
if$
year empty$
'skip$
{ t empty$ address empty$ and
'skip$
{
", " * %% originally: ", " swap$ * *
}
if$
year "year" bibinfo.check
*
}
if$
")" *
}
if$