I'm becoming a TeXist by profession these days. This is the first real challenge from my new employer: I was asked if I could take a look at this problem and improve the current state, if it's possible at all.

We are typesetting some journals and we are getting references already typesetted (BBL or references typesetted in the thebibliography environment). I tried to parse such an input back to its fields many years ago and it's not working well.

My plan is to start requesting the BIB files from the authors (the authors have them, that's what I believe) and process them into a known TeX structure of the journal, e.g. \myauthor, \mytitle, (see an example below)... After I process the AUX file (or the TeX file and the \cite* commands) I'd be able to filter out entries from the BIB file.

  • I was thinking to use BibTeX directly, but the language is not to my liking.
  • I'm also considering BibLaTeX, but my knowledge about this tool is still limited.
  • There are some interesting tools and scripts for processing AUX files and there is also fred available, :-), for processing BIB files.
  • It might be easier to convert BIB files to CSV/TSV/DAT/JSON/SQL file first and then work with it afterwards. I was thinking of tools like JabRef and similar ones. But I'm not sure if these tools work from the command line.

I'll be happy to inform you about my progress, my current plan and first thoughts are to use Lua and try to:

  • Process AUX file, I'd be able to say if I have all references I'm referring to.
  • Process BIB file (or generated CSV file out of it...), sort entries in relation to the AUX file, if necessary, sort fields per reference type, if necessary, and polish as many things as possible to save people as many time as possible.

If the script would be working (I parsed nested parentheses several times), I should be getting the structure of this kind from the BIB file. The current state could be improved significantly, I hope, because several employees are parsing BBL/thebibliography manually. They won't lost their jobs even if such a script would work perfectly, because there will be some authors who will send references typesetted in the thebibliography environment no matter what.

\no 6
\by K.-J.\,Engel, R.\,Nagel
\book One-Parameter Semigroups for Linear Evolution Equations
\publ Graduate Texts in Mathematics 194
\publaddr Springer, Berlin
\yr 2000
\ZBL 0952.47036
\MR 1721989

\no 7
\by W.\,Greenberg, C.\,van der Mee, V.\,Protopopescu
\book Boundary Value Problems in Abstract Kinetic Theory
\publ Operator Theory: Advances and Applications 23
\publaddr Birkh\"auser, Basel
\yr 1987
\ZBL 0624.35003
\MR 0896904

\no 8
\by E.\,Hille, R.\,S.\,Phillips
\book Functional Analysis and Semi-Groups. rev. ed
\publ Colloquium Publications 31
\publaddr American Mathematical Society, Providence
\yr 1957
\book Functional Analysis and Semi-Groups. 3rd printing of rev. ed. of 1957
\publ Colloquium Publications 31
\publaddr American Mathematical Society, Providence
\yr 1974
\ZBL 0392.46001
\MR 0089373

I wanted to ask you about your experience with different tools, I welcome comments and recommending links.

  • 1
    Parsing BibTeX 'properly' is non-trivial. As BibTeX and for example the Perl module TeX::BibTeX can both do this, I'd be strongly tempted to use a tool other than TeX for the parsing and then write whatever format you want out as a .bbl or whatever. – Joseph Wright Jun 6 '14 at 9:58
  • 1
    You should also take look at biblatex; its essential method is to make entries from .bib file fields available to LaTeX via LaTeX commands. You might also like to look at how it interacts with biber which is actually parsing the .bib file. – Paul Stanley Jun 6 '14 at 11:43
  • 2
    You can also take a look at the Bibulous project [github.com/nzhagen/bibulous], which contains a complete BibTeX parsing engine inside. – nzh Jun 6 '14 at 13:06
  • 1
    It is not quite clear what you want to later on with the parsed bib entries but I would at first consider to use biblatex/biber: You only need look at a bbl created by biber to see that it has a very sane structure and can be used for all sort of things (I'm e.g. using it to manage addresses). – Ulrike Fischer Jun 6 '14 at 13:21
  • 1
    you might take a look at amsrefs. there's a mechanism to convert from .bib format to amsrefs (although not the reverse), and it's not too difficult to set up a "formatter" to match your desired style (several examples are provided). if you have access to mathscinet, using the information from the author's bibliography, a properly-coded entry in either bibtex or amsrefs format can be obtained if the item is in the database. – barbara beeton Jun 6 '14 at 13:28

Your Answer

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

Browse other questions tagged or ask your own question.