Importing from .tex file to JabRef

I don't want to individually create entries in JabRef because I already have my bibliography present in my .tex file. It currently looks like this in the .tex file:

\begin{document}

\maketitle

\begin{abstract}

\end{abstract}

\section{Introduction}

...

\begin{thebibliography}{99}

\bibitem{Ah88} S.\ Ahn, C.\ Cooper, G.\ Cornu\'ejols \& A.M.\ Frieze (1988) Probabilistic
analysis of a relaxation for the $p$-median problem. {\em Math.\ Oper.\ Res.}, 13, 1--31.

\bibitem{BMW89} A.\ Balakrishnan, T.L.\ Magnanti \& R.T.\ Wong (1989) A dual-ascent
procedure for large-scale uncapacitated network design. {\em Oper.\ Res.}, 37, 716--740.

etc

\end{thebibliography}

\end{document}


I've come to realise that this is not the best way to handle references, so I want to put it all in a .bib file using JabRef (or otherwise). Will really appreciate some help.

• This is probably very hard to do - maybe you can use a scripting language with regular expressions (like Perl) to recreate the entries automatically. However, it might be easier to try to find the original '.bib' file which was used to create the bibliography. – Marijn Feb 28 '18 at 19:20

1) Copy only the \bibitem list to a new file. That is:

\bibitem{Ah88} S.\ Ahn, C.\ Cooper, G.\ Cornu\'ejols \& A.M.\ Frieze (1988) Probabilistic
analysis of a relaxation for the $p$-median problem. {\em Math.\ Oper.\ Res.}, 13, 1--31.

\bibitem{BMW89} A.\ Balakrishnan, T.L.\ Magnanti \& R.T.\ Wong (1989) A dual-ascent
procedure for large-scale uncapacitated network design. {\em Oper.\ Res.}, 37, 716--740.


2) Go to text2bib web site

3) Register/login if you a new/old user.

4) Once logged, you will need upload your file and ask some question about labels, line ending style, character encoding, language, if first component of each item are the authors, etc. Then click on "Convert to BibTeX".

5) Then you will see if fields of the first reference are well recognized. At this point you can ignore (skip) this entry, modify some field, or simply add the reference to Bibtext and go with the next entry.

Without any manual modification this is the result with the above bibitems:

@article{Ah88,
author = {S. Ahn and C. Cooper and G. Cornu\'ejols and A. M. Frieze},
journal = {Math. Oper. Res},
pages = {1-31},
title = {Probabilistic analysis of a relaxation for the $p$-median problem},
volume = {13},
year = {1988},
}

@article{BMW89,
author = {A. Balakrishnan and T. L. Magnanti and R. T. Wong},
journal = {Oper. Res},
pages = {716-740},
title = {A dual-ascent procedure for large-scale uncapacitated network design},
volume = {37},
year = {1989},
}


6) Save the output as yourname.bib and check if JabRef can load it without errors.

In case you have the PDF, you can currently create the entries one by one in JabRef using the New entry from plain text functionality. JabRef thereby uses the service offered by FreeCite. There is https://anystyle.io, but it is not yet integrated in JabRef [koppor#315].

Example:

O. Kopp, A. Armbruster, und O. Zimmermann, "Markdown Architectural Decision Records: Format and Tool Support", in 10th ZEUS Workshop, 2018.

1. Click BibTeX and select ""New entry from plain text..." Alternatively, you can press Ctrl+Shift+N.

1. Select an entry type. Select "InProceedings", this works in the most cases

1. The "Plain text import" window opens

1. Paste the entry using the middle button "paste"

1. Click on "Parse with FreeCite"

1. The entry editor opens with the parsed result:

Repeat the steps for each entry.

You can directly use AnyStyle.io. I would base it on the PDF. If you cannot generate the PDF, you can also base it on the \bibitems, but you'll gat malformed authors:

1. Create a text file without \bibitem containing the references:

S.\ Ahn, C.\ Cooper, G.\ Cornu\'ejols \& A.M.\ Frieze (1988) Probabilistic analysis of a relaxation for the $p$-median problem. {\em Math.\ Oper.\ Res.}, 13, 1--31.

A.\ Balakrishnan, T.L.\ Magnanti \& R.T.\ Wong (1989) A dual-ascent procedure for large-scale uncapacitated network design. {\em Oper.\ Res.}, 37, 716--740.

2. Paste it into anystyle

1. Click on "Parse 2 references"

2. Click on BibTeX

Result. Note that the authors are not in BibTeX format.

@article{ahn1988a,
author = {},
title = {G.\ Cornu\'ejols \& A.M.\ Frieze},
date = {1988},
journal = {{\em Math.\ Oper.\ Res.}},
volume = {13},
pages = {1–31},
source = {Probabilistic analysis of a relaxation for the $p$-median problem},
language = {nl}
}
@article{balakrishnan1989a,
author = {},
title = {T.L.\ Magnanti \& R.T.\ Wong},
date = {1989},
journal = {{\em Oper.\ Res.}},
volume = {37},
pages = {716–740},
source = {A dual-ascent procedure for large-scale uncapacitated network design},
language = {en}
}