I've got this bst file http://pastebin.com/z6mXByj7 and am using this tex:

\decimalpoint %\spanishdecimal{.}


asdasd \citep{chsh_inequality} asdasd \citep*{aspect_test_bell}


with this bib file

% This file was created with JabRef 2.5.
% Encoding: Cp1252

   author = {{Clauser}, J.~F. and {Horne}, M.~A. and {Shimony}, A. and {Holt}, R.~A.
    title = "{Proposed Experiment to Test Local Hidden-Variable Theories}",
  journal = {Physical Review Letters},
     year = 1969,
    month = oct,
   volume = 23,
   number = 15,
    pages = {880-884},
      doi = {10.1103/PhysRevLett.23.880},
   adsurl = {http://adsabs.harvard.edu/abs/1969PhRvL..23..880C},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}

   author = {{Aspect}, A. and {Grangier}, P. and {Roger}, G.},
    title = "{Experimental Tests of Realistic Local Theories via Bell's Theorem}",
  journal = {Physical Review Letters},
 keywords = {Fluorescence, phosphorescence},
     year = 1981,
    month = aug,
   volume = 47,
   number = 15,
    pages = {460-463},
      doi = {10.1103/PhysRevLett.47.460},
   adsurl = {http://adsabs.harvard.edu/abs/1981PhRvL..47..460A},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}

which produces the following output enter image description here

that is exactly what I need except for the fact that it should place the particle for pages "pp" before 460-460 and 880-884. Can this be done by editing the bst file?

  • By the way, why do you load babel twice?
    – Guido
    Commented Jan 5, 2013 at 20:06
  • Uhhh well, I'm relatively new to latex, and still have a tendency to use other people's code blindly. I hadn't noticed.
    – Oscar Lazo
    Commented Jan 6, 2013 at 0:08
  • Yes that can be done by editing the .bst file. Commented Jan 6, 2013 at 5:14

2 Answers 2


You have to change the definition of the function format.journal.pages as follows

FUNCTION {format.journal.pages}
{ pages duplicate$ empty$ 'pop$
    { swap$ duplicate$ empty$
        { pop$ pop$ format.pages }
          ", " * 
          swap$ pop$
          format.pages *

Notice that this works only for entries of type article.

  • 1
    I suppose that the function format.pages should be modified.
    – user2478
    Commented Jan 5, 2013 at 20:39
  • That returned to me the following errors after bibtex ptr=1, stack= \textbf{80},pp 2245--2248 ---the literal stack isn't empty for entry wooters_cocurrence while executing---line 1586 of file fiuady.bst (There were 18 error messages)
    – Oscar Lazo
    Commented Jan 5, 2013 at 20:46
  • I have updated the code. Does it work?
    – Guido
    Commented Jan 6, 2013 at 4:21
  • 1
    @Herbert Modifying format.pages would not work in this case (unless very heavy modifications of the whole style). The in article the function format.journal.pages is used instead of format.pages and format.journal.pages takes care if other elements (journal number) is present. One has to do similar modification to the special functions used for the various entry types to output the pages.
    – Guido
    Commented Jan 6, 2013 at 9:00

In my .bst file, I have the bbl.pages and bbl.page functions, which control the pre-formatting for references containing single and multiple pages.

FUNCTION {bbl.pages}
{ "pp." }

FUNCTION {bbl.page}
{ "p." }

These functions can be modified from from pp. to Pages:, and, p. to Page: respectively, as follows:

FUNCTION {bbl.pages}
{ "Pages:" }

FUNCTION {bbl.page}
{ "Page:" }

To appreciate how this will effect your final document, the functions bbl.pages and bbl.page, above, are later called in the format.pages function:

FUNCTION {format.pages}
{ pages duplicate$ empty$ 'skip$
    { duplicate$ multi.page.check
          bbl.pages swap$
          bbl.page swap$
      "pages" bibinfo.check
      * *

In the format.pages function, after firstly checking whether the pages field is empty (skipping if true), it then checks whether single or multiple pages are involved (multi.page.check), calling the bbl.page and bbl.pages functions respectively.

  • 1
    In the provided bst style the function format.pages is the same as what you have. The issue is that article calls format.jornal.pages which calls format.pages when there is no volume number, but format directly the page numbers without inserting the page abbreviation ("pp" or "p").
    – Guido
    Commented Jan 6, 2013 at 7:14
  • @Guido, where is the switch based on no volume number? Commented Jan 6, 2013 at 7:30
  • If you look at the function format.journal.pages you can see that it puts pages on the stack, it duplicates it, and it the values is empty it removes it. Otherwise, it swaps pages with the previous element on the stack (and it is an educated guess from the output that it is the volume number), it duplicates it and check if it is empty. If it is it remove the last two elements from the stack (pop$ pop$), where, now, the second last is pages and then executes format.pages. Then we have the branch where there is value of pages, and there is a value for the previous element.
    – Guido
    Commented Jan 6, 2013 at 8:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .