0

I've amassed a not-huge-but-not-tiny bibliography over the years, which I occasionally use. So far, it has had the forms of several .bib files which drag around from one paper to the next, occasionally getting some more text, or "sacrificed" in order to make long-form rather than short-form entries (and those don't get updated) etc. I've managed / not really tried to get aliases to work, and I have all entries conforming to a certain naming scheme. Also, I add entries manually, including making sure I like their format, removing fields I don't think I need, and even tinkering with spacing .

I would like to make all this more flexible and manageable with some automation: I want to be able to generate .bib files for a specific paper where I specify:

  • A citation key format
  • Level of verbosity (not just journal name abbreviation)
  • Trimming unused entries
  • Some kind of smart aliasing without seeing dupes in the bibliography etc.
  • Possibly other nifty goodies

Restrictions/requirements:

  • Must be gratis and libre software
  • Command-line is good, GUI is ok, both of them is best

Note: This is a similar question, it's coming from an MS-Word + Zotero user (of while I am neither)

einpoklum
  • 12,311
  • 2
    I have trouble understanding the question. – Dr. Manuel Kuehner Feb 18 '18 at 16:26
  • 3
    I'm not quote sure I understand the question either. I have a single .bib file, (managed with BibDesk on the Mac, but Jabref would also work) and bib keys conform to AuthorYear (up to 3 authors, which works fine for my field). If I need to include a .bib file with a paper submission, then biber can export the entries (see Creating .bib file containing only the cited references of a bigger .bib file). – Alan Munn Feb 18 '18 at 16:30
  • 1
    (1) Wouldn't you ideally use the same citation key format for all your papers (I'm not 100% sure I understood you correctly here, so to avoid confusion I'm talking about the entrykey in biblatex lingo)? That way you always recognise your references, need only learn one scheme and have portable citations. (2) The 'level of verbosity' would ideally be managed by the bibliography style alone, you always give the full information in the .bib and the styles takes what it needs. Though I'll give you that we don't always live in that ideal world. – moewe Feb 18 '18 at 16:32
  • 2
    per-paper bib files are rather going against the design of both bibtex and biblatex, which are designed to extract the references needed for a paper from a larger bib database. (although sometimes if you need to submit "full sources" of a paper to a larger project, then extracting a subset bib file is needed, I agree) – David Carlisle Feb 18 '18 at 16:35
  • 1
    (3) What exactly do you mean by 'trimming unused entries'? Several tools can already extract only the cited entries from a larger .bib file (Biber, bibtool, even JabRef - I think). Or do you have something else in mind? In that case it is important to know how the software should detect unused entries. (4) I don't quite get what sort of aliasing feature you have in mind here. JabRef can apparently detect duplicates, but I'm not sure at what level. Finding duplicate keys may be simple, but finding duplicate entries with possibly varying degrees of detail seems really hard. – moewe Feb 18 '18 at 16:37
  • Maybe some examples might help to clarify the question, consiting of entries you currently have, citations in a document, and how you want the entries to look in the resulting .bib-file. – Marijn Feb 19 '18 at 09:56
  • 1
    My best guess is you are simply looking for a reference manager that suits your needs. I think you should test a few of the available ones and choose the most suitable one. Or write your own, if none of those fit your bit. – thymaro Feb 19 '18 at 11:41
  • Rather than dragging or moving your .bib files, keep them in a standard location which TeX/Biber/BibTeX knows how to find. Usually, that would be TEXMFHOME/bibtex/bib/ where TEXMFHOME is your personal tree e.g. the result of kpsewhich --var TEXMFHOME. – cfr Feb 19 '18 at 23:40
  • @cfr: At some point they have to appear as part of the set of files which makes up each paper I write - for distribution to others. But I suppose you could argue that their "master" version should be at that location. On the other hand, I'm having a hard time also with deciding which entry goes into which file; and I sometimes want to use different keys for the same document; and I want to be able to decide whether a paper gets shorter/longer names of conferences and months; whether I list the publisher or not; etc. So - .bib files must be intermediary product, not what I keep as the master. – einpoklum Feb 19 '18 at 23:50
  • 2
    Why? None of those reasons seem good reasons for the .bib not to be the master. The shorter/longer names stuff is the job of the style. Like @moewe I don't understand why you'd want to use different keys, if you mean different bib keys. If you mean something else, that is probably a style thing, too. I would say that it sounds as if you don't really get the point of a .bib file which is precisely to be a master repository, which does not determine which entries end up in a document or how they are formatted or which details are included. – cfr Feb 19 '18 at 23:54
  • 2
    '... I add entries manually, including making sure I like their format, removing fields I don't think I need, and even tinkering with spacing .' ??!! You don't format entries in the .bib file and you don't do anything to the spacing. At least, I suppose you might have to if, say, a title required 5 spaces between two words or something strange like that. But not otherwise. I don't even see how you could control these things in the entries themselves. Are you sure that these are actually .bib files and not just files you have given this extension? Can you give us an example entry? – cfr Feb 20 '18 at 00:00
  • You've tagged this biblatex. Is that what you're using? With Biber? How are you using it exactly? Again, please provide a minimal example. – cfr Feb 20 '18 at 00:01
  • 1
    Is there any news here? I guess there will never be a program that does what you need, as a bit of magic would be needed. – Johannes_B Feb 25 '18 at 12:00
  • 1
    A database should have data, as much as possible. If that data is used in the final output, is the job of a filter, with biblatex a certain style. – Johannes_B Feb 25 '18 at 12:01
  • 1
    Any news here? Could you state your question more precisely in light of the comments and questions you have received? There are several things I don't quite get about your desiderata here, so any updates would be appreciated. – moewe Mar 01 '18 at 11:00
  • Just to poke you about this again. Did you get any further? Can you help us understand what you want a bit better? Answers to the comments would be much appreciated. – moewe Mar 08 '18 at 21:46
  • @moewe: I tried JabRef, it was horrible/useless. But I will go over the comments again and edit the question accordingly. – einpoklum Mar 08 '18 at 21:50
  • Any chance of getting that update here? I still feel the question is a bit too unspecific on the exact requirements and is based on some misconceptions. – moewe Mar 19 '18 at 11:40
  • Any updates here? – moewe Apr 05 '18 at 07:13

