mergetex script updated

I ported the mergetex script from perl to python and posted it on github, for those who are interested. It scans recursively though a large LaTeX project and generates a single .tex file suitable for uploading to ArXiV (with comments stripped out). I probably should have have branched from Manu’s though, oops. Ah well. There are lots of versions of this thing out there, so no claims to elegance here.

A related question (which I gave up on after a short attack) was how to generate a regular expression that matches the first part of a line of LaTeX before a comment. The trick is that \% is escaped, so you want

There is a 95\% chance that I am bad at regexps % DUH\n

to return

There is a 95\% chance that I am bad at regexps %

and

There is a 95\% chance that I am bad at regexps % DUH more like 99\%\n

to return

There is a 95\% chance that I am bad at regexps %

but

There is a 95\% chance that I am bad %at regexps % DUH more like 99\%\n

to return

There is a 95\% chance that I am bad%

Some sort of negative lookbehind is needed but I got confused and decided to do something less efficient.

Advertisement

BibTeX bleg

I have written a little standalone script in python that parses a LaTeX file with \cite{} commands and the relevant BibTeX file and produces:

  • formatted HTML suitable for dropping into your homepage
  • individual .bib files for each paper
  • linking to archival versions via a DOI reference or URL
  • linking to a local pdf via the local-url field

The point was to make updating the publications on your homepage just epsilon more difficult that updating a BibTeX file/your CV. Of course, this is moot for people who have other folks to update their pages, but for us plebes, it could save a little hassle.

Clearly you could customize the output format to your needs. However, at the moment it’s not very robust (or efficient, or pretty). I’d like to test it out on likely readers of this blog’s personal .bib files to make it useful before sticking it on github. A subset of readers of this blog are likely to be people who might use such a thing, I’d like to know what your .bib files look like. Because BibTeX has a fair bit of variability, I am pretty sure that I did not catch most of the corner cases in my regexps.

So if you are interested, please do send me a representative file to my TTIC address. Thanks a ton!