I have modified my question based on the commands of the first version (thank you). This is the question of version 2. I think I have located the problematic codes.
The problematic 'bst' file can be found in HERE, and a minimal 'bib' file can be found in THERE.
Usually, when receiving the error message 'You can't pop an empty literal stack for entry 5427079 while executing---line 1116 of file roblike.bst', it means the associated item in the file 'bib' is missing.
In this condition, it generates the following references and errors.
You can't pop an empty literal stack for entry 5427079 while executing---line 1119 of file roblike.bst
However, the error message is pointing to a useless code. The code in Line 1116 is ITERATE {call.type$}
.
How can I know what is missing?
First attempt: find a way to track the BibTeX.
How to track the working of the BibTeX? My first attempt is to find a way to run 'bst' file step by step. From the comments of the first version, I think the answer is no. So, I turn to the code that is used to process the article type, it contains:
FUNCTION {article}
{ output.bibitem
format.authors "author" output.check
author format.key output % special for
new.block
format.title "title" output.check
new.block
crossref missing$
{ format.journals
format.year.vol.num.pages output
}
{ format.article.crossref output.nonnull
format.pages output
}
if$
new.block
note output
fin.entry
}
And, two associated functions:
FUNCTION {format.article.crossref}
{ "In" % this is for gmjlike
" \cite{" * crossref * "}" *
}
FUNCTION {format.year.vol.num.pages}
{
volume empty$
{ "empty volume in " cite$ * warning$ }
{ write$
", {\bf " volume * "}" * extra.label *
mid.sentence 'output.state :=
}
if$
number empty$
'skip$
{ "(" number * ")" * *
volume empty$
{ "there's a number but no volume in " cite$ * warning$ }
'skip$
if$
}
if$
pages empty$
'skip$
{ duplicate$ empty$
{ pop$ format.pages }
{ ", " * pages n.dashify * }
if$
}
if$
year empty$
{ "empty year in " cite$ * warning$ }
{ write$
" (" year * ")" * extra.label *
mid.sentence 'output.state :=
}
if$
}
with the entry 5427079 in the file bib:
@article{5427079,
author = {Bioucas-Dias, Jos{\'e} M. and Figueiredo, M{\'a}rio A. T.},
journal = {IEEE Transactions on Image Processing},
number = {7},
pages = {1720-1730},
title = {Multiplicative Noise Removal Using Variable Splitting and Constrained Optimization},
volume = {19},
year = {2010}}
I do not think I lost anything in that item.
Second attempt: I think I know where is wrong.
Since BibTeX cannot run step by step, I can guide the workflow by giving the proper test case.
I add a crossref item for 5427079 and reference with \cite{5427079} \cite{Rokach2010}
, which leads to no error.
@article{5427079,
author = {Bioucas-Dias, Jos{\'e} M. and Figueiredo, M{\'a}rio A. T.},
journal = {IEEE Transactions on Image Processing},
number = {7},
pages = {1720-1730},
title = {Multiplicative Noise Removal Using Variable Splitting and Constrained Optimization},
volume = {19},
crossref = {Rokach2010},
year = {2010}}
Warning--can't use both author and editor fields in Rokach2010
(There was 1 warning)
Process exited normally
That means the codes below are OK.
{
format.article.crossref output.nonnull
format.pages output
}
so the problem is limited to the following codes.
{
format.journals
format.year.vol.num.pages output
}
Then, I remove the crossref item and reference the second line. The BibTeX reports no error, again.
{
format.journals
% format.year.vol.num.pages output
}
So, the problem lies in the following line.
format.year.vol.num.pages output
Then, I restore the second line and reference the first line. The error occurs, again.
{
% format.journals
format.year.vol.num.pages output
}
Then, I think the function format.year.vol.num.pages
must be the problem. So, I reference everything inside. The function is empty!
FUNCTION {format.year.vol.num.pages}
{
% volume empty$
% { "empty volume in " cite$ * warning$ }
% { write$
% ", {\bf " volume * "}" * extra.label *
% mid.sentence 'output.state :=
% }
% if$
% number empty$
% 'skip$
% { "(" number * ")" * *
% volume empty$
% { "there's a number but no volume in " cite$ * warning$ }
% 'skip$
% if$
% }
% if$
% pages empty$
% 'skip$
% { duplicate$ empty$
% { pop$ format.pages }
% { ", " * pages n.dashify * }
% if$
% }
% if$
% year empty$
% { "empty year in " cite$ * warning$ }
% { write$
% " (" year * ")" * extra.label *
% mid.sentence 'output.state :=
% }
% if$
}
The problem remains! Strange!
You can't pop an empty literal stack for entry 5427079
while executing---line 1119 of file roblike.bst
FUNCTION {article}
is OK once we know the definitions of all functions called by that piece of code. That means that we essentially need to see the entire.bst
file to investigate this issue. On first glance the entry5427079
does indeed contain all relevant 'required' fields, so one would expect it to compile without error. (And even if it didn't, the style would ideally catch these issues before having an internalYou can't pop an empty literal stack
error pop up.).bst
file will probably be too long to be included directly into the question, so you will have to upload it elsewhere. In that case, please choose a text-sharing/code-sharing service like pastebin.com, gitlab.com/explore/snippets, gist.github.com over file-sharing services.FUNCTION {output} { duplicate$ empty$ 'pop$ 'output.nonnull if$ }
There is a pop$. Why pop? If I remove the use of function output. There is no error. But, this is not quite right. What is the function output used for?% format.year.vol.num.pages output format.year.vol.num.pages } { format.article.crossref output.nonnull format.pages output }
@moewe