1 Answers1

3

I'm not sure if I get all of your points, but let me try to answer at least parts of your question.

  • It is not a bad idea to have one big .bib file with all works that are of interest to you.

  • Choose sensible entry keys for all of your entries that you use in all papers. That makes it easier for you to recognise which entry is which even across papers.

  • Include all information in your main .bib file.

    • It is the job of your bibliography style (.bst file or biblatex style) to decide which fields get printed. If you think the output is too wordy, modify the style - don't modify the source. There should be no 'long-form' or 'short-form' of the same entry, there should just be one entry.
    • There may be one exception to that rule: LaTeX's bibliography styles can not automatically convert journals between long and short form for you. Solutions with varying degrees of automation are available (JabRef has a feature for that, you could use @strings, Biber, or one of these tools). These tools then allow you to export only a subset of the entries to a .bib file and may even allow for post-processing of the entries.
    • Do not tinker with spacing in your .bib file. Ad-hoc modifications should be a last resort

You don't even have to write that one huge .bib file by hand, you can use one of the many reference managers available (see LaTeX and bibliography management tools). I must say I prefer to write my .bib files by hand, but then I don't have a huge database yet.

There are several other tools for manipulation of .bib files. BibTool comes to mind, Biber can be used in a --tool mode as well (even though that is not the primary purpose of Biber). See for example Creating .bib file containing only the cited references of a bigger .bib file. People have written and released various tools to manipulate .bib files further.

In the comments it emerged that you are not a fan of JabRef, but at least formally it would tick almost all of your boxes. A possible alternative is Zotero together with https://retorque.re/zotero-better-bibtex/. But you could also look into helpers like https://github.com/nschloe/betterbib, https://github.com/pubs/pubs, https://github.com/rudrab/MkBiB, and https://github.com/bibcure/bibcure. You may not be able to find one software that does all of what you want in one go, but I'm quite confident that you can find an assortment of tools that can at least get you a little bit closer to a nicer solution for your bibliography.

Some programming languages have libraries for parsing .bib files, so in theory you could also code your own little helper.

moewe
  • 175,683