36

When you prepare an article for a journal (in my case, Quantum Information and Computation, Rinton Press), often they ask you to use some format for your references; in my case, the following:

[1] R. Calderbank and P. Shor (1996), Good quantum error correcting codes exist, Phys. Rev. A, 54, pp. 1098-1106.

[2] M.A. Nielsen and J. Kempe (2001), Separable states are more disordered globally than locally, quant-ph/0105090.

[3] A.W. Marshall and I. Olkin (1979), Inequalities: theory of majorization and its applications, Academic Press (New York).

The issue is, sometimes (and this is the case) they do not provide a .bst style file for bibtex users. I (and I guess many other people) prefer not to copy all the references of a bibtex file one by one into a tex document. So here is the question I am trying to answer:

What is the easiest way to create a .bst file? (for Rinton or any other publisher)

At first sight, I thought this would be very easy to do: after all, a .bst file is just a mere script to give format to a list. Strangely to me, after a long search I have been unable to find a simple clean solution to this problem. These are the the options I have been looking at:

  1. I have tried to adapt a previous .bst file: concretely, apsrev4-1.bst, which has a similar format. Other people have tried this solution before [1], [2]. However, it is an ugly option. First, it requires going through the script of the .bst and understanding it. Second, the script format used in different .bst files differs (quite annoyingly), so it is not easy to modify them unless you do understand what's written.

  2. The above solution is quite hideous and you really lose time on it, so I was wondering: isn't there any software tool (hopefully with a GUI) that does this job? It should, after all, pretty easy to program for a .bst script expert some sort of program to generate .bst files. There are some related questions in this site asking for something similar [3], [4]; there I have seen a couple of proposed apps, but going through their manuals they seem not so easy to use. Isn't there some software tool available to generate a .bst in less than 1 hour of work?

Remarks: ideally I would like to use/personalize/create .bst styles that support eprint fields (e.g. aps4-1.bst).

1
  • 7
    You can try makebst.tex from the custom-bib package. Jan 31, 2013 at 15:02

3 Answers 3

32

As Ulrike said, use makebst tool available in your distribution. Note that the program will ask a long list of questions, so have some time on your hand when you do this. It can be invoked as:

latex makebst
6
  • 19
    Word to the wise: think very carefully when you answer those questions. It is not fun to have to start over again if you make a mistake. (A friend asked me to put together a .bst file that her thesis advisor would approve. After the fifth time she said, "oh wait, maybe option X would be better", I was really tempted to reconsider our friendship.) Jan 31, 2013 at 15:27
  • 10
    @WillieWong You don't have to start over after a mistake, you correct the dbj file, or feed the docstrip options manually.
    – mafp
    Jan 31, 2013 at 15:51
  • 6
    This answer should say what makebst is, and where to find it if your distribution doesn't have it. For those who don't have it: google for makebst.tex and download one of the results.
    – user28358
    Apr 14, 2014 at 17:41
  • 3
    @user28358 - makebst is a utility that's included automatically in all modern TeX distributions.
    – Mico
    Nov 11, 2015 at 14:16
  • 2
    Following on helpful @mafp's helpful comment, here's a more detailed description of the process: - Run latex makebst (on a Mac, use Terminal) - When asked, choose a bst file name, say jie - Answer questions regarding formatting - A bst file named jie.bst will be produced - Use an actual tex file to make sure the bst file works and produces the right format - Most likely, you will have made a formatting mistake :( - If so, edit jie.dbj (any editor will do) and make any adjustments you want - Run latex jie.dbj and a new jie.bst will be produced - Repeat until all formatting is OK
    – LMBC
    Feb 27, 2021 at 14:21
11

Customization of bibliography styles is something that the recently-developed Bibulous project was created for, albeit by using a replacement for BibTeX rather than BibTeX itself. To quote from the introduction of the Bibulous documentation:

Bibulous developed out of frustration with the complexity of creating bibliography styles using BibTeX's obscure language, and also from the realization that because bibliographies are highly structured, one should be able to specify them simply and flexibly using a template approach. There should be no need to learn a new language just to build a bibliography style, and specifying a style should take only a matter of minutes.

For the OP's database file

@article{one,
  title = {Good quantum error-correcting codes exist},
  author = {Calderbank, A. R. and Shor, Peter W.},
  journal = {Phys. Rev. A},
  volume = {54},
  issue = {2},
  pages = {1098--1105},
  year = {1996},
  doi = {10.1103/PhysRevA.54.1098},
  url = {http://link.aps.org/doi/10.1103/PhysRevA.54.1098}
}
@arxiv{two,
  author = {M. A. Nielsen and J. Kempe},
  year = 2001,
  title = {Separable states are more disordered globally than locally},
  url = {quant-ph/0011117}
}
@book{three,
  author = {Albert W. Marshall and Ingram Olkin},
  title = {Inequalities: theory of majorization and its applications},
  year = 1979,
  publisher = {Academic Press},
  address = {New York}
}

(Note that I've changed the entries slightly from the OP's input, assuming that the differences from the online references were unintentional.) The corresponding style template can have the form

TEMPLATES:
article = <au> (<year>), \textit{<title>}, <journal>, <volume>,{ }...
          [pp.~<startpage>--<endpage>|p.~<startpage>|<eid>|].[ <note>]
book = [<au>|<ed>|] (<year>), \textit{<title>}, <publisher> (<address>).[ <note>]
arxiv = <au> (<year>), \textit{<title>}, \url{<url>}.

SPECIAL-TEMPLATES:
citelabel = <citenum>
sortkey = <citenum>
authorlist = <author.to_namelist()>
editorlist = <editor.to_namelist()>
authorname.n = [<authorlist.n.first.initial()>.][<authorlist.n.middle.initial().compress()>.][<authorlist.n.prefix>] <authorlist.n.last>[, <authorlist.n.suffix>]
au = <authorname.0>, ...,{ and }<authorname.9>
editorname.n = [<editorlist.n.first.initial()>.][<editorlist.n.middle.initial().compress()>.][<editorlist.n.prefix>] <editorlist.n.last>[, <editorlist.n.suffix>]
ed = <editorname.0>, ...,{ and }<editorname.3>

Here I've used a custom arxiv entry type, but this could just as well have been misc or anything else the user may want to call it. Using this template with Bibulous produces the formatted output

enter image description here

Changing the style template is easy to do. Here <au> is the typical abbreviation for the formatted list of authors, and each <.> variable means "insert the entry's data here". To add italicization of journal names, simply put a \textit{...} command around <journal> in the template. To put the year at the end of the reference rather than after the author list, simple move (<year>) to the desired location inside the template. And so on. The Bibulous documentation contains a variety of other examples to work from.

1
  • I have not had time yet to try this approach but the output you got is very similar to the journal's bibstyle :) Apr 8, 2014 at 12:04
5

I don't know of any software with a fancy GUI that allows the creation of bst files, but the usual recommended way for custoized styles is the custom-bib package. It will ask you many detailed questions about your style (including an option for an eprint field), and will create a bst file from that. You can even change some of your answers in the recorded dbj file, so you can create variants, or improved versions of your custom style without answering all questions again.

You can also start from scratch, it is not that hard. The two most invaluable sources od information are btxhak, and Tame the Beast.

You must log in to answer this question.

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