1

I have 30 years of bibtex in a file with some other notes. Bibtex doesn't mind, but biblatex does. Also, certain publishers (Nature, APA, MIT) don't provide bibtex but do provide dois or ris. I've looked at bibdesk & zotero, but they also are too upset by my file that bibtex does fine on. Is it crazy of me to hope that something or somethings

  1. just parses the parsable bits of the file & then supports biblatex
  2. takes things out of .ris or dois or whatever and then puts it nicely at the end of my ascii file and doesn't try to tidy everything else up (let alone change my labels)?

Obviously, anything that does either of these would be great.

11
  • Can you be more specific than "upset by my file" with regard to BibDesk? Does it open the file with warnings or errors? The parser should skip junk at the top level if you have comments mixed in. Sep 28, 2014 at 16:36
  • I haven't found any regularity, no. It gets through about 70,000 lines of mixed plain text, corrupt and correct bibtex entries, then bails at the first plain text or incorrect bibtex entry. All I need is for it to continue reading the correct bibtex entries & ignore the rest. Sep 28, 2014 at 16:43
  • 1
    "Plain text" will not cause it to bail. You'll get a warning (not an error) message about "xx characters of junk seen at toplevel". Now if you have syntactically invalid BibTeX entries, it will stop parsing on those, and give you a chance to quit, edit the problematic entry, or keep going. I do not understand what you mean by "bails." Sep 28, 2014 at 16:48
  • Yes, it gives a bunch of warnings, but at some point it gives an error and just stops. Usually about something silly like ascii encoding or not having label for the bibtex entry, or having used the @comment thing. Sep 28, 2014 at 17:51
  • Did you try JabRef? Sep 28, 2014 at 17:58

1 Answer 1

2

I'll answer this from the standpoint of what BibDesk is supposed to do, since it was mentioned specifically in the original question.

Here is the content of the example.bib file I'll be using for this demonstration:

@comment{Here is a comment}

As far as BibTeX is concerned, this is also a comment.

article{test1,
  title = "This is missing the opening token, so will be a comment",
  year = 2014,
  author = "Weiser, Bud",
  journal = "Irreproducible Results"
}

@article{test2,
  title = "This is a legitimate entry",
  year = 2014,
  author = "Weiser, Bud",
  journal = "Irreproducible Results"
}

@article{,
  title = "This is a broken entry",
  year = 2014,
  author = "Loon, Some",
  journal = "Irreproducible Results"
}

@article{test3,
  title = {This is another legitimate entry},
  year = {2014},
  month = sep,
  author = {Ann Author},
  journal = {Irr. Res. J.}
}

Syntax Problems

If I open this file in BibDesk, it brings up an alert with three options.

  1. Edit File
  2. Keep Going
  3. Give Up

Edit File

If you choose "Edit File", it will open a text editor with your file contents (not shown; in the graphic, I'm using TextMate). Double-clicking a row in the list of warnings and errors will take you to the offending row, where you can edit and then try again.

Keep Going

If you choose "Keep Going", it will proceed to the next error, or open the file in the usual manner (you'll see a list of references). This basically ignores syntax errors, when possible. I don't recall if all errors are ignorable.

Give Up

The final option is self-explanatory. This is where you bail out and fix the problems yourself in a text editor.

BibDesk Parsing Error dialog

Encoding Problems

Encoding problems are separate from syntax issues, but commonly confused. To set a specific encoding to be used, choose "Open File…" from BibDesk's File menu, and set the appropriate encoding. If you don't know what it is, it's safe to choose ASCII, as you'll get an error if non-ASCII characters are encountered. It does not try to guess encoding! If you want to open the file anyway and risk data corruption, use a gapless encoding such as Mac OS Roman, or one of the common Windows encodings.

RIS

RIS data should be treated as comments/junk, unless it contains an @ character; in that case, you're going to see hard-to-decipher errors, and the line numbers may not be all that helpful. In general, though, mixing RIS data in with BibTeX is a really bad idea, even if bibtex allows it.

Dangers

A program that does exactly as requested by the OP will by definition lose data, and most responsible programmers try really hard to avoid this. Failing with syntax errors is a feature, and one that keeps you from losing your tediously-entered, hard-to-find data!

1
  • Yeah, my problem is the "keep going" stops going at an arbitrary point. Generally it seems an awesome tool. It certainly does seem more robust than zotero & jabref. I've got bibclean installed now (there was a 2014 update!) but am nervously going over the options -- it also seems to be doing some odd things by default (e.g. messing up "van Schaik, Carel") Sep 28, 2014 at 20:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.