[biblio] semicolon before url in bibtex?

Karl Berry karl at freefriends.org
Sun Jun 24 23:50:45 CEST 2018


An IEEE journal wants to have a semicolon before a final url (if
present), while other items are separated by commas. I'm wondering if
there is some reasonable way to do this in bibtex. (Biblatex is not an
option, and I don't want to talk about it. :)  Example entry:

  A. Thor, \emph{Some Book}, Some Publisher Corp., 1994;
  \url{http://thor.example.org/somebook}

However, the main complication is that it might not always be the year
before the url. It might be pages, or possibly other entries:

  A. Thor, ``Some article'', Some Journal, 1994, ..., pp.~8--16;
  \url{http://thor.example.org/somearticle}

Ot there might be no url at all. Then it needs to end with a period as usual.


As far as I can tell, the punctuation is output by the bst at the end
of a field instead of the beginning, and there's no way to look ahead
(is there?). It seems like the relevant fields would need to look ahead
and see if the next thing is a url, and if so, insert a semicolon
instead of a comma.

So I don't see a decent way to do this within bibtex. (That is, without
writing an entirely new and different bst from scratch.)

Alternatively, I can't see a way for the url code to backup and delete
the previous punctuation (since it's already output by the time
format.url is called) and insert the semicolon. (That is, without
completely revamping the TeX output.)

I've done a lot of web searching, playing around with makebst options,
etc., to no avail. Surely the question has been asked before, but I
couldn't find it.

At the moment, I'm thinking that the only practical approach is to
post-process the bbl and replace ", \url" with "; \url" (essentially;
have to handle newlines as well as spaces, but you get the idea).
I don't think bst files have a way to make another pass over the output
once it's written, or to save everything in a buffer, or whatever.

Am I missing something (non-)obvious? --thanks, karl.


More information about the biblio mailing list