1

I have the following function in my BST file.

FUNCTION {techreport}
{ output.bibitem
  format.authors "author" output.check
  author format.key output              % puts year
  output.year.check                     % after author(s)
  new.block
  format.title "title" output.check
  new.block
  format.tr.number output.nonnull
  institution "institution" output.check
  address output
%  format.date "year" output.check      % don't check for year here because
  format.date  output                   % puts year after author(s)
  new.block
  pages output                          %JOURNAL wants this
  "pages"
  new.block
  note output
  fin.entry
}

The journal wants total pages where available. Right now it prints out the word "pages" after each entry, regardless of if the corresponding .bib item has an entry for the PAGES = {} field.

How can I make it so it only prints the word "pages" when the PAGES field in the .bib file is declared?

David Purton
  • 25,884
  • Maybe this helps: https://tex.stackexchange.com/questions/12806/guidelines-for-customizing-biblatex-styles/13076#13076 or this https://tex.stackexchange.com/questions/119237/in-bst-file-check-if-variable-contains-string?rq=1 – Sango Aug 27 '19 at 14:44
  • You shouldn't modify the bst file in this way. (The pages field should probably be employed primarily for entries of type @article or @incollection.) Instead, you should make use of the note field, as in note = "72 pages total", -- or whatever the correct format may be. – Mico Aug 27 '19 at 15:02
  • 1
    Thank you, I didn't think of that! – Terry Price Aug 28 '19 at 14:21

0 Answers0