Nov 9, 2012

Scientific Workplace + Endnote Tricks

Last update 2/13/2013

Share some recent discoveries with the software Scientific Workplace 5.0
  1. To work with Endnote. - this includes adding a 'Label' to the bib file using a convenient small Matlab function and in the Endnote the export 'bibtex style' you can remove the unwanted fields (like the 'note' field) that you don't want it to appreare in the typesetting bibliography library.
 Alright it is time to give the full story. Sorry for the late reply :p! Anyway. I don't know if bibDB in SWP(scientific workplace) fixed this problem yet. If not, then I guess it is still useful for me to write this down for those people fighting with this problem. If they did fix it, that's even better. Actually after I checked Mackichan website I found this written in 2006, which means they haven't fix it or it is still not a complete solution. So I think my post will still be useful.

 There is no problem using Endnote with SWP. The story behind is the following. SWP uses a bibiography software called BibDB which uses Bibtex bibliographic files standard to LATEX. Bibtex  uses a name tag called 'label' to recognize a citation when you insert a citation in SWP and/or when it is compiling. Every citation must have a unique 'label' name tag/ or field in its entry. The problem is when you export a citation from say web of science, normally it doesn't generate a label name tag, it is left emtpy, for other reasons. (You can verify this by downloading a citation from web of science and open that citation in your Endnote and  view it in Endnote with standard annotation style. Then look for the entry in the citation under the name 'label', it should be empty). So the thing is, you need to put a unique name under that entry, unique to that paper and to SWP, that will be the name tag for that paper to bibDB in SWP. Without that entry, bibDB in SWP won't be able to tell one citation from another. (In fact, when you are inserting a citation in SWP with the bibDB window, you actually select a citation by its label name.) That's the whole problem, now the next step, how to fix this?

 One simple, but temporary solution is, ok, I can manually type in a unique name for the label field for that citation in Endnote. That will work. You can try it. But if you already have a Endnote library with a few hundred citations in it, you will never reach there. Note that the label name has to be unique for every citation. This is easy to say then done. Because when you insert a citation in SWP you go by a citation's label name, you want to tell which citation you want to insert by looking at it's label name. You may say, OK, I can put a label name which looks like 'Schrodinger-2001-PRL' by author Schrodinger in year 2001 published in PRL, then it should be fairly simple to go through the whole library. Well another catch here, you will encounter cases where the same author publishes more than one paper in the same journal in the same year. Then you will have two different citations with the same label. That will not work in bibtex. Or maybe Mr. Schrodinger publish a paper and a book in 2001 and you will need two different labels for them because they should appear differently in the bibliography at the end of your document in SWP. That's why I say the label name has to be unique. Alright, so the label name has to be easy to recognize for us, and unique to bibtex in SWP. And if possible it will be great if we can automatically generate the label entries in the 300+ citations we already have in our bibtex library. This is where Matlab can come in and helps us.

 Jonas Almeida shared a neat Matlab program on the Matlab central file community. It is free to download. If you don't have Matlab and have Python installed on your computer, you can use a python code I wrote, see this post. What it does is it takes a few words from every field/entry in the citation, like name, year, title, reference type, and then combine those words to create a unique label for that citation. And you can run this program on a your 300+ citations bibtex library. Isn't that cool? It works! But it is almost impossible to beat the uniqueness problem that sometimes you still need to manually correct one or two cases that two different papers accidentally has same label created by this Matlab program. (That is the case where same author publishes two papers in the same journal in the same year with almost the same title, it really exists! So you need to manually change one label to make it different then the other).

 Alright, that is the story behind this. Next i will put the step by step procedure.

 When you export the your bibiography citation/library from Endnote in the style 'bibtex', they should have the following structure. Every citation will have this form

@article{
   Author = {de Almeida, J. S. and Carrico, J. A. and Maretzek, A. and Noble, P. A. and Fletcher, M.},
   Title = {Analysis of genomic sequences by Chaos Game Representation},
   Journal = {Bioinformatics},
   Volume = {17},
   Number = {5},
   Pages = {429-37},
(...)
    Year = {2001} }

The label field is right after @article{ , with the correct label inserted, it should look like this


@article{de_Almeida:2001-Analysis-of-genomic-seque,
   Author = {de Almeida, J. S. and Carrico, J. A. and Maretzek, A. and Noble, P. A. and Fletcher, M.},
   Title = {Analysis of genomic sequences by Chaos Game Representation},
   Journal = {Bioinformatics},
   Volume = {17},
   Number = {5},
   Pages = {429-37},
(...)
    Year = {2001} }

 So you just use the Matlab program to generate 'de_Almeida:2001-Analysis-of-genomic-seque' part after the string: @article{ . After you run this Matlab program on your bib file, open the bib file again the make sure the first letter is @, I found sometimes there will be an extra character before @, that will not work in SWP!!

Step-by-Step:
 First export your library in Endnote software using the  "BibTex"  export filter (download). Save your libray as *.bib, check the output file having the structure indicated above. Put the file in the Matlab searchable path (if you don't know about this simply put it in current matlab folder). In matlab command line run y=label_bibtex('*.bib',25), 25 is a parameter meaning you take k(=25) letters from the title to form the label. It will overwrite your *.bib file with the new one. Then copy this bib file and paste it in your Scienctific workplace bibtex library.

(2016/May)We are providing SWP/latex typesetting service! See this post here.

3 comments:

Opie said...

Hi, I' interested to know how can I use EndNote with Scientific Workplace. Can you please write up the steps needed for me to do so?
Basically, I'm writing in Scientific Workplace but I use EndNote as my citation manager.

torgrim said...

Hi! I am also interested in same as Opie, using EndNote with Scientific Workplace. Hope you can write about the steps needed. Have a nice weekend! :)

Tony said...

Hi Opie and Torgrim, I am not sure if you still need this, but I have updated my post on SWP + Endnote. Have you guys figure it out? Let me know if you have any comments, or if my explanation is not clear enough. I am still working on making it more clear, maybe I will add some figures and go step by step. Anyway, let me know how you think.