0

Is there some tool (disciple-specific or general) which takes as input a .bib file and shortens the entries, as much as possible? e.g.

  • Replacing given names with initials ("Smith, John" -> "Smith, J." and "John Smith" to "J. Smith")
  • Replacing journal and conference names with shorter versions (e.g. "Communications of the ACM" -> "Comm. ACM")
  • Shortens names of cities and states
  • Removes non-critical fields

I don't care whether the changes are in-place or to another file.

Note: I realize the bibliography style can take care of some of this, but - I want to work on .bib files themselves, plus, for the purposes of this question I don't have control of the bibliography style.

7
  • 4
    Why in the bib file? Let bib style decide how it looks Commented Aug 23, 2019 at 15:59
  • you knowing ctan.org/pkg/bibexport and github.com/yfpeng/pengyifan-bibtexformat? Commented Aug 23, 2019 at 16:00
  • JabRef does journal abbreviations help.jabref.org/en/JournalAbbreviations and while I'm pretty sure it is (or could easily be) powerful enough to do the other things as well I'm not sure if there are predefined functions that let you do the other jobs. Jobs 1 and 4 are usually handled by the bibliography style you use, so I'm not sure how many tools would be out there that offer functionalities like this. Commented Aug 23, 2019 at 16:09
  • @moewe: The thing is, I'm using a style that doesn't shorten names, or much of anything, but I do want shortening anyway. Commented Aug 23, 2019 at 16:52
  • 1
    Field deletion according to a data scheme would be possible with Biber in --tool mode (see in particular tex.stackexchange.com/q/415028/35864) and with bibtool. hsborges.github.io/bibtex-normalizer or github.com/sirrice/bibcleaner (never used them) might also be of interest Commented Aug 23, 2019 at 20:14

1 Answer 1

1

The best way to modify bib files is bibtool. Alternative you could write some simple shell scripts that use sed or awk like bibtools. Most name shortening are substitutions, which you are going to have to specify somewhere regardless of whether the tool exists or you create it. Although some standard ones like journal abbreviations you might be able to find such dictionary online. In the case of person names it can be done with a regular expression, e.g., with GNU sed:

echo "John Smith" | sed -E "s/([A-Z])[a-z]+\s([A-Z][a-z]+)/\1. \2/g"

produces J. Smith.

You can also change the style through packages options e.g., \usepackage[<options>]{biblatex} and that, if possible, would indeed be the best option.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.