I am using the makebst utility to organize the way references are formatted, and I want to adjust it to get extra horizontal space between ":" and the page number for entries of type @article. How do I do it?

Reference newstyle.bst

  • Welcome to TeX.SE. – Mico Dec 24 '20 at 6:00

Some comments and suggestions:

  • Since we're dealing with the formatting of entries of type @article, it sounds like a good idea to start by looking into how the article function is defined in the bst file. The article function starts on line 937 in the bst file to which you provided a hyperlink.

  • In the article function, one finds calls to several additional functions (along with a couple of input sanity checks): format.authors, format.date, format.title, journal, itlB (to typeset the journal name in bold italics), format.vol.num.pages, and format.note.

  • format.vol.num.pages sounds promising, so let's look at its definition, which starts on line 803. The function contains calls to yet further functions: volume, bolden (to make the volume number bold), number (to process the number field and surround it with parentheses), and format.journal.pages (or, in case the entry's eid field is non-empty, format.journal.eid).

  • format.journal.pages sounds promising; its definition starts on line 776.

    After a few input sanity checks are performed (e.g., what to do if an entry has duplicate pages fields -- don't laugh, it can and does happen), the first substantive instruction in that function is contained in the following line:

              ":" *

    If you're guessing that this instruction outputs a : (colon) character, you'd be entirely correct. Change this line to

              ": " *

    if you want the colon character to be followed by an inter-word space. Or, if you prefer an unbreakable "thinspace", change the line to

              ":\," *
  • Finally, save the bst file and re-run both BibTeX and LaTeX on your main tex file to propagate the changes.

Happy BibTeXing!

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.