Extracting Only Cited Bibliography Entries

Occasionally, while exchanging files with collaborators or submitting articles, I’d like to extract a smaller .bib file from my main, “hold-all” bibliography file, i.e. containing only the entries that I’d actually cited in my document.

Fortunately this can be done fairly automatically using the bibexport tool. Quick rundown:

  1. Compile your document, say myarticle.tex the usual way, with your “big” allrefs.bib file.
  2. Run bibexport with the following:
    bibexport -o extracted.bib myarticle

    extracted.bib should now contain only the bibliography entries that were cited in myarticle.tex.

  3. Change \bibliography{allrefs.bib} to \bibliography{extracted.bib} in myarticle.tex.
  4. Send myarticle.tex and extracted.bib to collaborator or editor!

Converting an EndNote Database to BibTeX

During a recent LaTeX introductory workshop, many participants said that they’re very much looking forward to using LaTeX for their future writings, but mentioned that there didn’nt seem to be an obvious way of porting their existing EndNote bibliography libarary into BibTeX format.

EndNote does have an “Export BibTeX” filter, but it doesn’t seem to generate satisfactory BibTeX files. After some googling, I found Bevan Weir’s customised export filter, which does a much better job than EndNote’s default. I modified his filter file a little bit more, and was able to convert an EndNote bibliography library to BibTeX with the following steps.

I tested this with EndNote X5 on the Mac, with JabRef 2.7, but they should also work with Windows versions. %ENDNOTE% refers to the path where EndNote is installed on your system.

  1. Put BibTeX_Export_LLT.ens (download) in %ENDNOTE%/Styles/ .
  2. Start EndNotes, and load your library.
  3. Make sure the new style is listed:
    Edit > Output Styles > Open Style Manager
    Make sure BibTeX_Export_LLT is checked.
  4. File > Export
    Make sure Save File as Type is set to Text Only, and Output Style is set to BibTeX_Export_LLT.
  5. Save your file and check that it has a .bib extension.
  6. Open the exported .bib in JabRef. There will be a whole bunch of errors about corrupted or empty BibTeX keys; don’t worry. Just click OK.
  7. Ctrl+A to select all the BibTeX entreis, Tools > Autogenerate BibTeX keys.
  8. Check through the BibTeX entries, especially those highlighted red, to check and correct any crucial information loss.

And hopefully the converted bibliography file is now usable enough.

Converting BibTeX to EndNote format

You might somehow need to submit your research findings in a journal which however, needs you to submit compulsively in Microsoft Words format.
If your institution is subscribing to EndNote, perhaps you might want to install them, at least, in Wine on top of your Linux machine
For easy convertion from *.bib file to EndNote importable format (XML).. use this software, bib2endnote

Unexplained error

I faced this kind of error before. What I mean by unexplained is that the location of error shown by Lyx does not contain any error. Sometime it is just one word without any LaTeX command at the location. By the way, I should mention for the benefit of newcomer, Lyx will highlight the supposedly error location. In this case of error, the highlight is at random location and you can explain what is the actual error. The unexplained error usually occurs, at least I experienced it, once I include a citation. I use BibTeX to generate reference list. The .bib file is linked to the Lyx file and once a citation is included, BibTeX will run the process of creating the list. Error will occur if the bib database contains error, usually it has an illegal character. You know, citation info can be exported directly from publisher’s webpage or even from Google Scholar page. The auto export function is the culprit of the error. Some of the article title or even the name of authors can have illegal characters. Most of it is characters like % and &, which is the command character in LaTeX. So, the errors can be overcomed by making sure that the bib database doesn’t have any of this illegal characters. That will it for now. See you soon!

Published with Blogger-droid v1.7.2