1

I have created a custom .bst file using makebst such that it is as per my univeristy PhD guidelines. When I run BibTex, it works perfectly for articles, conference proceedings etc. cited. However BibTeXfails when I am citing a book. The error I get is

 This is BibTeX, Version 0.99d (TeX Live 2015)
 The top-level auxiliary file: example.aux
 The style file: thbibstyle.bst
 Database file #1: books.bib
 You can't pop an empty literal stack for entry Arnett96
 while executing---line 1720 of file thbibstyle.bst
 You can't pop an empty literal stack for entry Spitzer78
 while executing---line 1720 of file thbibstyle.bst

An example .tex file is as follows:

\documentclass[a4paper,11pt]{tanvirTU}
\begin{document}
\title{Title}
\maketitle
Read \cite{Spitzer78, Arnett96}
 \bibliography{books}
  \bibliographystyle{thbibstyle}
\end{document}

Here is my .bst file: thbibstyle

Also the bibliography entry are as follows

@BOOK{Spitzer78,
   author = {{Spitzer}, L.},
    title = "{Physical processes in the interstellar medium}",
publisher = {New York Wiley-Interscience, 1978.~333 p.},
    year = 1978,
   adsurl = {http://adsabs.harvard.edu/cgi-bin/nph-bib_query?  bibcode=1978ppim.book.....S&db_key=AST},
 adsnote = {Provided by the Smithsonian/NASA Astrophysics Data     System}
}

  @BOOK{Arnett96,
    author = {{Arnett}, D.},
    title = "{Supernovae and Mucleosynthesis: An Investigation of the History of Matter from the Big Bang to the Present}",
    publisher = {Supernovae and Mucleosynthesis: An Investigation of the History of Matter, from the Big Bang to the Present, by D.~Arnett.~Princeton: Princeton University Press, 1996.},
     year = 1996,
    adsurl = {http://adsabs.harvard.edu/abs/1996snih.book.....A},
   adsnote = {Provided by the SAO/NASA Astrophysics Data System}
   }

Also the document class is customized which is: tanvirTU

Can anyone tell me why this is happening and how to fix it?

For a solution, please refer to this
Debugging a custom-bib bst file that crashes on book items

Tanvir
  • 1,232
  • Please post the code for the @book entry with key Spitzer78. – Mico Sep 12 '16 at 13:11
  • Hmm, is the version of the .bst file you've posted really identical to the one you're using? The reason I ask is that if I try to bibtex a test entry of type @book, I get the same warning, but at line 1679, not line 1720. What gives? – Mico Sep 12 '16 at 13:16
  • Did you, by any chance, modify the code inside the function format.book? If you did, did you by chance save a copy of the file originally produced by makebst? – Mico Sep 12 '16 at 13:21
  • @Mico Yes it is okay, because I have deleted the commented lines in .bst file upon uploading it in pastebin. Also the question is edited. – Tanvir Sep 12 '16 at 13:24
  • @Tanvir - Can you confirm that you did not modify the function book either? – Mico Sep 12 '16 at 20:22
  • @Mico I have not done any modifications to the function book. I have checked the code again. – Tanvir Sep 13 '16 at 06:03
  • TanvirTU class file couldn't open. Please check – ssr1012 Sep 14 '16 at 13:43
  • @ssr1012 Please check now. tanvirTU class file should open now. – Tanvir Sep 15 '16 at 00:46
  • @Mico A solution to this is provided in this link

    http://tex.stackexchange.com/questions/112195/debugging-a-custom-bib-bst-file-that-crashes-on-book-items?rq=1

    I have modified the thbibstyle.bst by going through the above solution. The modified bst file is thbibstyle_mod.bst . Please let me know if this fix is alright.

    – Tanvir Sep 15 '16 at 01:23
  • Sorry, I'm currently on a business trip and can't reply to TeX-related queries. Will be back in a few days. – Mico Sep 15 '16 at 01:25
  • @Tanvir Yes the link you provide is a correct fix. This is a known bug. This is used in function format.publisher.address. With your current bst, you should also get compilation problems with InCollection, InBook, InProceedings, Proceedings. – user94293 Sep 15 '16 at 01:30
  • @user94293 Thanks. I have corrected my bst file. There are no issues as of now. – Tanvir Sep 15 '16 at 01:41
  • @ssr1012 The answer is added. – Tanvir Sep 16 '16 at 04:48
  • @Tanvir: Great. – ssr1012 Sep 16 '16 at 06:22

0 Answers0