Local texmf tree on Mac OS X

December 16, 2009
Tags: , ,

This is mostly a reference for a me but also a good reminder for those using TeXLive on Mac OS X (a.k.a. MacTeX). From the document “What Is Installed.pdf” in /Applications/TeX:

Incidentally, if you want to add files to TEX Live for one particular user, install them in a similar tree ~/Library/texmf where ~/Library is the Library folder in that user’s home directory. The folder texmf and other folders for the tree will have to be created. For instance, TEX will find any file in ~/Library/texmf/tex or a subfolder of this location, LATEX will find any file in ~/Library/texmf/tex/latex or a subfolder of this location, and BibTEX will find any .bib file in ~/Library/texmf/bibtex/bib or a subfolder of this location, and any .bst file in ~/Library/texmf/bibtex/bst or a subfolder of this location. It is not necessary to use texhash when adding files to this local tree.

0

pgfSweave now on CRAN

December 6, 2009

At long last pgfSweave has finally made its way to CRAN.

http://cran.r-project.org/web/packages/pgfSweave/index.html

The pgfSweave R package is about speed and style of graphics. For speed, the package provides capabilities for “caching” graphics generated with Sweave on top of the caching funcitonality of cacheSweave. For style the pgfSweave package facilitates the integration of R graphics with LaTeX reports through the tikzDevice package and eps2pgf utility. With these tools, figure labels are converted to LaTeX strings so they match the style of the document and the full range of LaTeX math symbols/equations are available.

The backbone of pgfSweave is a a new driver for Sweave (pgfSweaveDriver). The driver provides new chunk options tikz, pgf and external on top of the cache option provided by cacheSweave.

This package started as a fork (hack) of cacheSweave to suit our own narrow purposes and has since become a valuable tool for much of our own work. We hope you will find it useful as well.

-Cameron Bracken and Charlie Sharpsteen

6

swfDevice: Help Wanted (Windows Build) and Outlook

December 3, 2009

swfDevice is an R package I am developing that produces swf (flash) files natively from R.

If anyone can step up and help get a working windows build up and running that would be great! I have little expertise with windows and I am just about stuck as what to do next. The task involved linking to some precompiled dlls and such since ming depends on libpng, zlib, libungig and freetype. If you would like to help, send me an email (cameron.bracken [at] gmail.com).

Todo before initial CRAN release:

  • Working windows build that does not crash when any operation is performed
  • option to wrap swf output in HTML

Todo in the future (possibly before initial release but probably not):

Device features

  • xCharOffset yCharOffset
  • yLineBias
  • ipr: pixels per inch
  • cra: default character size in pixels
  • canClip: will be much harder than tikzDevice
  • canChangeGamma
  • canHAdj: not supported
  • startps: ditto
  • hasTextUTF8: should be possible with ming
  • wantSymbolUTF8: ditto

Implement remaining graphics parameters

  • gamma
  • lend
  • ljoin
  • lmitre
  • lineheight

Graphics primitives

  • metricInfo (is currently returning the same metrics for all characters, this is bad but does not severely affect the text placement)
  • textUTF8
  • strWidthUTF8
5

Using Git with R-Forge OR Adding an local Git branch to track an Subversion Repo

December 3, 2009

These instructions were originally from instructions from my friend Charlie.

I really like to use Github but R-Forge has alot of nice features for package development, so why not get the best of both worlds.

Say you have a git repo (with an R package or something else) but want to create a local brach which tracks an svn repo (from R-Forge) such that you can merge changes from your git repo in and then commit them to svn. First use the following command to grab the current svn:

cd my-r-package
git svn clone svn+ssh://developername@svn.r-forge.r-project.org/svnroot/my-r-package .

This will create a new git repository that is a mirror of whatever svn repo you pointed at. This may take a while if you have a big existing svn repo.

If you want to add a svn bound branch to an existing git repo:

Edit .git/config and add the following:

[svn-remote "r-forge"]
  url = path/or/url/to/svn/repository
  fetch = :refs/remotes/r-forge-svn

Once you’ve done this, you have created an entry for a new git remote server- fetch the status and history of it’s branches using the following:

git svn fetch r-forge

If this command is successful, git branch -a should show:

r-forge-svn

In the list of available branches. This branch is a remote branch- to make a local copy, do the following:

git checkout r-forge-svn
git checkout -b r-forge-svn-local

Now you have a local branch which is bound to the svn server- once again straight up adding/removing/moving files in this branch should work fine. It’s merging that gets you into trouble.

How to merge between a git branch and a git-svn branch

The point is that you don’t want git infecting your subversion repository with any of its awesomeness. Exposure to the kind of concentrated badass possessed by git causes poor SVN’s head to pop. So, the merge must be done as follows:

git checkout r-forge-svn-local
git merge –squash branch-to-merge-in

The --squash option tells git to leave out any info about what happened during the merge and act like it just mashed a bunch of files into your svn branch using copy commands.

