Tex

From Beamer to Deckset

Now that I upgraded to Mavericks (OS X 10.9), I decided to give a try to Deckset which I mentioned in a previous post on Markdown and slideshow. What is Deckset The idea of Deckset is that you write simple Markdown (like when using Pandoc) and slides are formatted using gorgeous themes. Slides are rendered as you type your Markdown slides, which is pretty handy, and figures can be displayed in different manner (fit to screen, left- or right-aligned, filtered, or at a specific % of the original size).

Weaving Stata Documents

StatWeave has been recently updated and it has become a powerful engine for weaving Stata documents. StatWeave The good news is that we can now use graphical commands with Statweave. There’s a minimal working example in the testing suite: Stata-test.swv. The Statweave package offers some handy customizations like code formatting (see \StataweaveOpts{}), and basically all we need to do is to put our Stata code in a Statacode environment. For R, we would use a Rcode environment.

Easier literate programming with R

I have been using Sweave over the past 5 or 6 years for processing my R documents, and I have been quite happy with this program. However, with the recent release of knitr (already adopted on UCLA Stat Computing and on Vanderbilt Biostatistics Wiki) and all of its nice enhancements, I really need to get more familiar with it. In fact, there’s a lot of goodies in Yihui Xie’s knitr, including the automatic processing of graphics (no need to call print() to display a lattice object), local or global control of height/width for any figures, removal of R’s prompt (R’s output being nicely prefixed with comments), tidying and highlighting facilities, image cropping, use of framed or listings for embedding code chunk.

Happy TeXying

As I do not really like default Beamer themes1, I tend to rely on Context to build my slides. I’ve built a set of custom themes for use with Hans Hagen’s pre styles as well as Thomas Schmitz and Aditya Mahajan’s simpleslides. The latter caused me problem when I tried to recompile older slides. The simpleslides “third-party” module has been updated recently (January, 2012) but I didn’t notice that until I got the following error message

Weaving scientific documents

Some notes about installing and testing StatWeave with R and Stata. StatWeave is yet another way to weave code chunks and text into a single document. The idea of interlacing code and doucmentation is borrowed from the famous web and cweb systems developed by D Knuth who also coined the term “literate programming”. There is a draft article on Lightweight Literate Programming, which has evolved as an extended discussion of the following paper:

Asymptote and Metapost

I am planning to make a lot of illustrations for basic mathematical and statistical concepts, but I am still hesitating about the drawing program to choose. I know a bit of Metapost and Asymptote, but I am not clear about the pros and cons of each of the vector drawing language. Especially, I’ve heard that Asymptote is somewhat “superior” to Metapost. MetaPost is based on Knuth’s METAFONT, but is intended for figures in technical documents according to its primary author, John Hobby.

Syntax highlighting in Latex

I just discovered the minted $\LaTeX$ package to highlight source code. Perfect! I never liked the listings package.

Upgrading Context

For some time ago (in fact, since I initially upgraded Texlive to the 2009th grinding) I was stucked by repeated failures to “properly” compile tex documents with embedded metapost background. Properly here means that the compilation went fine but the colored backgrounds weren’t there. After googling for a possible Metapost bug with the newly released ConTeXt engine, I just realized that the Texlive2009 distribution does not actually include a useable Mark IV engine.