4

I am using this .bst file in my LaTeX document: http://ads.harvard.edu/pubs/bibtex/astronat/apj/apj.bst

Everything is working, except that I would like the outputs in the reference section to contain article titles, which they currently do not.

The .bst file allows for each entry to have a title, and all of the ones in my citation file do, but it just doesn't get output in the bibliography.

Is there some modification I can make to the .bst file to get the titles to output to the bibliography?

Thank you for your help.

3
  • 1
    Welcome to TeX.SE. Make a copy of the bst file, calling it (say) myapj.bst. Open myapj.bst in a text editor, find the function article (right after the line %%%%%%% End of functions from astrobib), and insert the instruction format.title "title" output.check on a line by itself, between the lines that say date.block and crossref missing$, resp. Save the file, and start using with \bibliographystyle{myapj}. The first time you use a new .bst file, be sure to latex the main file, bibtex it, and latex it twice more.
    – Mico
    Commented Mar 11, 2014 at 21:53
  • Thanks, Mico! That's got it. Could you point me in the direction of a good reference that has syntax commands for a .bst file, so I could tweak it further if I need to?
    – M. Teor
    Commented Mar 12, 2014 at 13:34
  • You're welcome. Let me write up my blurb as an official answer. This will also give me space to provide pointers for further forays into bibtex programming.
    – Mico
    Commented Mar 12, 2014 at 14:21

1 Answer 1

8

You will need to edit the article function in apj.bst and provide an instruction to print the contents of the entry's title field. I suggest you do so as follows:

  • Make a copy of the file apj.bst; call the copy, say, myapj.bst.

  • Open the file myapj.bst in a text editor and search for the function called article. I believe it starts right after the line that says %%%%%%% End of functions from astrobib.

  • In the function article, locate the lines

      date.block
      crossref missing$
    
  • Insert the line

      format.title "title" output.check
    

    between these two lines.

  • Save the file myapj.bst, either in the directory where your main .tex file is located or in a directory that's searched by BibTeX. If you choose the latter method, you should also update the TeX distribution's filename database.

  • Start using the new bibliography style with the instruction \bibliographystyle{myapj}. When switching from one bibliography style to another, it's important to run latex, bibtex, and latex twice more so that all changes are fully propagated.

If you're interested in learning more about the BibTeX infix syntax, I heartily recommend you read the document Tame the BeaST -- The B to X of BibTeX by Nicolas Markey.

You must log in to answer this question.

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