An .EPS to .PDF converter (using LaTeX!)

[This article was first published on Tales of R » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I am about to go on a short holiday, so I was tidying the code lines I had scattered around before leaving… And I found this: a minimal EPS to PDF converter, which is barely a LaTeX template.

It is intended for transforming an .EPS graph to the .PDF format. You can copy & paste this whole code into a blank text file (but with .TEX extension) and run it with a TeX editor. To install and use LaTeX, here it is a previous post about it.

When you have compiled it, you can search in the same file’s directory for the newly created PDF graph!

%%%%%%%%%%%%%%%%%%%%%%%%
%% EPS TO PDF CONVERTER %%
%%%%%%%%%%%%%%%%%%%%%%%%
% Author: Mareviv
% Under GNU General Public License
% Paste this document entirely into a file with .TEX extension (.tex). Open it with TeXworks
% Tips for starting with LaTeX: http://talesofr.wordpress.com/2013/05/02/learning-latex-from-scratch/
\documentclass{article}
\usepackage{graphicx} % support the \includegraphics command and options
\usepackage{epstopdf} % Included EPS files automatically converted to PDF to include with pdflatex
\begin{document}
This is an .EPS to .PDF converter, using a minimal {\LaTeX} document.
Place the .EPS file in the same folder as this converter.
Insert the .EPS figure name inside the curly brackets (in this case rnetwork2).
\begin{figure}
\centering
\includegraphics[width=1.1\linewidth]{rnetwork2}
\caption{A network graph.}
\end{figure}
Copy and paste the following code to convert more images at the same time:
\begin{figure}
\centering
\includegraphics[width=1.1\linewidth]{rnetwork2}
\caption{Another network graph.}
\end{figure}
\end{document}

To leave a comment for the author, please follow the link and comment on their blog: Tales of R » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)