Once you’ve added/copied/moved/squashmerged new files into your local svn branch- do the following to push the changes to the svn repo:

git commit -a               (Commit changes to your git repo as normal.)
git svn dcommit           (This will form each git commit into a svn commit and send it to the svn repo)

To pull changes from the svn repo run the following:

git svn rebase

0

swfDevice is nearing completion

November 17, 2009

My new R package, swfDevice, is getting close to its first release. This package enables native R graphics output as swf (flash) files. It also as the ability to create animations with player controls. The main project page is here and the results of the test suite are here.

Here are some samples:

http://swfdevice.r-forge.r-project.org/swfDevice_test29.swf

http://swfdevice.r-forge.r-project.org/swfDevice_test28.swf

There are still a few things left to be done such as clipping and a working windows build.

0

Critical programs (for me) now up and running on Snow Leopard

September 13, 2009

I updated to Snow Leopard the first day it came out and much to my ire, many of the programs and plugins that I use regularly were not compatible. Most of the issues had to do with 32/64 bit compatibility with system components. Fortunately the last became available recently (SafariStand).

So the three plugins that I rely on in Safari are finally up and running on Snow Leopard. Those being:

  • Glims
    • Adds Numerous sweet features to Safari such as improved search suggestions, many tab options, like “always open in new tab”, favicons on tabs and keyword searches!
  • SafariStand
    • The other essential plugin, add toolbar button for viewing individual site scripts and downloading flash movies (among other things).
  • GlimmerBlocker

Other programs I rely on that now are working great on SL are:

  • SIMBL
    • Allows programs like SafariStand to work.
  • Growl
    • You use Mac OS X and you don’t know what Growl is?
  • iStat Menus
    • Various type of monitors for your system, in the menu bar! Keeps you very in touch with your system. I used to use MenuMeters for the same purpose, but iStat Menus basically took that project and totally tricked it out, making it way better.
0

Trick Gmail into checking POP3 more often

September 2, 2009
Tags:

I finally got sick of gmail only checking my POP3 account every hour or so, so I resolved to fix it. If you google this, there are numerous solutions, I thought I would share my experience. I have access to a web/mail server so I used that.

(1) Log on to the server. (2) Create the script ~/.mailthis

#!/bin/bash
echo "x123456789x" | mail mypop3account@abc.com

(3) Then edit your crontab with crontab -e and put the following in there

* * * * * /path/to/.mailthis

You must put the absolute path here. This will send a mail to your pop3 account every minute.

(4) Finally create a filter in Gmail that says any message with the word x123456789x in it, delete it. That way you don’t spam yourself.

Thats it, now gmail will check your mail every minute since you are getting messages every minute.

0

Beta Verson of tikzDevice Released!

July 28, 2009
Tags: , , ,

The tikzDevice package provides a new graphics device for R which enables direct output of graphics in a LaTeX-friendly way. The device output consists of files containing instructions for the TikZ graphics language and may be imported directly into LaTeX documents using the \input{} command.

The beta version of tikzDevice is now available here.

An additional location for downloading source tarballs and windows binaries is here.

There are many significant improvements compared to the alpha version:

Features:

  • Rd documentation
  • A vignette
  • Proper string placement (because of string width and character metric calculations via latex)
  • Custom LaTeX headers, footers and typesetting engines
  • R-Level Annotation of graphics with TikZ commands (see TeXample for great examples of using TikZ commands)

Limitations:

  • ASCII character support only
  • No recognition of the R symbol font (i.e. no plotmath symbols)
  • A bevy of other quirks and “personality traits” that will make themselves known in time

The device requires a working installation of LaTeX and the TIkZ package in order to function. This is because font metrics are currently calculated through direct calls to the LaTeX compiler. Unfortunately, this results in some significant computational overhead- it may take several seconds to create a plot that contains a lot of text. In an attempt to offset this behavior, the tikzDevice uses the filehash package to store font metrics that it has already computed. Hopefully the more the device is used, the faster it will be. We suggest reviewing the package vignette, especially the section “R Options That Affect Package Behavior ” for more information on how the caching process works.

We think the package is quite usable as it is, but there are surely many bugs that we don’t know about. We welcome bug reports at our R-Forge tracker

Enjoy!

The tikzDevice Team

0

Set Homepage to Top Sites in Safari 4

June 29, 2009
Tags: ,

In the homepage input field put

topsites://

Topsites

0

Development of tikzDevice is underway

June 26, 2009
Tags: , , , ,

Development of the R package tikzDevice has been underway for about a month now. This package allows for the output of R graphics as TikZ commands.

Charlie Sharpsteen and I have gotten it into an alpha stage. There is no real documentation but there is plenty of comments in the code. We have a R-forge project where binary packages can be downloaded. The project is also tracked by Github here or at my fork.

As of now the device handles most of the graphics parameters. There are still some issues with text placement and UTF8 string support is currently not implemented.

Comments, suggestions are welcome.

2