PDFLaTeX with EPS and PNG Figures

Take a look at this trick in the post at http://opendevice.blogspot.com/2008/05/eps-files-and-pdflatex.html. The idea is simple. It asks for converting eps figures into pdf figures before compiling the tex file. But it is necessary to remember that only the name, not the .eps extension, of eps figures can be placed in\includegraphics{}; otherwise the eps figures will be converted every time the tex file is compiled.


"There is this odd quirk in LaTeX. The latex executable compiles your .tex files in the old-fashioned DVI format. As such, it accepts by default only .eps (Encapsulated PostScript) images. pdflatex compiles your .tex files in the standard PDF format. For some mysterious quirk, pdflatex accepts raster formats like .png and .jpg , but does not accept .eps!

Sometimes you want the best of both worlds. An undergraduate of my lab, after some googling, found you can force pdflatex to insert .eps files happily:

1)Install texlive-extra packages, or any other package containing the epstopdf utility.

2) Insert the following code in your .tex file:

\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse
\else
\pdfoutput=1
\pdftrue
\fi
\ifpdf
\usepackage{graphicx}
\usepackage{epstopdf}
\DeclareGraphicsRule{.eps}{pdf}{.pdf}{`epstopdf #1}
\pdfcompresslevel=9
\else
\usepackage{graphicx}
\fi

3) Compile using pdflatex with the -shell-escape command line option

It seems to work."

Version Control with VisualSVN Server and TortoiseSVN

Version control is for keeping track all the changes made to the source codes. It is of great convenience for a group of people to work together on the same project as well as a for a student to do his own programming homework. Frankly, I don't know much details of the version control system. It would be crazy for people like me to read its whole manual word by word and to pause frequently to search for all the computer jargon on the internet. So, I managed to learn how to use it quickly for my work.

1. Preparation
You may hear about CVS, an old version control system, but I am using Subversion, which is the new system that becomes more and more popular today.

Subversion manages all the repositories. Repository is the folder where the source codes or project files are stored for version control on the computer. In order to make the repository accessible through internet the Apache HTTP server, which can turn the computer into a web server, need to be installed along with the Subversion system. Since it is not an easy configuration task for them to work happily together I chosen to install VisualSVN Server, which is a package bundle of Subversion, Apache and a management console for Windows platforms.

A client tool is also necessary to communicate with repositories, e.g. download a copy of codes from the repository to local computer ("check out" in jargon) or send modified codes into the repository from local computer ("commit" in jargon). I chosen to use TortoiseSVN, which integrates nicely into the Windows Explorer on the Windows platforms.

2. New Repository Creation
After installing both VisualSVN Server and TortoiseSVN it is then the time to create a repository with an initial copy of your codes. You can read through the tutorial of "Practical guide to subversion on Windows with tortoiseSVN" or follow my simplified steps for doing that.

(1) Open VisualSVN, right click "repositories" in the left frame, choose "create New Repository ..." and uncheck the box of "Create default structure (trunk, branches, tags)".
(2) On your computer, create a folder "tmp", a folder "new" inside "tmp", and three folders named "trunk", "branches", and "tags" inside "new".
(3) Place your codes into the recently created folder "trunk".
(4) Right click the folder "new", choose "TortoiseSVN" and then "Import", choose the right path for your newly created repository, write in the version control message, e.g. "Initial import", and then click "OK".

Note that (1) has to be done on the server computer while (2), (3), and (4) can be done either locally or remotely.

3. Communication with Repository
Please refer to this short TortoiseSVN Tutorial on how to communicate with repositories. It is simple enough to download old codes from and upload modified codes into repositories. All that can be done with TortoiseSVN functions from right clicking your working folders. It should be aware that renaming, deleting, and adding files of codes should all be done with TortoiseSVN, other than through normal file operations in the Windows Explorer, as explained in the TortoiseSVN Tutorial.

So...happy version control!