Categories

## Making Beamer Better

I use Beamer a lot for presentations, and I’ve gotten pretty good at the editing cycles that it requires. Unlike in PowerPoint, Beamer doesn’t allow me to simply click and drag an object to a new spot. Rather, to move something on the slide, I have to edit the LaTeX code, entering a command like \vskip0.2in to give me an additional bit of space between a couple of equations or text elements. It sometimes takes numerous iterations to get things right. This doesn’t both me, as I love being able to write entire presentations in LaTeX. What I want, however, is an ability to speed up the iterations.

If I could place the document preamble in one file, and the code for each slide in individual files, then it should be possible to create a script for compiling just one slide at a time. Then, I wouldn’t have to wait while Beamer compiled all 100+ slides in a presentation deck every time I make an edit. (Yes, that’s a lot of slides, but the count goes way up when I use multiple slides to reveal an equation one line at at time.) I can comment out code to limit compilation time, but it’s slow and cumbersome, and I once found myself in the middle of a presentation with missing slides because I forgot to uncomment about a third of my presentation file. So I want a supervisory program that will handle the individual code blocks, and allow me to compile the entire document when I’m finished.

If such a program exists, I’d sure like to know about it. If not, then maybe I’ll get around to writing it someday. 🙂

Categories

## Getting Inkscape to play nicely with PSfrag

While browsing through some of the old TeXtip posts on Twitter, I was reminded of the possibility of using Inkscape to generate LaTeX-compatible illustrations. Given the vast amount of cruft that Illustrator includes in its EPS files, this sounded like it might be a good alternative.

However, Inkscape seems to be having some of the same problems as I was recently experiencing with Adobe Illustrator. Long story short, the only way I could find to make Inkscape play nicely with PSfrag was reverting to version 0.46. (The most recent Inkscape release is version 0.48.)

This problem is related to the use of the Cairo package from the GTK+ Project to export EPS files. Rather than store strings directly, references are made to a structure of characters actually used in the file. This is done to reduce file size, and improve performance. However, this is a real problem for those of us that use PSfrag. Specifically, string “abc” is no longer identified in the EPS file as (abc)Tj, but rather <01020304>Tj . This makes it impossible for PSfrag to find a matching string. There is some indication that a newer release of Cairo will fix this problem, but it hasn’t yet worked its way into the public release.

While some nice LaTeX-rending features are being introduced into the more recent releases of Inkscape, the benefit of PSfrag was nicely expressed by commenter emw on a Inkspace forum:

The reason for using psfrag is a kind of “coding style”, because I use a lot of complex symbols/equations defined by \newcommand statements in the latex document. For a consistent layout, I’d highly prefer to reuse these commands via psfrag in the figures.

I heartily concur.

Categories

## Getting Illustrator to play nicely with PSfrag

When creating diagrams for inclusion in a Beamer presentation, I used to use the drawing package in Open Office. Then I could use PSfrag to replace drawing text with text rendered in in \LaTeX. This made all the symbols in the presentation match symbols on the diagram. Alas, I am no longer able to make Open Office work with PSfrag. (My old trick of modifying the EPS “textmode” value in the OO configuration file no longer works.)

No problem, I thought. I’ll use Adobe Illustrator instead. However, I could only get this arrangement to work if the drawing text consisted of single letters. Not a huge problem, I suppose, as there are 52 possible identifiers just using upper and lower case letters in the English alphabet. However, it is sometimes a bit difficult to remember if x_3 is being represented by “p,” or “q,” or some other letter.

So here’s a solution to the problem, that I found on Giovanni Lanzani’s blog. When saving the EPS file in Illustrator, select “Illustrator 3 EPS” in the “version” pulldown. Don’t use “Illustrator CS3 EPS.” The newer versions write out the text one letter at a time, thus preventing the PSfrag routine from finding a matching string. Apparently the older EPS export routine doesn’t mangle the drawing text in this manner.

Categories

## Secret Tools of the Engineering Grad Student, Part 4: BibConverter

As you begin writing academic papers, you will need to cite the work of other researchers. From the prior two posts in this series, you know about using LaTeX to typeset your paper, and using JabRef to store your bibliographic references. However, typing in all the citation information by hand is rather tedious. Your ability to search the research literature is greatly enhanced if your academic institution provides you with access to databases of the engineering literature (Engineering Village, IEEE Xplore, Web of Science). All of these services allow you to export bibliographic data to a file on your computer, which you can then import into JabRef. However, there is a better way: BibConverter.

