Tag Archives: LaTeX

Beta Verson of tikzDevice Released!

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

Development of tikzDevice is underway

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.

A short style file for a memo header for use with amsart

I recently had to write a memo. After playing around a bit, I decided on the amsart documentclass. I wrote a style file to define the memo header; I think it looks good with the general style of the amsart class.

The contents of the style file are:

\ProvidesPackage{memo}

\RequirePackage{setspace}

\newcommand{\memotopline
}[2]{{%
\noindent\sc #1}{\begin{quote}#2\end{quote}}}

\newenvironment{memoheader}[1]
{
    \singlespacing
        \begin{center}
            \large\sc\noindent  #1
        \end{center
}
        \noindent\underline{\hspace{%
            \textwidth}}\vspace{.4cm}\\
}
{
    \noindent\underline{\hspace{\textwidth}}
}

Save the contents to memo.sty and save it in the directory with your memo. This defines the memoheader and \memotopline environments which are used like so:

\begin{memoheader}{Memorandum}
    \memotopline{To:}{
        You\\
        Someone With An Important Title\\
        Somewhere
    }
    \memotopline{From:}{
        Me\\
        A Very Important Person\\
        At A Very Important Place
    }
    \memotopline{Date:}{\today}
    \memotopline{Subject:}{Check me out!}
\end{memoheader
}

The memo template looks like:

\documentclass[11pt]{amsart}

\usepackage{lipsum}

\usepackage[margin=1.2in]{geometry}
\usepackage[parfill]{parskip}
\usepackage{memo}

\usepackage{hyperref}

\begin{document}

\thispagestyle{empty}

\begin{memoheader}{Memorandum}
    \memotopline{To:}{
        You\\
        Someone With An Important Title\\
        Somewhere
    }
    \memotopline{From:}{
        Me\\
        A Very Important Person\\
        At A Very Importnat PLace
    }
    \memotopline{Date:}{\today}
    \memotopline{Subject:}{Check me out!}
\end{memoheader}

\onehalfspacing

\section*{Summary
}
\lipsum


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section*{Introduction}
\lipsum

\end{document
}