Friday, 18 November 2011

TVNZ streaming America's Cup races live

Good news for New Zealand sailing fans: TVNZ is now streaming the AC45 world series matches live. Check out the sailing news page of their website to be directed to the links. Replays can be accessed by clicking through their OnDemand links, but the price paid is having to endure a Microsoft ad before getting into the actual footage. Access to the full replays on YouTube is once again delayed for viewers from NZ, but hopefully will be available in a week or so.

Unfortunately, coverage of the San Diego races has been a bit of a debacle. A lack of communication regarding the course, time of live streams, and delays in the posting of full replays have left a fans with a sour taste in their mouths. I am personally annoyed that the full replays for Port Cities Challenge that kicks off the event are not available. Let us hope that the organisers are learning valuable lessons so they don't make these mistakes again.

Wednesday, 2 November 2011

Using Sweave with Beamer: A note on fonts

Recently, I've been preparing a poster using the LaTeX packages Beamer and beamerposter. The poster discusses a bunch of R stuff that I've been doing lately, so I successfully used Sweave to incorporate R code into the poster. However, I had some trouble with package names that I wanted to typeset as small caps. The package names looked the same as the rest of the text. A bit of sleuthing around revealed Sweave as the culprit. In the Sweave.sty package, on line 20, it calls the deprecated LaTeX package "ae", which for some reason doesn't recognise small caps. Changing the package to "lmodern" made small caps turn up correctly within the text.

Unfortunately, my problems had not yet been solved completely. I had mentioned the package names in the titles which were set in bold. I thus had created a fairly commonly encountered bugbear with LaTeX—the non-compatibility of bold and small caps in computer modern font. While there are workarounds for this (see this Stack Exchange and TeX FAQ for more details), unfortunately these solutions did not work with Beamer.

So, I set about finding a font that both looked alright, and would accomodate bold and small caps. I found that using helvetica would be fine, but had to be loaded after Sweave to work. As my Sweave block kept placing the \usepackage{Sweave} immedediately before \begin{document}, I resorted to calling helvetica in the Sweave file itself.

The relevant lines in of the Sweave.sty (lines 18-21) file. Before:
\ifthenelse{\boolean{Sweave@ae}}{%
\RequirePackage[T1]{fontenc}
\RequirePackage{ae}
}{}%
After:
\ifthenelse{\boolean{Sweave@ae}}{%
\RequirePackage[T1]{fontenc}
\RequirePackage[scaled]{helvet}
}{}%