My CV is a Sausage Fest

My wired scientist friends have been discussing the massive bibliometric analysis by Vincent Larivière and colleagues that was published this week in Nature. The study analyzed gender disparity in academic publishing, focusing on research output, collaboration, and scientific impact by looking at all Web of Science-indexed articles published from 2008-2012:

We analysed 5,483,841 research papers and review articles with 27,329,915 authorships. […] We find that in the most productive countries, all articles with women in dominant author positions receive fewer citations than those with men in the same positions. And this citation disadvantage is accentuated by the fact that women’s publication portfolios are more domestic than their male colleagues — they profit less from the extra citations that international collaborations accrue. Given that citations now play a central part in the evaluation of researchers, this situation can only worsen gender disparities.

scientist-minifig

Well, that stinks. Post-doc Alex Bond of blog The Land and Field turns his attention to his own CV, noting that the ratio of women to men among his coauthors was 0.60 (27/45), a bit better than Canada’s average of 0.459.

Naturally I pulled up my CV and had a look. If I don’t count myself and count each coauthor once no matter how many times we’ve written a paper together, my ratio is a sad 0.2 (2/10). If I allow duplicates, because, for example my advisor and I have coauthored a few papers, the ratio worsens to 0.14 (2/14). This seems to be worse than most people sharing their ratios using the Twitter hashtag, #MyGenderGap. Therefore I should take steps to improve my ratio:

Hey, female monkey scientists! Let’s write a paper together!

(LEGO minifig photo by Flickr user Maia Weinstock.)

Adding Your Mendeley Publications to Your Website

With the power out for about a week in Lower Manhattan, I took the time to attend to some loose ends. One was the redesign of the lab website. The last major hurdle was the addition of a list of publications by lab members. I had previously used LaTeX and BibTeX to add my own publications from Mendeley to my CV, and I figured it’d be a snap to add the lab’s publications to our weebly website. It turned out to be a bit tricky, so I’ll detail how I figured it out in this post.

The lab site created using the free service weebly was shaping up. The only gaping hole was the list of publications. We had a Mendeley group for our lab to share papers relating to our current research, and a folder within that contained a bunch of references by lab members.

I selected all the publications and chose File > Export.

This exported a BibTeX file of all our publications in entries that look something like this:

@article{Jolly2011,
abstract = {The ranges of small kinda (Papio kindae) and [...]},
author = {Jolly, Clifford J. and Burrell, Andrew S. and Phillips-Conroy, Jane E. 
and Bergey, Christina M. and Rogers, Jeffrey},
doi = {10.1002/ajp.20896},
file = {:path/to/Jolly2011.pdf:pdf},
issn = {1098-2345},
journal = {American Journal of Primatology},
keywords = {Animal,Animals,DNA,Female,Genes,Genetic,[...]},
month = mar,
number = {3},
pages = {291--303},
pmid = {21274900},
title = {{Kinda baboons (Papio kindae) and grayfoot chacma baboons (P. ursinus 
griseipes) hybridize in the Kafue river valley, Zambia.}},
url = {http://www.ncbi.nlm.nih.gov/pubmed/21274900},
volume = {73},
year = {2011}
}

OK, so I’d gotten the info out of Mendeley, but now I needed to get it into a nice HTML format. I poked around online and found people were recommending a Java reference manager called JabRef. I downloaded it and opened up my BibTeX file.

Looks good! Yeah, there are a few errors and inconsistencies, but this is just a first pass. I first tried the default export to HTML. Selecting File > Export, though, showed four different HTML options: HTML, HTML list, HTML table, HTML table (with Abstract & something else I can’t read), and Simple HTML.

I tried them all, but none was really what I wanted. The HTML list was neat, but weebly doesn’t let you muck with custom scripts or CSS, so that one was out. With a bit of Googling, I found that you can customize the export format by writing your own Export Filter. Essentially what you do is write a layout file which tells JabRef how to spit out the HTML. Whenever I’m in unfamiliar coding territory, I like to start out with a working example and then try to modify it to do my bidding without breaking everything. I found a simple HTML export filter at this site by Mark Schenk. I chose as my starting point his List of References Export Filter, which you can download here. Since I was going to be inserting the HTML in an existing page, I ignored the files that defined the start and end of the exported HTML, listrefs.begin.layout and listrefs.end.layout. I only downloaded listrefs.layout, which I renamed bergey.layout on my harddrive.

I decided to try it without modification first, just to see what happened. I first had to add this custom Export Filter to JabRef. To do that I clicked Options > Manage custom exports. I then clicked Add new and entered this info:

…with a real path to bergey.layout, of course. That done, I then went to File > Export. I gave my exported file a name, in this case “test” and chose bergey_lab_site (*.html) as my File Format.

It worked, but when I opened up test.html in my web browser, there was a bunch of extra stuff I didn’t want. The full abstract, the raw BibTeX, and links that should have toggled the abstract and BibTeX (which didn’t work because the JavaScript in the header wasn’t output because I hadn’t used listrefs.begin.layout.) There was also a link to the PDF, which pointed to a location on my local computer.

It was time to start cutting bits out, so I opened bergey.layout in a text editor. I then deleted the highlighted parts shown below:

Saving, re-exporting from JabRef, and refreshing the page in the browser showed that doing so got rid of the abstract and BibTex text, but the unwanted links remained. To fix that, I changed this line in bergey.layout:

<p class="infolinks">
\begin{abstract}[<a href="javascript:toggleInfo('\format{\bibtexkey}',
'abstract')">Abstract</a>]\end{abstract}
\begin{review} [<a href="javascript:toggleInfo('\format{\bibtexkey}',
'review')">Review</a>]\end{review} 
[<a href="javascript:toggleInfo('\format{\bibtexkey}','bibtex')">
BibTeX</a>]
\begin{doi} [<a href="\format[DOICheck]{\doi}" target="_blank">
DOI</a>]\end{doi}
\begin{url} [<a href="\format{\url}" target="_blank">URL</a>]\end{url}
\begin{file} [<a href="\format[WrapFileLinks(\r,,pdf)]{\file}" 
target="_blank">PDF</a>]\end{file}</p>

to this (without line breaks):

<p class="infolinks">\begin{doi} [<a href="\format[DOICheck]{\doi}" 
target="_blank">DOI</a>]\end{doi}\begin{url} [<a href="\format{\url}" 
target="_blank">URL</a>]\end{url}</p>

Essentially getting rid of the abstract, review, BibTeX, and file links, but leaving those for DOI and URL. I cleaned things up a bit more, deleting some extraneous punctuation and line breaks, and changing the formatting. After all the tweaking, my bergey.layout file looked like this:

<tr id="\format{\bibtexkey}" class="entry">
	<td><p>\begin{author}\format[Authors(LastFirst,NoPunc,InitialsNoSpace),HTMLChars]{\author}\end{author} (\year). "\format[HTMLChars]{\title}"\begin{journal} \format[HTMLChars]{\journal}.\end{journal}\begin{booktitle} In \format[HTMLChars]{\booktitle}.\end{booktitle}\begin{howpublished} \howpublished.\end{howpublished}\begin{school}. Thesis at: \format[HTMLChars]{\school}.\end{school}\begin{address} \format[HTMLChars]{\address}\end{address}\begin{month} \format[HTMLChars]{\month}, \year.\end{month} \begin{volume} \volume\end{volume}\begin{number}(\format[FormatPagesForHTML]{\number})\end{number}\begin{pages}, \format[FormatPagesForHTML]{\pages}.\end{pages}
	\begin{doi} [<a href="\format[DOICheck]{\doi}" target="_blank">DOI</a>]\end{doi}\begin{url} [<a href="\format{\url}" target="_blank">URL</a>]\end{url}</p>
	</p></td>
</tr>

which output HTML that looked like this:

Not bad! A few errors remain, but mostly from needing to correct info in Mendeley. However, I want things sorted by year, not last name, even though that’s better for us alphabetically blessed first authors. Having JabRef sort by year on export rather than by Author last name is accomplished using the preferences menu, found at Options > Preferences and the selecting the File window. There you can chose to “Export in current table sort order” (click to embiggen):

I sort by year by clicking above the year column. The exported HTML is the same order as is in my JabRef screen. Nice! Now what if I could add a header for each year? That is pretty simple, I just add a grouped output command to the top of my .layout file. I’ll put the year above each group as an <h3> element:

\begingroup{year}<h3>\format[HTMLChars]{\year}</h3>
\endgroup{year}

Finally! All done! My bergey.layout file is this:

\begingroup{year}<h3>\format[HTMLChars]{\year}</h3>
\endgroup{year}
<tr id="\format{\bibtexkey}" class="entry">
	<td><p>\begin{author}\format[Authors(LastFirst,NoPunc,InitialsNoSpace),HTMLChars]{\author}\end{author} (\year). "\format[HTMLChars]{\title}"\begin{journal} \format[HTMLChars]{\journal}.\end{journal}\begin{booktitle} In \format[HTMLChars]{\booktitle}.\end{booktitle}\begin{howpublished} \howpublished.\end{howpublished}\begin{school}. Thesis at: \format[HTMLChars]{\school}.\end{school}\begin{address} \format[HTMLChars]{\address}\end{address}\begin{month} \format[HTMLChars]{\month}, \year.\end{month} \begin{volume} \volume\end{volume}\begin{number}(\format[FormatPagesForHTML]{\number})\end{number}\begin{pages}, \format[FormatPagesForHTML]{\pages}.\end{pages}
	\begin{doi} [<a href="\format[DOICheck]{\doi}" target="_blank">DOI</a>]\end{doi}\begin{url} [<a href="\format{\url}" target="_blank">URL</a>]\end{url}</p>
	</p></td>
</tr>

which outputs this HTML:

If I view source in the browser, or open the .html file in a text editor, I can see the raw HTML. I can now take the HTML and paste it onto my weebly site, using their Custom HTML element:

Ta-da! Not too onerous. Whenever new papers are published, it’s just a simple matter or adding them to the Mendeley group, ensuring their bibliographic info is correct, exporting the group’s contents as a BibTeX file, opening that file in JabRef, and exporting it using the custom filter I wrote. You can see the lab’s site here, which we’ll eventually give an NYU URL using an .htaccess 301 redirect. Hope this (long winded) tutorial is of use to someone out there!