0

I am familiar a bit with the following bst code and if I move up or move down one line its appearance in pdf will change accordingly.

FUNCTION {article}
    { output.bibitem
        format.authors "author" output.check
        new.block
        format.title "title" output.check
        new.block
        crossref missing$
        {
            journal
            "journal" bibinfo.check
            emphasize
            "journal" output.check
            add.blank
            format.date "year" output.check
            format.vol.num.pages output
        }
        { format.article.crossref output.nonnull
            format.pages output
        }
        if$
        new.block
        format.url output
        new.block
        format.note output
        format.eprint output
        fin.entry
    }

But I don't know how to take apart elements of format.vol.num.pages output and use them separately?

I tried format.vol output but it doesn't work.

6
  • format.vol.num.pages is a function defined elsewhere in the .bst file. A function called format.vol may or may not exist. Depending on what you want to do, you might need to redefine format.vol.num.pages or to define a new function that does what you want.
    – moewe
    Feb 5 at 14:28
  • Aha, I find it. FUNCTION {format.vol.num.pages} { volume field.or.null 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$ } how to modify this one?
    – C.F.G
    Feb 5 at 14:31
  • What do you want it to do?
    – moewe
    Feb 5 at 14:33
  • I want vol-(year)-pages
    – C.F.G
    Feb 5 at 14:37
  • Can you post the complete .bst file (it's probably too long to be included here directly, use a text-sharing website like pastebin.com, gist.github.com, ... instead)?
    – moewe
    Feb 5 at 14:41

1 Answer 1

3

format.vol.num.pages is a function defined elsewhere in the .bst file. A function called format.vol does not exist.

For the desired "<volume> () " order you may want to define

FUNCTION {format.vol.year.pages}
{ "{ \bfseries " volume field.or.null * "}" * % make volume bold face
  year empty$
    'skip$
    { " (" year * ")" * * }
  if$
  pages empty$
    'skip$
    { duplicate$ empty$
        { pop$ format.pages }
%        { ":" * pages n.dashify * } % TDS
        { ", " * pages n.dashify * } % comma, not colon TDS
      if$
    }
  if$
}

instead and use that as follows

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    {
      journal emphasize "journal" output.check
      #0 'docomma :=    % TURN COMMAS OFF
      format.vol.year.pages output  % these now do their own comma!!
      #1 'docomma :=    % TURN COMMAS ON
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  note output
  fin.entry
}
3
  • format.chapter.pages is an unknown function---line 2417 of file mybib.bst format.chapter.pages is an unknown function---line 2431 of file mybib.bst format.chapter.pages is an unknown function---line 2481 of file mybib.bst format.chapter.pages is an unknown function---line 2493 of file mybib.bst Database file #1: refers.bib
    – C.F.G
    Feb 5 at 15:06
  • Warning--I didn't find a database entry for "Mardia" Warning--I didn't find a database entry for "Kato_Jones" Warning--I didn't find a database entry for "Yfantis" 0 is an integer literal, not a function, for entry vv while executing---line 2989 of file mybib.bst You can't pop an empty literal stack for entry vv while executing---line 2989 of file mybib.bst 1 is an integer literal, not a function, for entry vv while executing---line 2989 of file mybib.bst You can't pop an empty literal stack for entry vv
    – C.F.G
    Feb 5 at 15:07
  • 1
    @C.F.G Well, my code does not say anything about format.chapter.pages at all. In my version of nature.bst the function is defined in l. 431. But your BibTeX complains about it. The warnings about entries that cannot be found can have multiple reasons (are you sure they are in your .bib file). The errors about vv can only be investigated with the entry at hand and with the complete .bst file.
    – moewe
    Feb 5 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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