Sunday, 11 September 2011

Alternately coloured line environment with fancyvrb

Recently, while typing up an R tutorial, I used the LaTeX fancyvrb package to create two environments—one coloured blue for R commands, and one coloured red to display R output. This worked well for large blocks of each type. Then I decided I wanted to display a number of one-line commands and output alternately. Looking up the fancyvrb package documentation, it was easy to get alternate colours. The problem was, it did it globally. My environments for input and output also went psychedelic.

After a bit of messing around, I discovered the following solution. My red environments remain red, my blue environments stay blue, and alternate colours only turn up when I want them to!


\documentclass{article}
\usepackage{fancyvrb}
\usepackage{color}

\newcommand{\ChangeLine}[1]{%
\ifodd\value{FancyVerbLine}%
\textcolor{blue}{#1}\else\textcolor{red}{#1}\fi}

\DefineVerbatimEnvironment{blueEnv}{Verbatim}{formatcom=\color{blue}}{}
\DefineVerbatimEnvironment{redEnv}{Verbatim}{formatcom=\color{red}}{}
\DefineVerbatimEnvironment{alternate}{Verbatim}{formatcom=\renewcommand{\FancyVerbFormatLine}{\ChangeLine}}{}


\begin{document}

\begin{Verbatim}
aaaaaaaaaaa
bbbbbbbbbb
cccccccccccc
ddddddddddddd
\end{Verbatim}

\begin{blueEnv}
aaaaaaaaaaa
bbbbbbbbbb
cccccccccccc
ddddddddddddd
\end{blueEnv}

\begin{redEnv}
aaaaaaaaaaa
bbbbbbbbbb
cccccccccccc
ddddddddddddd
\end{redEnv}

\begin{alternate}
aaaaaaaaaaa
bbbbbbbbbb
cccccccccccc
ddddddddddddd
\end{alternate}

\end{document}

Thursday, 1 September 2011

Guardian article about academic publishing

I agree with a lot of this article in the Guardian. Especially:
Reading a single article published by one of Elsevier's journals will cost you $31.50. Springer charges €34.95, Wiley-Blackwell, $42. Read 10 and you pay 10 times. And the journals retain perpetual copyright. You want to read a letter printed in 1981? That'll be $31.50.
I get especially annoyed with the said letter was published in 1881, and therefore out of copyright yet they still charge you for it.

Sunday, 28 August 2011

Yet another estimate of the number of species on earth

This week in PLoS Biology, paper was published that estimates the number of species on earth being around the 8 million mark (give or take 2 million). This study takes a rarefaction-type approach, seeing how the rate of discovery of higher taxa is decreasing, and extrapolating from that to the species level, resulting in the figure of 8.7 million with an error range of 1.3 million.

This study is nothing new—there's been a number of estimates published over the past two decades that attempt to give a number to the total diversity of life on earth. While this one does appear to be a bit more robust, all these studies are based on various assumptions, and have given some very different figures. There seems to be some sort of convergence on the 10 million mark, but at the end of the day, we just don't know.

I guess the value of these papers are that they make public how far we have to go before we know the most basic thing about the other organisms that share the world with us. I still surprise people when I tell them my tales of discovering new species, the general belief being that we know essentially all there is to know about biology. However, unless there are some useful outcomes (e.g. increased funding or employment) from them, I view these papers with a certain cynicism. We know the task ahead of us is huge. It'd be great to be able to dive into it whole-heartedly and without needing to worry about the finances.

The paper did alert me to the World Taxonomist Database, a register of taxonomists from around the world and encompassing all taxa. The register gives contact details for each of the researchers in the database, as well as their taxonomic and geographic interests. It's a very handy resource.

Friday, 26 August 2011

Harvard's Caribbean Insects


Harvard University has has an interest and presence in the Caribbean for the past 150 years. As you can imagine, they've accumulated a lot of information on the biota of the region. They've made a sizable portion of their entomological knowledge available on the Caribbean Insects @ Harvard Entomology webpage, which is very nice of them. of particular interest are is the insect and plant database which you can search to find specimen information, or cool photos, like the image of Eurhinus festivus suturalis above. They've also made a whole lot of papers available through their taxonomic literature database, though unfortunately I was unable to access the database for some reason or another. Finally, they've made a number of posters of different taxa available, and very kindly sent me copies of their beautiful weevil and bark beetle ones. Good on them for creating all this cool stuff!

Mounting insect specimens in resin

I do a number of school presentations throughout the year, and am frequently asked if I can bring a few specimens to show the students. I am usually fairly loathe to do so, because of the fragility of most specimens, and the fact that the majority of my specimens are fairly small and therefore not especially exciting. Getting into work today, I saw a couple of resin-encased beetles I have received as gifts and had a brainwave. A quick search for instructions for how to do it revealed a number of tutorials. The one by Dalchem is useful, as is the guide provided by Complete Paints.

Wednesday, 24 August 2011

Rings and starships: A new shark embraces pop culture


I couldn't let this one go past without commenting on it. Today in Zootaxa, a description was published today that has references to two highly regarded elements of pop culture in the past 50 years. Gollum suluensis is a deep water shark from the Philippines whose name calls to mind Gollum from The Lord of the Rings, and Captain Sulu from Star Trek.

Before latin scholars point out that the -ensis suffix to the specific name refers to a place not to a person, I will clarify the specific name actually refers to the Sulu Sea. The generic name though is genuine. Established in 1973 by Leonard Compagno, the original description gives this explanation for the name:
Gollum (treated as a masculine noun), named for the antihero of J. R. R. Tolkien's Lord of the Rings trilogy, to whom this shark bears some resemblane in form and habits.
Appropriately enough, the type species lurks around New Zealand.

References
Compagno LJV. 1973. Ctenacis and Gollum, two new genera of sharks (Selachii: Carcharhinidae). Proceedings of the California Academy of Sciences 4(39): 257–272.

Last PR, Gaudiano JP. 2011. Gollum suluensis sp. nov. (Carcharhiniformes: Pseudotriakidae), a new gollumshark from the southern Philippines. Zootaxa 3002: 17-30.

Monday, 22 August 2011

Bohumiljania of New Caledonia


Today in Zootaxa a paper was published describing a number of species in the leaf beetle genus Bohumiljania from New Caledonia. Unfortunately, these species aren't going to win many prizes in the beauty stakes—they're all pretty nondescript, generic looking chrysomelids (See the picture of Bohmiljania aoupinie above). However, it belongs to a group (the Spilopyrinae), that displays a classical Gondwanan distribution pattern so it will be of interest to those people who are interested in the biogeography of New Caledonia. These beetles tend to be found in mountainous areas, and all known hostplants are in the Myrtaceae.

Incidentally, this is Zootaxa's 3000th issue. Pretty good going for a journal that celebrated its 10th birthday on 28 May this year.


Reference:
Reid CAM, Beatson M. 2011. Revision of the New Caledonian endemic genus Bohumiljania Monrós (Coleoptera: Chrysomelidae: Spilopyrinae). Zootaxa 3000: 1-43. The full 6 MB article is here