The brainchild of Kjell Magne Fauske, BibConverter is a free online service that converts a web page of information into a BibTex reference. While you are browsing through one of the article databases, you will likely find a paper you want to reference. Instead of downloading a citation file, simply copy the entire web page to your desktop, go to BibConverter, and paste the clipboard contents into the provided box. Click on the “Convert” button, and now you have a valid BibTex reference, that will look something like this:

@ARTICLE{Kalman1960,
title = {New approach to linear filtering and prediction problems},
author = {Kalman, R. E.},
year = {1960},
volume = {82},
number = {1},
pages = {35--45},
month = mar,
abstract = {Classical Wiener problem (filtering and prediction) is re-examined in
discrete case using author's new ("state transition") method of
analysis of dynamic systems; general solution is developed in
terms of conditional expectations; this gives result of
greatest possible generality when only first and second-order
statistical averages are used; basic concepts of theory of
random processes reviewed.},
}


Copy this data to the clipboard, and go to JabRef. Create a new BibTex entry with “Ctrl+N”, select the “Article” entry type, and then replace the “BibTex Source” entry with your clipboard contents. Once you’ve done this once or twice, it will seem quite natural, and it saves you the time and mess of having to clean up all the citation files that will start to litter your system. You can even download a bookmarklet from the BibConverter site to save you the trouble of surfing to the BibConverter site and selecting the proper database format. This service has saved me hours of time over the past several years.

[Note: IEEE Xplore recently changed it’s online format, and it looks like BibConverter is currently unable to process data from that service.]

Categories

## Secret Tools of the Engineering Grad Student, Part 3: JabRef

If you write academic papers, then you need to maintain a database of the references you cite. Assuming that you use LaTeX, this is typically accomplished by creating a BibTeX file that contains the needed bibliographical data. (Note that, in addition to identifying this particular data format, you may also see the term “BibTeX” being used to reference the software program that pulls information out of the BibTeX file and integrates it into a compiled LaTeX document.)

While it is possible to create a BibTeX file using nothing more than a text editor, it saves time to import such information into a program designed for this purpose. Always pleased to uncover free software, I’ve found the open source program JabRef to be a powerful citation manager. Many of the engineering article databases (Compendex, IEEEXplore, Web of Science, etc.) allow you to export bibliographical data for the papers they store. It turns out that there are many formats for exporting such data, but JabRef allows most of these formats to be imported directly into its BibTeX database.

Since JabRef runs on the Java Virtual Machine, it works with Windows, Mac OS X, and Linux. In fact, if you don’t want to be bothered downloading JabRef, you can launch the software over the web.

Alternatives to JabRef include Firefox extension Zotero, Mac program BibDesk, and commercial program Endnote.

Categories

## Secret Tools of the Engineering Grad Student, Part 2: LaTeX

If you are going to write a dissertation (or any other paper for that matter) with significant mathematical content, you will discover that the typesetting of your equations proceeds much better if you use LaTeX. While there is a steep learning curve, you will save a good bit of time down the road if you get comfortable with LaTeX (pronounced “Lay-tech”) early on. Here’s an equation for the Fourier transform rendered with this typesetting system:

F(f) = \int_{-\infty}^\infty f(t) e^{-j2\pi ft} dt

This equation is created with the following code:

 F(f) = \int_{-\infty}^\infty f(t) e^{-j2\pi ft} dt

As you can probably figure out, mathematical symbols are created in LaTeX with text keywords preceded by a backslash. In addition to the improved typesetting, this means that you can quickly update many equations at once by simply searching for, and replacing, text strings. Thus, if you wanted to convert the above equation to be a function of g, instead of f, a simple text replacement would update all the equations in one fell swoop. Contrast this to the equation-by-equation corrections required if one is using MathType to typeset mathematics inside a Microsoft Word document.

While there are many benefits to using LaTeX, it does take a little getting used to. In particular, you may find yourself trying to control a lot of factors (margins, paragraph spacing, etc.) that are easy to modify in a word processor, but difficult to adjust in LaTeX. In the beginning, don’t worry about trying to control the output; focus instead on getting your equations to typeset correctly. Also, expect to spend some time searching for documentation. While most everything you will want to do has been done already, it sometimes takes a while to hunt down the correct command. (Hint: If you absolutely must play with the margins, use the geometry package.)

Significant time savings occur with LaTeX because templates for most publications types have already been defined. Thus, if I want to publish an IEEE paper, I simply drop my document into an IEEE template. Same paper in ASME format? Simply change to the appropriate ASME template. Need advanced math formatting commands? Use the AMS package. While similar templates are typically available for Microsoft Word as well, I often find myself hunting from paragraph to paragraph in Word, trying to discover why the formating has gone askew midway through the document. This is rarely a problem in LaTeX. And to produce my dissertation? Simply use the appropriate thesis style (your university may have its own format).

On my XP system (yes, I’m a dinosaur), I’ve had good luck using MikTex as my LaTeX implementation. One of the nicest features about the MikTex software (other than it being free) is that, when it encounters a package name it does not have, it goes out on the net and attempts to find the package for you. This has frequently saved me from having to install such code manually. While any text editor will work to generate LaTeX documents, I’ve always used WinEdt. Although WinEdt is not free, I’ve not regretted the \$30 it cost me for a student license, as it integrates quite nicely with MikTeX.

If you are interested in learning more about using LaTeX, there is some decent documentation on getting started available from the LaTeX project site, as well as the WikiBooks site. When you see references to “LaTeX2e,” this simply indicates the current version of the LaTeX program. Similarly, “LaTeX3” refers to the next generation of the LaTeX software. Learning LaTex is initially frustrating, but you’re an engineering grad student. You’re not the type to choose the easy path. So download the software and give LaTeX a try. I suggest starting with a study sheet of equations for an upcoming exam. You’ll learn how to construct equations without needing to worry about paragraph formatting.

[Hint: Find an equation you like in Wikipedia? Right click on the equation and access the image properties. The associated text will be the LaTeX code used to generate the equation.]

Categories

## Secret Tools of the Engineering Grad Student, Part 1: Desktop Search

Each engineering specialty makes use of certain software packages. For instance, in my area of automatic controls, just about everyone uses Matlab; those studying other disciplines make use of other topic-specific packages. However, certain tools (software and otherwise) will prove beneficial to just about any engineering grad student who must carry out research and produce a dissertation at the conclusion of their studies. However, these tools are rarely mentioned as key technologies for surviving as an engineering grad student. Over the next several posts, I will identify some tools that I had to discover on my own as I marched toward a PhD degree. Today’s category is desktop search.

You will undoubtedly collect a lot of information on your computer as a grad student. This will include papers, notes, programs, and presentations. Regardless of the software you use to produce or store such information, a good search program will help you quickly access data when you need it. During the course of my research, I have stored thousands of documents in various file formats. Often times I can remember an author’s name, or a keyword, but cannot recall which document contains a particular quote or data item. A search program allows you to quickly identify the information you need, regardless of where it is located on your computer’s hard drive.

An admitted Luddite, I still use Windows XP as my operating system, so I can’t speak to whether Linux, Mac, Vista, or Windows7 users require an external search program. I’ve had good luck with X1 Search, which I started using back in 2004, when this program was named Yahoo! Desktop Search. Then, in 2006, the association with Yahoo! was terminated, but a free version of X1 remained available as X1 Client. Sadly, the last free version (5.6.3, Build 3453) is becoming difficult to find on the web anymore. Although X1 is no longer free, there are other free options in the desktop search category that should work just as well. Regardless of which desktop search program works best for your situation, you will save significant amounts of time by being able to rapidly search through your research documents and retrieve key bits of data.

Although I wasn’t surprised at my need to search journal articles, I have been amazed at how often I need to go back to find a section of software code that I had previously written. Over the course of the past several years, I’ve created thousands of lines of Matlab code, and I occasionally realize that I’m starting to rewrite an algorithm that I’ve already sorted out. So I open up my desktop search program, limit my search to Matlab files, and start typing in relevant keywords. I’m almost always guaranteed to find the needed code within a few minutes. If you’re an engineering grad student, you’ll likely get good use out of a desktop search client.