text2bib

Convert from plain text to BibTeX

Enter your plain text references into the 'text' field, one per line. If you are copy and pasting and the references span multiple lines, put an empty line in between references and tick the 'Plain text entries span more than one line' box.

Enter the formats you want to try in the 'format' field, one per line. The first one that matches will generate your BibTeX version of that reference.

You can select pre-written formats from the format library. If you're writing your own format, you may like to turn on the debugging feature, which will tell you where a match fails.

It is advised that you check through your final BibTeX reference before using it - text2bib is probably not as clever as you.

Format syntax

Each format is made up of fields and markers:

  • Field syntax is %FIELD%, where FIELD is the name of the BibTeX field you expect to find at this position. It can be any word containing any character apart from % or /.
  • There are two types of magic fields which do not match - comments and a type definition.
  • Comments start with a !: %!comment%
  • A type definition starts with a @: %@type%. The default type is article.
  • Other fields can be set to match a certain regular expression, by adding /REGEXP to the end of FIELD; %author/.*?% for example.
  • Regular expression syntax is the same as that of Perl - for more details, see perldoc.perl.org (external link).
  • Normal fields are not greedy; the format %a%- on the text 2005-10-28 will match 2005. To match 2005-10 you will need to use a more greedy regular expression.
  • Anything that is not a field is treated as a marker - an area of text that will always be present to delimit the fields.
  • To escape a % in a marker, put a \ before it.
  • A regular expression field can be used as markers by not giving it a field name; %/.*?% for example. If two fields are next to each other, at least one must be a regular expression.
  • Take care when defining your markers, since they should be unique to that area - using a single period to delimit an author field would be foolish since it would also match initials.

Example.

To convert:

1. Name. A. B., Name, C., (2005). Title of paper, Journal, 17(5):475-483
with BibTeX type inproceedings, use the format:
%@inproceedings%%/d+%. %author%, (%year%). %title%, %journal%, %volume%(%issue%):%page%

Other information

Output order:author, title, address, annote, booktitle, chapter, edition, editor, howpublished, institution, journal, key, month, note, number, organization, pages, publisher, school, series, type, volume, year
Cite key:%author|first word%%year%
If this information is not available, it will default to citekeyRAND, where RAND is a random (hopefully unique) number.
Format:

Format library

  1. %/\d+\. %%author%. (%year%) %title%, in %journal%%/\.(?! and)% %publisher%.
  2. %@inproceedings%%/\d+\. %%author/.+?(?<!\b.)%. %title%. In Proceedings of %booktitle%. %address%. pp. %pages% %year%
  3. %/\d+\. %%author%, %year/\d{4}%, .%title%., %journal%, %note%
  4. %/\d+\. %%author%. %year%. %title%. In %journal%. %/.+?%. %publisher%, %address/.+,.+%, %pages%
  5. %/\d+\. %%author%. (%year%). %title%, %address%.
  6. %@inproceedings%%/\d+\. %%author%%/\. \(%%year%) %title%. In Proceedings of %booktitle%. %address/.+?,.+?%, %notes%, pp. %pages%
  7. %@inproceedings%%/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. In Proc. %booktitle%. %address% (%year%), %pages%.
  8. %@inproceedings%%/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. In Proc. %booktitle%, %journal% %volume%(%issue%), %pages%.
  9. %/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. %booktitle%, %/\d{1,2} \w+ %%year/\d{4}%.
  10. %@inproceedings%%/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. In Proc. %booktitle%.
  11. %@inproceedings%%/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. In Proc. %booktitle%, %pages/[\d-]+%.
  12. %/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. %booktitle% (%year%), %pages%.
  13. %/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. %booktitle/.+?(?<!\b.)%. %publisher% (%year%).
  14. %/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. %publisher% (%year%).
  15. %/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. %booktitle/.+?(?<!\b.)%. %publisher%. (%year%) %pages%.
  16. %/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. %booktitle% (%year%) %pages%.
  17. %@inproceedings%%/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. %booktitle/Workshop .+%.
  18. %@inproceedings%%/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. Proc. %booktitle%, %journal% %volume%(%issue%), %pages%.
  19. %/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. %booktitle%, %pages/[\d-]+%.
  20. %@inproceedings%%/(\[\d+\] )?%%author/.+?\.(?! and)% %title%. Proc. %booktitle%.
  21. %@book%%title% - %author% - %publisher%
  22. %@book%%title%. %author% - %publisher% -
  23. %@book%%title% – %author% – %publisher%
  24. %@book%%title% – %author%, %publisher%
  25. %@book%%title%. %author% - %publisher% –
  26. %@book%%title%. %author% - %publisher%-
  27. %@book%%title% - %author%- %publisher% -
  28. %@book%%title%. %author% -%publisher%
  29. %@book%%title%. %author%. -%publisher%
  30. %@book%%author% : %title% - %publisher% –
  31. %@book%%title% - %author% – %publisher%
  32. %@book%%title% – %author% - %publisher%
  33. %@book%%title%- %author% – %publisher%
  34. %@book%%author%, %title%, %publisher%, %address%, %year%
  35. %@inproceedings%%author%, (%year%). %title%, %journal%, %volume%(%issue%):%page%
  36. %@inproceedings%%author%, "%title%," %journal%, vol.%volume%, no.%issue%pp.%page%, %month%.%year%
  37. %@inproceedings%%author% (%year%) %title%. %journal%, %volume%,%page%.
Text:
Optional: