Microsoft Word Drawing to LaTeX — CutePDF and gsview

I sometimes get work from collaborators who grew up with Microsoft products and they need their manuscript translated into LaTeX. This is usually not such a big deal, though I have come to dislike translating tables. But sometimes you get one where they’ve done the illustration using Word’s built-in drawing capabilities. This is a pain in the neck. On way to get the image out is as a screen grab, but that pixelates. There are other ways that you can find on the web, but I have found the following route to be very reliable and to produce nice, vector graphics.  I know it is not as direct as it might be.

I have a Windows computer with cygwin and gsview (and gs of course) installed.  These are fabulous free and/or open source tools that I recommend to anyone.

(1) Make a copy of the Word file and delete everything except the drawing.

A Word file with just a drawing in it. Oh, and some random text which is part of the figure.

A Word file with just a drawing in it. Oh, and some random text which is part of the figure.

(2) You ought to already have it, but if not install CutePDF (or some other ‘print to PDF’ option, if your version of Word does not have an option like that already).  I should note that I have only bothered to try this with CutePDF; my work provides the full-on “Adobe Acrobat integrated with Word” solution, and it seems to be slow, buggy and generally inferior to CutePDF. You may be able to print directly to a PostScript file in which case you can skip the ‘pdf2ps‘ step.

(3) Print the Word file to a PDF (say fig1.pdf).  It should give you a single page document.

(4) Run pdf2ps (command line program readily available) on the resulting PDF file.  Call the result fig1.ps, say.  You can just as easily use pdftops; they are not the same but they both work.

(5) Open the resulting PostScript file in gsview and select File -> PS to EPS.

The resulting eps file in its bounding box.

The resulting eps file in its bounding box.

(6) Done.  If you use pdflatex you can convert back to PDF using whatever tool you like; gsview will do it.

The main reason for doing it this way is it preserves the vector nature of the image, so if you use it in your LaTeX document it will not pixelate as you change size.  It is also a good way of getting graphics out of Excel.  Printing to a PostScript printer is always possible and for a long time was the simplest thing to do.  I go via CutePDF just because I find it a very reliable little tool.

Now, if you have a Mac it is easier because (and I’m doing this from memory) I think you can open the PDF in Preview, draw the bounding box with the mouse, then hit ‘Cmd-K’ to set the crop box and just save it and then use pdflatex like most modern people.

 

Note to self: No more notes to self.

Advertisements

Tags: , , , , , , , ,

About Darren

I'm a scientist by training, based in Australia.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: