bookends-tools icon indicating copy to clipboard operation
bookends-tools copied to clipboard

toBibTeX with BibTeX markup

Open htvogler opened this issue 4 years ago • 2 comments

Hi iandol, first of all thank you very much for taking care of this great toolbox!

I use the toBibTeX workflow quite often. My problem is that it doesn't export the references in BibTeX markup, which means that all formatting (italics, superscripts etc.) are lost.

With the dictionary-based scripting methods it has now become possible to export with proper BibTeX markup. I made some corresponding changes to the code. It's not done in the most elegant way, and I was also not able to get the "repeat while" loop running. For larger groups it is considerably slower than your version. Nevertheless, you may want to have a look at it and find a better way to integrate the changes.

Cheers, Hannes

toBibTeX_HV.txt

htvogler avatar Aug 21 '20 15:08 htvogler

Hi Hannes, when I get time I can have a look and see. Did you get an idea about what takes up so much time, is it just that the new dictionary methods are that much slower than the older events? What is the rough time difference?

I don't personally use the toBibTeX tool so much (Applescript leaks memory with large exports [my usual export is ~7000 references], so I normally do a manual export), so I may not get round to testing this soon...

iandol avatar Sep 01 '20 03:09 iandol

➜ time osascript toBibTeX.applescript Desktop 'Reviews'
osascript toBibTeX.applescript Desktop 'Reviews'  0.16s user 0.10s system 1% cpu 18.467 total
(base)

➜ time osascript toBibTeXD.applescript Desktop 'Reviews'
osascript toBibTeXD.applescript Desktop 'Reviews'  0.20s user 0.09s system 0% cpu 34.822 total
(base)

Your code: 34.8 secs vs. original 18.5 secs for 523 refs... The old code splits the export into chunks, which at least for the event system was much faster than trying to do it all in one go, I suspect this will also work.

@htvogler -- I did make some testing code with the newer interface a while ago (which is chunked, maybe this will be faster: https://github.com/iandol/bookends-tools/blob/master/source/newBibTeX.applescript

iandol avatar Sep 01 '20 04:09 iandol