Mathematical annotations on R plots

I’ve always strug­gled with using plotmath via the expression func­tion in R for adding math­e­mat­i­cal nota­tion to axes or leg­ends. For some rea­son, the most obvi­ous way to write some­thing never seems to work for me and I end up using trial and error in a loop with far too many iterations.

So I am very happy to see the new latex2exp pack­age avail­able which trans­lates LaTeX expres­sions into a form suit­able for R graphs. This is going to save me time and frus­tra­tion! Con­tinue reading →

Dark themes for writing

I spend much of my day sit­ting in front of a screen, cod­ing or writ­ing. To limit the strain on my eyes, I use a dark theme as much as pos­si­ble. That is, I write with light col­ored text on a dark back­ground. I don’t know why this is not the default in more soft­ware as it makes a big dif­fer­ence after a few hours of writing.

Most of the time, I am writ­ing using either Sub­lime Text, RStu­dio or TeX­studio. Each of them can be set to use a dark theme with syn­tax col­or­ing to high­light struc­tural fea­tures in the text.
Con­tinue reading →

biblatex for statisticians

I am now using bibla­tex for all my bib­li­o­graphic work as it seems to have devel­oped enough to be sta­ble and reli­able. The big advan­tage of bibla­tex is that it is easy to for­mat the bib­li­og­ra­phy to con­form to spe­cific jour­nal or pub­lisher styles. It is also pos­si­ble to have struc­tured bib­li­ogra­phies (e.g., divided into sec­tions: books, papers, R pack­ages, etc.) Con­tinue reading →

Creating a handout from beamer slides

I’m about to head off on a speak­ing tour to Europe (more on that in another post) and one of my hosts has asked for my pow­er­point slides so they can print them. They have made two false assump­tions: (1) that I use pow­er­point; (2) that my slides are sta­tic so they can be printed.

Instead, I pro­duced a cut-​​down ver­sion of my beamer slides, leav­ing out some of the ani­ma­tions and other fea­tures that will not print eas­ily. Then I pro­duced a pdf file with sev­eral slides per page. Con­tinue reading →

Generating tables in LaTeX

Typ­ing tables in LaTeX can get messy, but there are some good tools to sim­plify the process. One I dis­cov­ered this week is tables​gen​er​a​tor​.com, a web-​​based tool for gen­er­at­ing LaTeX tables. It also allows the table to saved in other for­mats includ­ing HTML and Mark­down. The inter­face is sim­ple, but it does most things. For com­pli­cated tables, some addi­tional for­mat­ting may be nec­es­sary. Con­tinue reading →