Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to add impact factor information into the apalike.bst. So far, I changed the apalike.bst as follows

Firstly, I added impact_factor into the ENTRY section and created a new function

FUNCTION {format.impactFactor}
{ 
impact_factor empty$
    { "" }
    {"( Impact Factor:" impact_factor ")"}
  if$
}

This function is then called from the article function

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  author format.key output              
  output.year.check                 
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { journal emphasize "journal" output.check
      format.vol.num.pages output
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  format.impactFactor output              % <---- the new filed
  new.block  
  note output
  fin.entry  
}

I get the following error message when trying to compile it using bibtex and a valid bib file

This is BibTeX, Version 0.99d (MiKTeX 2.9 64-bit)
The top-level auxiliary file: apubs.aux
The style file: apalike_custom.bst
Database file #1: JanS.bib
ptr=2, stack=
( Impact Factor:
45(1):205--212
---the literal stack isn't empty for entry ferkl2010ceiling
while executing---line 1104 of file apalike_custom.bst
(There was 1 error message)
share|improve this question

1 Answer 1

You want the function to output one string, so you have to concatenate them:

FUNCTION {format.impactFactor}
{ 
impact_factor empty$
    { "" }
    {"( Impact Factor:" impact_factor * ")" *}
  if$
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.