BibTeX, biblatex and biberBibtex Journal Title Abbreviation

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
Pasharen
Posts: 2
Joined: Mon Jun 27, 2011 10:42 am

Bibtex Journal Title Abbreviation

Post by Pasharen »

Hi...
I would like to specify rules for abbreviation in bibtex files.
This could for example be used to alter existing bibtex files or bibtex files automatically generated by Zotero or through web of knowledge.
For example if one has a bibtex database like the following

Code: Select all

@article{Author2011,
   author =  {Author},
   title =   {Test title},
   journal = {Physical Review B},
   year =    2011,
}
I would like to replace {Physical Review B} by {Phys. Rev. B}.
This cannot be done by a string, since this does not allow for spaces.
Eg. I can alter journal = PhysRevB and then use @string{PhysRevB="Phys. Rev. B"}.
However, this needs altering of jornal names for all entries.
Is there a way around this?
That is; can one define rules such that {Physical Review B} is replaced with {Phys. Rev. B} without altering it manually?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Bibtex Journal Title Abbreviation

Post by kaiserkarl13 »

How about this:

In the file, enter something like

Code: Select all

@string{prb = "Phys.\ Rev.~B"}
or whatever you want the abbreviation to be, and then issue this:

Code: Select all

  $ sed -i 's/["{]Physical Review B["}]/prb/g' references.bib
where "references.bib" is the name of your BibTeX database. This will go through, in one step, and replace every occurrence of "Physical Review B" with "prb".

If you're nervous about preserving the original until you're sure, get rid of the '-i' in the above command.

If you update your database later, just run the sed command again. If you don't have sed, you can use a search-and-replace command in a text editor instead.

I maintain two databases of journal name abbreviations (in separate files from the "real" entries) that I use in all of my BibTeX entries. If the journal/book wants abbreviated names, I use abbreviated.bib; if it wants full names, I use full.bib. The string substitutions allow you to do this; other methods do not.
josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

Re: Bibtex Journal Title Abbreviation

Post by josephwright »

While there are programmatic approaches in BibTeX and LaTeX, I'd recommend using a BibTeX database manager such as JabRef to do the replacement.
Joseph Wright
Pasharen
Posts: 2
Joined: Mon Jun 27, 2011 10:42 am

Re: Bibtex Journal Title Abbreviation

Post by Pasharen »

Thanks for the good answers.
After your comments I found a bash script doing what you suggests kaiserkarl13.
Other people having the same problem as me can find the code here:
http://www.latex-community.org/forum/vi ... =44&t=6565
and change the sed command to fit their bibtex.
Otherwise how to import a list of journal abbreviations in JabRef is decribed here:
http://academic.reed.edu/physics/course ... ports.html
Post Reply