Skip to content

Instantly share code, notes, and snippets.

@Sharpie
Created May 10, 2011 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sharpie/965459 to your computer and use it in GitHub Desktop.
Save Sharpie/965459 to your computer and use it in GitHub Desktop.
Pepsi challenge: eps() vs tikz()
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{lipsum}
\usepackage[nogin]{Sweave}
\usepackage{tikz}
\begin{document}
\section{Lorem ipsum}
\lipsum[1]
\begin{figure}[!hb]
\centering
<<eps-examp,fig=TRUE,eps=TRUE,pdf=FALSE,width=4.5,height=4.5,echo=FALSE>>=
plot(1,1)
@
\label{fig:eps-ex}
\caption{Vivamus viverra fermentum felis.}
\end{figure}
\newpage
\section{Lorem ipsum}
\lipsum[1]
\begin{figure}[!hb]
\centering
<<tikz-examp,echo=FALSE,results=hide>>=
require(tikzDevice)
tikz('tikz-examp.tex', width = 4.5, height = 4.5)
plot(1,1)
dev.off()
@
\input{tikz-examp}
\label{fig:eps-ex}
\caption{Vivamus viverra fermentum felis.}
\end{figure}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment