Friday, July 27, 2007

Star Trek XI? How did I miss this?!

How did I miss that in April 2006, it was announced that there would be an eleventh Star Trek film?! This just made my day!
Star Trek is the working title of the planned eleventh entry in the Star Trek film series—based on Gene Roddenberry's science fiction franchise. Sometimes referred to as Star Trek XI, the film received extensive coverage in the entertainment press during 2005 and 2006. In April 2006, after several years of rumor and speculation, Paramount Pictures announced that the film will be produced by Lost co-creators J. J. Abrams (who is also directing the film) and Damon Lindelof, and written by Roberto Orci and Alex Kurtzman, who will also be executive producing along with Bryan Burk. In July 2007, it was revealed and officially announced by Paramount that the movie will star Zachary Quinto and Leonard Nimoy.

Although few details are known about the film at this point, it has been confirmed that the film will feature James T. Kirk and Spock, and will be released on December 25, 2008.

I need to go to more movies! I don't think that there have been trailers for this yet, but maybe!! I'm getting chills when I look at...
Star Trek teaser poster
And look at the directors! And creators! And actors!! I need to get away from the computer and go and calm down somewhere... You should check out more information that was recently released.

The Shell is Back!

As of Windows XP, the shell is back. Microsoft now distributes PowerShell (PoSH). It has lots of nice features. See the Microsoft website where you can download it for free. You can find other PoSH links at Wikipedia.

Notice how command-line interfaces (CLI's) are making a huge comeback? After years of mousing, people have finally come to the (correct) realization that mousing sucks. So now we have things like QuickSilver, Spotlight (and Vista's equivalent), SlickRun, and others [1, 2, 3, 4, 5]. Mozilla Quick Searches and Google Desktop are just as much examples of this. The real hacker moves around with hot keys, macros, and short commands. Dare I say it is hip and trendy to stay close to the keyboard and use the mouse as little as possible?

I'm not saying the mouse has no place. Certainly, there are lots of applications where that interface is needed. However, the operating system is not one of those places. We need multiple interfaces, and the mouse probably belongs best to graphics applications that call for tugging and shifting things around in continuous ways. For the rest of the computer, just give me the keyboard.

Thursday, July 26, 2007

Tedly Quick Searches

If you're not familiar with keywords and quick searches in Mozilla Firefox and Mozilla Camino, you should check out "Fifteen Firefox Quick Searches" and "Firefox and the art of keyword bookmarking." Mozilla quick searches and keywords shave hours off each of my weeks (if not days).

I've posted my quick searches, and you can save them and import them into your own Mozilla bookmarks. For instructions on how to do this, see the quick searches post from above. My quick search bookmarks are basically an improvement on the bookmarks given in that post. I've fixed some annoying things about her selections, and I've added a few more.

If you do use my bookmarks, be sure to modify the local one and change the zipcode from 43210 to your zipcode.

Wednesday, July 25, 2007

VIM-LaTeX Modification: Forward Searching in OS X

UPDATE 3: If it doesn't seem like commands are launching from within Vim, check out my post on setting PATH in Vim. In particular, if you are using the nascent MacVim, checking the "Launch Vim processes in a login shell" preference may fix your problems.

UPDATE 2: I've updated the patch file to fix a few bugs in my original implementation (thanks to Ross M. Richardson for the help!). This version supports forward searching from multi-file projects. By the way, if you didn't know, if you have a project with multiple files where the main LaTeX document is called my_latex_file.tex, you should create a dummy file called my_latex_file.latexmain in the same directory. That way, VIM-LaTeX will know to run its compiler and viewer on the main file and not on any of the smaller constituent files.

UPDATE 1: Skim 0.6 and up supports spell checking of a PDF. This is a strange feature of a PDF viewer since Skim does not allow you to edit the PDF text directly. However, it makes a lot of sense when inverse searches are supported. After doing Shift+Command+CLICK on the misspelled word, the TeX editor will open up near the line of TeX where the word is found.

I have already commented on doing inverse searches (or backward searches) in Vim on OS X. However, I have not handled forward searches. Ross M. Richardson offers a hack for doing forward searches into PDFView; however, it's clear that while this is a hack it is certainly not a lifehack. What I really want is a version of VIM-LaTeX that supports using PDFView, Skim, TeXniscope, or any UNIX shell script as a forward-search-compatible viewer.

The script I presented in an earlier post makes backward searches compatible in nearly any PDF/DVI viewer. Now, I just need to hack compiler.vim to do the reverse. I did this by modifying the Tex_ViewLaTeX and Tex_ForwardSearchLaTeX functions from the 20060325 release of VIM-LaTeX. You can find my changes in VIM-LaTeX-osx-inverse-search-compiler.patch. To apply the patch, go into your ~/.vim/ftplugin/latex-suite/ directory, backup your old compiler.vim file, and try
patch -p0 < VIM-LaTeX-osx-inverse-search-compiler.patch
Of course, you should either drop the patch file into that directory or change the patch command so it has the full path to the patch. Now, all you need to do is configure your ~/.vimrc and you'll be able to use \lv for viewing and \ls for forward searches.

OS X Applications: Say that I want to use Preview to view PostScript files, TeXniscope to view DVI files, and Skim to view PDF files (note that both TeXniscope and Skim can open all of these, but only TeXniscope supports DVI source specials). In that case, I could put these lines in my ~/.vimrc file:
let g:Tex_ViewRule_ps = 'Preview'
let g:Tex_ViewRule_pdf = 'Skim'
let g:Tex_ViewRule_dvi = 'TeXniscope'
Now, VIM-LaTeX will use these whenever \lv (for viewing) or \ls (for forward search) are used. That's right, it will do forward searches with these OS X applications (well, Skim and TeXniscope)! That's easy enough.

UNIX Viewer Scripts: Now, let's say I wanted to use the skim and texniscope scripts that I built earlier. In this case, I use the following in my ~/.vimrc file:
let g:Tex_TreatMacViewerAsUNIX = 1
let g:Tex_ExecuteUNIXViewerInForeground = 1
let g:Tex_ViewRule_ps = 'skim'
let g:Tex_ViewRule_pdf = 'skim'
let g:Tex_ViewRule_dvi = 'texniscope'
That g:Tex_TreatMaxViewerAsUNIX tells VIM-LaTeX not to use open -a to open the viewer. The g:Tex_ExecuteUNIXViewerInForeground gets rid of the & appended to the end of the execution strings used by VIM-LaTeX. For some reason, this option needs to be set to get UNIX viewers to work in MacVim.

Empty Viewer Scripts and Other Stuff: As before, if those ViewRule variables are set to empty values (i.e., ''), open -a will be used. On the other hand, if g:Tex_TreatMacViewerAsUNIX is set, VIM-LaTeX will act like it does on a UNIX machine, and xdvi, xdvik, and kdvi can be used. These three DVI viewers are handled specially. Any other UNIX script should follow the convention:
script "%target_file" %line "%source_file"
where script is the UNIX command, %target_file is the main PDF, PS, or DVI file to open, and %line is the line in the TeX source file %source_file for forward searching (i.e., using \ls). If \lv is being used, the %line and %source_file parts are omitted.

Tuesday, July 24, 2007

Google School: Synonyms and Info

From Google School:

Google School: Rank Wikipedia articles in your results
If you want to get general background on something with Google, append the word "info" or "information" to your search term.

If your words appear in the title of a Wikipedia page, Google will list that article at the top of your results, for a convenient way to search both Google and the Wikipedia at once. --Gina Trapani

Also, from Lifehacker: 88 Tech Tricks to Turbocharge Your Day, by Gina Trapani:

Synonyms (Chapter 9, p. 223)
Search for synonyms using the tilde (~) next to keywords. This comes in handy when you are searching for a concept rather than for a specific word or sequence. For example:
  • ~nutrition ~information muffins returns exact matches as well as matches on Muffins Food Facts and Muffins Vitamin Information.
  • ~car turns up information on trucks and vehicles.
  • A search for ~pen yields pencils, graphite, and sketch.

Beware of Aronoff?

I walk by this "Caution: Floor Wet" sign every day. I think it's funny because it's in Dreese Labs, which is very far away from Aronoff Laboratory.
Caution: Aronoff

It's as if the ECE's are being warned about the EEOB people.

Monday, July 23, 2007

Scrobbling Pandora Songs to!

UPDATE: I just found OpenPandora, which is like a PandoraJam for Windows (i.e., it is a desktop Pandora application that scrobbles to So, our list of cool apps and mashups is now...
  • PandoraJam - OS X Desktop application that plays Pandora and scrobbles to It also includes lots of other cool features, like recording Pandora streams to a format that can be used by iTunes and the iPod.

  • OpenPandora - Windows Desktop application that plays Pandora and scrobbles to It also includes other cool features, like integration with the Wiimote and some software applications.

  • PandoraFM - Web mashup that combines Pandora and This mashup does more than just scrobble to; it really combines nearly everything of Pandora with nearly everything of For example, you can access tags and music information from
I'm not sure which is my "favorite." I'm just happy that these are available. I have a feeling there are more too.

I love Pandora. I also love I feel bad when I listen to Pandora because my songs don't get scrobbled to It's like all of that good listening time is just being wasted. However, I feel like I get exposed to more NEW music through Pandora because I primarily use to listen to my own station.

Today, I accidentally found PandoraJam, which solves this problem! It is a desktop application (like PandoraBoy) that streams from Pandora and, at the end of each Pandora song, scrobbles to! This gives me the best of both worlds! It has other features too. For example, you can record Pandora audio so you can take it with you later on your iPod. However, the scrobbling feature (which is the only entirely free feature) is the one that really impresses me.

However, this isn't a perfect solution. For one, it doesn't help me when I'm on a Windows machine. Second, it doesn't let me do cool things like "Love" tracks. So, I went searching, and I found PandoraFM. This is a WEB mashup that combines and Pandora. In fact, it even scrobbles at half the length of the song after a configurable number of seconds (default is 90), which is more like what you'd expect. So it's great! Solves all my problems.

So, if you use both and Pandora, you need to check out PandoraFM.

iUseThis: The OS X Software that I Use

Are you interested in the software that I use on my Mac? See my iUseThis profile.

You can use to see what people are using and find software related to other software. You can even setup your own profile and keep track of the software that you use.

Desktop Manager for OS X

This is not anything new, but there is a very nice freeware (open source) Desktop Manager for OS X. That is, this implements virtual desktops (i.e., multiple desktops that you can switch between; this lets you spread your apps across different screens).

It has a lot of cool features.

The Quick Reference Site (Cards and Books)

UPDATE 3: I did find the source of that regular expression card at Gordon McKinney's Pro IT Blog. Well, it's not a LaTeX source, but it's at least in letter format.

UPDATE 2: I found another good list of quick reference cards at the plantOzh blog. It includes a a regexp card, Perl 5 booklet, and CSS cards (1.0, 2.0). Yes, these cards are archived at the blog, so all of the commentary below still applies.

UPDATE 1: It's also annoying when someone simply archives existing quick reference cards because sometimes those archives use A4 paper. If these were linked to their origins, the source code (perhaps LaTeX) might be available, making a conversion to letter paper easy.

Lately, I have been quick reference happy [1, 2, 3, 4]. I cannot explain why, but I suddenly want to surround myself with quick references.

I think I found a great new quick reference resource. It's The Quick Reference Site, which features quick reference cards, e-books, and other papers and tutorials. From the site:
Throughout the years I have collected a huge pile of documents that deal with almost every aspect of software development. The purpose of this site is to centralize this information and to make it available to everyone who may need it or shares my passion on this subject. There are still a lot of documents in my "archive" that I like to share with you all.
At the moment this site represents only a fraction of what I want to provide, so a lot of work still needs to be done. As a result, you should consider this site as a work in progress. I'll try to keep you updated on the most challenging, powerful and continuously evolving software technologies of the moment. I hope that especially Java and C++ fanatics (like myself) will find some valuable information over here.
As far as I can tell so far, the author archives quick references that he has found over time and links us, the readers, to those archives. The advantage of this is that it minimizes the chances of broken links. The disadvantage is that the archives may not be the most recent versions. Additionally, if this site ever goes down and our bookmarks point there, those bookmarks will be broken.

Some quick reference cards that I want to point out (if you go to his list, you can also read descriptions of these programs):

So, that's fun.

On a slightly unrelated note, you can also check out Hawk Wings to find a QuickSilver quick reference and the QuickSilver user manual.

Sunday, July 22, 2007

Top 10 Computing Energy Savers

Top 10 Computing Energy Savers
Reducing the amount of energy your hungry computers eat up every day won't only save you money on electricity bills, it will reduce your carbon footprint. If you haven't thought about how much electricity your gadgets use up every day, now's the time. Turns out just a few changes in habits and system settings can save you money AND the environment. After the jump, have 10 ways to reduce your energy consumption and compute greener.

The site lists 10 tips for reducing the amount of energy your computer (and other devices) waste. Each tip has a link giving more information (e.g., what a "smart power switch" is).

Seeqpod: Playable Search

Also try SkreemR (, another playable music search (with some other cool features). The Tech-Reicipes Blog has a good description of the coolest features.

Try out SeeqPod (

It's a new search engine that searches the web for playable MP3 songs and then lets you play them right on the web page.

It's a great way to find free MP3 music, and it's arguably legal! :)

Copyright Explained

"Copyright Explained: I May Copy It, Right?" from Smashing Magazine
With blogging comes great responsibilty. You define the content of your weblog and you carry the full responsibility for every word you’ve published online. More than that, you are responsible for comments in your posts. To make sure you fulfill your legal obligations, it’s important to know, what you, as blogger, may or should do; and you have to know, how to achieve this. After all, the ignorance of the law does not make one exempt from compliance thereof.

This article explains copyright and how it applies to electronic material. Sure, it's focussed at bloggers, but anyone who is starting a career that involves publishing might be interested in this.

Thursday, July 19, 2007

Tech. Cheat Sheets!

Check out the recent "Developer’s Alarm: 200+ Hotkeys To Boost Your Productivity" from Smashing Magazine for more hotkeys. This focusses on Windows apps, but there are some apps that have cross-platform support, and so this isn't an entirely worthless post.

In the spirit of previous posts [1, 2, 3], here are some more!

I found, which includes some nice reference sheets, and some broken links. However, it got me thinking about "cheat sheet," which got me searching, and I found these popular links:
That last one probably beats my Thunderbird quick reference (PDF, LaTeX). However, those do not replace my Camino quick reference (PDF, LaTeX).

My (Reference) Desk

Now that I have compiled all of these quick references [1, 2, 3], I can put them together to surround myself in easy-to-access information. In fact, I will. I did. Here it is! From left to right (pictures taken with my wonderful phone and stored in a flickr photoset)...

Left of the Desk
Right of the Desk
Next to the Desk

Hot Key References

NOTE: The two updates below may serve as good LaTeX examples featuring the use of multicol.

UPDATE 2: I have used the Thunderbird list to make a Thunderbird quick reference PDF (LaTeX source available).

UPDATE 1: I have used the Camino list to make a Camino quick reference PDF (LaTeX source available).

I have been posting about quick references a lot lately [e.g., 1, 2]. I found another good quick reference site, It has lots of software hotkey quick references. For example,
So that's potentially helpful. But right now the pages are really slow to come up, so I have no idea what they look like. Nor do I know if I can easily get them onto a landscape sheet of paper that I can tape to the wall somewhere...

Wednesday, July 18, 2007

Traditional way to change cleveref defaults

UPDATE: cleveref also includes a set of defaults for the ntheorem package when the ntheorem option is given. I've just put those defaults into cleveref_nthoerem_defaults.tex. Include it with \input{cleveref_ntheorem_defaults.tex} after (or instead of) including the other file.

Because it will probably be a long time until a simpler way of changing cleveref defaults gets implemented, I needed a way to change these defaults without adding tens of lines to my LaTeX source. I came up with cleveref_defaults.tex, which basically contains all of the default lines from the cleveref documentation, plus a set of table defaults. You can include it with:
Then, go ahead and modify cleveref_defaults.tex to match your conventions (e.g., change the four "eq." to "Eq." and the four "eqs." to "Eqs.").

Protype for simplifying changing cleveref defaults

UPDATE: I have created crefntheoremdefaults.tex, which does this same stuff to the ntheorem package. You have to be sure to include the crefdefaults.tex file first. The files crefntheoremdefault_constants.tex and crefntheoremdefault_formats.tex play a similar role as the analogous ones below.

I think the package cleveref is great. In fact, I think it has much of what has been missing from LaTeX for a long time. See its documentation for more information about the package.

My only gripe about cleveref is that it is tedious to change something like all of the default "eq." and "eqs." to "Eq." and "Eqs.", respectively. So I put together these scripts as a kind of proof of concept (they also setup cleveref to handle table references, something that is not done by default at the moment):

The first script, crefdefaults.tex, is simply crefdefault_constants.tex concatenated with crefdefault_formats.tex. Therefore,
is equivalent to
However, if the poorman option is used and the corresponding sed script is applied, the resulting file will need to have the content of crefdefault_formats.tex removed; crefdefault_constants.tex should not be removed. In other words, if you are planning on using poorman, use the 2-line include and comment the crefdefault_formats.tex line out of the script that results from the sed script.

What's the outcome of this? I can now do
in order to change every item reference so that it is surrounded by upright round braces. Additionally, changing "eq." to "Eq." and "eqs." to "Eqs." is as simple as it was in hyperref (for use with \autoref); that is, it is these two lines:
Unfortunately, the output of the poorman sed filter is a little messy. However, if these are someday integrated into cleveref, that could be fixed. There are other shortcuts built into crefdefaults.tex as well. It probably requires documentation, but it's just a prototype for now.

Good idea? Bad?

MATLAB Quick Reference Cards (and more)

UPDATE: I list an AMSTeX reference card below. There is also an AMSLaTeX reference card available at

This is meant to be a follow-up to the "TeX Reference Card (and others)" post.

I found a list of a bunch more quick reference cards, which include applications/packages like MATLAB, MATLAB toolboxes, Perl, MFC, MySQL, Linux, UNIX, Vi, Vim, Windows, AMSTeX, TeX, and a bunch more...

However, I was just looking for MATLAB quick reference cards. So, here are these (some of which did not come from the above site):
So, that's nice. I recommend one of the bottom two [i.e., 1, 2].

Tuesday, July 17, 2007

Using Skim with MATLAB

I found a hint for using TeXShop as a MATLAB previewer on OS X, primarily because plots look better in PDF and TeXShop auto-updates files from disk. This was a tip from back in 2005. Since then, MATLAB's OS X plotting has gotten a lot better. Additionally, Skim has been invented.

Because of the advances in MATLAB, this may not be a useful hint anymore, but give this a try sometime:
set(gcf, 'Visible', 'off');
plot(x, y);
print(gcf, '-dpdf', 'figure1.pdf');
system('open -a Skim figure1.pdf');
Now, I believe there's a way to do this without having to plot first. That is, I think there's a way to plot to PDF without first generating that figure.

What's cool about this is that any future updates of the PDF will cause Skim to update automatically. Therefore, Skim becomes your plot viewer. That might be nice, right?

Using Skim, PDFSync, and TeXShop

UPDATE 3: I have updated the script to support command-line options that will prevent TeXShop from doing things like refreshing text (and trashing your unsaved changes), activating (taking your focus away), and opening (possibly getting in front of your view). Try the -h option for details.

UPDATE 2: There is a related Skim revision that will make it easier to use AppleScript for PDFSync interfacing. This change will prevent having to make UNIX shell scripts that must be modified with chmod.

UPDATE 1: As you can see in the Skim revision history, future versions of Skim will include their "Application Support" directory (e.g., ~/Library/Application Support/Skim/) as well as a "Scripts" subdirectory in their path. When that occurs, scripts like the one below can be stored there and executed from Skim without specifying the full path name.

I know there are ways to change TeXShop's previewer; however, I don't know how to do them. Additionally, I don't use TeXShop, so I have little incentive to look those things up.

However, I do use Skim, which is compatible with pdfsync, and recently someone asked me how they could get Skim to call up TeXShop at a particular line (as someone would want to do when using pdfsync).

For that, I generated a texshop script that looks like this (an earlier version of this can be found on the Skim wiki):

[ "${fileName:0:1}" == "/" ] || fileName="${PWD}/${fileName}"
[ "${lineNumber}" == "" ] || gotoString="goto line ${lineNumber}"

exec osascript \
-e "set texFile to POSIX file \"${fileName}\"" \
-e "tell application \"TeXShop\"" \
-e "activate" \
-e "open texFile" \
-e "tell front document" \
-e "refreshtext" \
-e "${gotoString}" \
-e "end tell" \
-e "end tell"
To use this script, follow these steps:
  1. Save that file as something (preferably in the PATH somewhere, but this is not necessary) like
    or anywhere you would like (e.g., /Users/username/bin/texshop). However, if you place it somewhere differently, be sure to update the red text in these instructions.

  2. Next, chmod it 0755, as in
    chmod 0755 /usr/local/bin/texshop
    This can be done from the Terminal.

  3. Finally, tell Skim's PDFSync preferences (under Preferences->LaTeX or Preferences->Sync depending on your Skim version) to use a "Custom" editor with
    Command: /usr/local/bin/texshop
    Arguments: "%file" %line
    Make sure you click AWAY (e.g., onto a different tab) from the PDFSync settings before you close the Preferences. Otherwise, one of your text boxes may not get saved.
After this is done, doing Shift+Command+CLICK in Skim on a location in the PDF will bring up the source in TeXShop located at the that generated that point in the PDF.

Note that if you have saved texshop somewhere in your PATH, then you should be able to drop the /usr/local/bin/ from the front of the Command: line.

Great 2-port USB KVM switch: IOGEAR GCS632U MiniView Micro USB Plus

A while ago I made a couple of posts about KVM switches [i.e., 1, 2]. In that case, I was searching for a PS/2 KVM switch that supported 5-button mice. Several KVM switches failed me, including a switch from Belkin that looked great on paper but was awful in practice. In the end, it was the cheapest switch that worked like a charm. Well, here's how things went this time.

  • Again, Belkin makes crap: Last week I went through virtually the same process with 2-port USB KVM switches. This time I needed a USB switch to go back and forth between my Apple PowerBook and my Dell Workstation (I'm spanning the PowerBook's second monitor onto the Windows machine). Because it looked to be the cheapest, I tried the Belkin F1DK102U 2-Port USB KVM Switch with Built-In Cabling first. It said it supported OS X and XP. Strangely, it also required software to be installed in order to use it. This should have been my first clue that I was wasting my time and money with this awful Belkin product. I don't remember the last time I was pleased with a Belkin product (I suppose I had some UPS's from them that weren't that bad). Despite being OS X compatible, booting with the product connected caused the PowerBook to crash pretty bad. It gave me that little black window of death on bootup. Again, because it required software in order to use, that made uninstalling it (while the monitor was still connected to it) was a pain. PLUS, when it was connected, it wasn't able to emulate my monitor and mouse and keyboard, and so Windows and OS X weren't convinced that I was using the monitor, mouse, and keyboard that I was using. Oh, and on TOP of that, one of its attached cables (you can see this in the picture) is only about a foot long, and it's the DEFAULT PORT! This was a lousy product.

  • IOGEAR is lovely as always: Luckily, I had to go back to the store for a different reason, and I noticed that they had four IOGEAR GCS632U MiniView Micro USB Plus 2-port KVM switches, and two of those switches were marked at a price CHEAPER than the Belkin piece of crap. I had someone check, and the correct price was the low price. So I took the Belkin back and got the IOGEAR instead. This switch said it was Mac compatible (Mac mini compatible, even). Heck, it even said it was SUN compatible! It also had ANALOG AUDIO support, which is kinda nice. Finally, right on the box it said, "USB sniffing technology allows complete USB mouse and keyboard emulation for error-free boot-up." This feature was one of the major things I LOVED about the old QVS PS/2 switch. Plus, I figured this meant that it would crash my PowerBook like the Belkin thing did. Both of its cables were the same length (6'), and it would choose a "default" port based on what was powered on. Oh, and did I mention it didn't require software?
The result? The IOGEAR GCS632U, the cheapest 2-port USB KVM switch that was available to me, worked EXACTLY as I wanted it to. It's beautiful. It's slick. I love it. I love IOGEAR.

NOTE: IOGEAR also has a PS/2 version of this switch that I'm guessing works as superbly as the QVS KVM-12CK (the PS/2 switch from the previous posts) that is still working great today. - stop getting credit card offers!

This was suggested on NPR's Day to Day today to opt out of getting credit card and insurance offers in an effort to save money while also saving paper.

Go to to do this. They'll submit your request to the credit bureaus, and eventually that'll stop creditors and insurers from sending you CRAP.

Thursday, July 12, 2007

Skim automatic refreshes and simpdftex

UPDATE: I've updated the script so that it works with OS/X Leopard. See comments for details.
The OS X PDF viewer Skim has the ability to automatically refresh files after they have been updated on disk. In Skim version 0.4.1 and below, this was done by polling a file every second to see if it has been changed. In Skim version 0.5 and up, this feature is implemented using kqueue events. This is a much better way of doing things. However, if the file that is open gets deleted and a new file created with the same name, events for that new file will not be received by Skim.

Unfortunately, the script simpdftex that comes with a number of LaTeX distributions (e.g., gwTeX) deletes a PDF before updating it. This means that autorefreshes won't work when regenerating a PDF from its LaTeX source using simpdftex.

So, motivated by the history in a Skim bug report, I've put together a simpdftexnodel script that fixes this problem (based on the 2007/05/07 gwTeX simpdftex). To use this file:
  • Place the script somewhere (probably in your PATH).
  • chmod the file 0755.
  • Make sure that your distillers and TeX program (or at least symlinks to them) exist in the same directory.
  • Stop using simpdftex and start using simpdftexnodel.
I hope that helps!

Wednesday, July 11, 2007

PDFSync inverse searches on Vim for OS X

FINAL UPDATE: See the new post, "PDFSync Inverse Searches in MacVim," for the state of the art on this subject.
UPDATE 8: Skim 0.6 and up supports spell checking of a PDF. This is a strange feature of a PDF viewer since Skim does not allow you to edit the PDF text directly. However, it makes a lot of sense when inverse searches are supported. After doing Shift+Command+CLICK on the misspelled word, the TeX editor will open up near the line of TeX where the word is found.

UPDATE 7: caveat Vimmer! Inverse searches in Skim are called up with Shift+Command+CLICK. This is fine; however, if you hold Shift+Command too long, the AppleScript for calling up Vim is going to get confused. In other words, be sure to release the modifier keys as soon as possible after the "click."

UPDATE 6: I found information about doing both forward and backward searches with Vim and PDFView (see also: using From these, I've made hacks to the VIM-LaTeX scripts for PDFView and other viewers (like Skim and TeXniscope). I will describe these hacks in another post.

UPDATE 5: See Vim Tip #225 and the corresponding wiki entry for information about both backward and FORWARD searches in Vim. I also found a nice LaTeX tools script for Vim that has forward searching built in. I found these pages linked from a page on xdvi inverse searches.

UPDATE 4: Very trivial updates have been made in a 1.03 version of this script.

UPDATE 3: I have posted a 1.02 version of this script. The changes are fairly trivial, but you might be interested in checking it out.

UPDATE 2: This script is now a part of the Skim wiki.

UPDATE 1: I have mirrored this post at my web site.

WINDOWS USERS: See "Performing inverse searches" from the VIM-LaTeX quick start guide.

I have posted information about this in a number of places [1, 2, 3, 4, 5]. I plan to add something at MacResearch sometime soon too.

The package PDFSync allows users to do "backward searches" or "inverse searches" from PDF viewers like iTeXMac, TeXniscope, Skim, and others. That is, if you generate a PDF with LaTeX (or Plain TeX or ConTeXt), you will be able to click on text in the PDF and have an editor open up and position the cursor at the TeX source code that generated that text. That can be very nice.

There is a related feature for DVI files, but there are very few good DVI viewers out there (TeXniscope comes close), so I just focus on PDFSync).

I use Vim with VIM-LaTeX to do my document preparation. I would like to also be able to use PDFSync. However, while inverse searching is supported in Windows, it is not easily done in OS X.

I found a thread describing how to do inverse searching with AppleScript that issues raw commands to Vim. I decided to take that AppleScript, package it into a bash script, and fix it so that it had no problem handling files with spaces or symlinked files or multiple files with the same base name. The result is this script:


[ "${filename:0:1}" == "/" ] || filename="${PWD}/${filename}"

exec osascript \
-e "set ESC to ASCII character of 27" \
-e "tell application \"Vim\" to activate" \
-e "tell application \"System Events\"" \
-e "tell process \"Vim\"" \
-e "keystroke ESC & \":set hidden\" & return " \
-e "keystroke \":if bufexists('$filename')\" & return " \
-e "keystroke \":exe \\\":buffer \\\" . bufnr('${filename}')\" & return " \
-e "keystroke \":else \" & return " \
-e "keystroke \": edit ${filename// /\\\\ }\" & return " \
-e "keystroke \":endif\" & return " \
-e "keystroke \":${lineNum}\" & return " \
-e "keystroke \"zO\" " \
-e "end tell" \
-e "end tell"
Copy that script in a place (preferably in your PATH) like
and chmod it 0755. That is, do
chmod 0755 /usr/local/bin/gvim-pdfsync
Then you can use the script like
gvim-pdfsync "%file" %line
where %file is the name of the file to be opened and %line is the line to place the cursor on. So, for Skim, you would put in your LaTeX (or Sync) preferences under "PDFSync" support:
Preset: Custom
Command: gvim-pdfsync
Arguments: "%file" %line
After configuring Skim, BE SURE TO CLICK AWAY FROM THE TEXT BOXES before closing the configuration. For example, click on one of the other tabs. Otherwise, the dialog box may not record your changes to the last text box you changed.

I hope that's useful to someone.

Women more dominant than men

WebMD : Wives Wield Decision Power in Marriage
Balance of Problem-Solving Power Weighs in Favor of Women
Men may rule the world but women rule the roost, according a new study that shows women wield considerably more decision-making power than men within marriages.

Researchers found that wives, on average, displayed more power than their husbands during problem-solving discussions, regardless of who brought up the topic of discussion.

And it’s not simply a case of women talking more than men.

“It wasn’t just that the women were bringing up issues that weren’t being responded to, but that the men were actually going along with what they said,” researcher Megan Murphy, assistant professor of human development and family studies at Iowa State University, says in a news release. “They were communicating more powerful messages, and men were responding to those messages by agreeing or giving in.”

“There’s been research that suggests that’s a marker of a healthy marriage – that men accept influence from their wives,” Murphy says.

Tuesday, July 10, 2007

TeX Reference Card (and others)

UPDATE 3: I found the source of the popular LaTeX cheat sheet. It includes a PS version, a PDF version, PNG views [Page 1, Page 2], and the LaTeX source. It's nice that the source is available. That makes it easier to shift from A4 to letter paper and back.

UPDATE 2: More reference cards can be found in the follow-up to this message.

UPDATE 1: Check out and the old version There are lots of useful cards, including some of the ones I linked below. This TeX card and this Vim card look familiar. There are other EMmacs and Vim cards in the editors section. There is also a typesetting section that includes a LaTeX cheat sheet.

The Brown University Center for Fluid Mechanics, Turbulence and Computation (CFM) has a collection of computing tutorials. Buried in there somewhere is a useful Plain TeX reference card in PostScript format. I have generated a PDF version of this reference card.

I stress that this is a Plain TeX reference card, and so there are different ("better"?) ways of doing some of these things using other LaTeX macros (note TeX vs. Plain TeX vs. LaTeX differences: [1, 2, 3, 4, and more]). However, this is still a very useful reference card. It prints out as two landscape-oriented pages (weirdly sized: 11.7" x 8.3"). I plan on printing this out and taping it next to my desk at the office. I also found a useful longer Plain TeX reference sheet that may be helpful to some people. Of course, there are even longer Plain TeX reference documents also available.

Oh, I also found this AUC TeX reference card PDF with available source code. I don't use AUC TeX (I favor VIM-LaTeX), but maybe someone who does could use this. FYI, AUC TeX is a package for EMacs providing extra support for LaTeX (and others).

Speaking of Vim: So that's nice.

Correction: TeXnicians (and TeXackers) over TeXperts

I thought this correction to a Brown university TeX tutorial was really cute.
I like you page on TeX, but had to comment that TeX is properly pronounce like the Tech in Technology (Knuth "The TeXbook" page 1) and thus the proper name for a TeX hacker is a TeXnichian not a TeXpert as you stated on your page ( in fact the first exercise in the TeXbook is "After you have mastered the material in this book will you be: A TeXpert or a TeXnichian?" to which the correct answer is "A TeXnician (underpaid); sometimes also called a TeXacker." (Knuth, the TeXbook)

Please change this grievous error.


Christopher A Craig (

Monday, July 09, 2007

\cref* and \crefrange*: temporarily disable cleveref hyperlinks

UPDATE: I've e-mail chatted with the author of cleveref, and it sounds like the changes below (the * macros and the new defaults) may get built into the next release. So that's exciting. The author has recently sent me new versions of cleveref that include these suggestions. Only time will tell when it's on CTAN. So that's exciting.

I've also had a chance to reflect on the poorman option of cleveref. It's an interesting idea. When loaded with this option, cleveref will generate a sed script that the author can use on the source files that will change each of the cleveref macros into old-fashioned references with everything typed out. That is, if you have a journal that does not support cleveref, you run sed on your source code before uploading it, and your journal works with the resulting files that are stripped of cleveref code. That's pretty clever.

I think that by the 1.0 version of cleveref package, it will be ready to replace hyperref's \autoref macro.

One thing that hyperref gives you that cleveref does not are starred versions of the referencing commands that disable hyperlinks. For example, in hyperref, \ref* and \autoref* work exactly like \ref and \autoref but are not hyperlinked. That's nice. Of course, there is no \Autoref or \autorefs or \Autorefs.

A major nice thing that cleveref does is let you format your expanded references with more detail than hyperref. For example, you can make an equation reference expand as "Equation (1)" where the "1" gets linked while having a figure reference expand as "Fig. 1" with the whole "Fig. 1" linked. Of course, this assumes that you've loaded both cleveref and hyperref, like this:
Additionally, cleveref does give the equivalent of those special versions of \autoref. cleveref supports single and multiple references, including reference ranges.

So consider the following, which gives you all the nice stuff about cleveref but also adds starred versions of its macros:

% \cref and \cref*

% \crefrange and \crefrange*

% \Cref and \Cref*

% \Crefrange and \Crefrange*

So there you go! That nearly beats \autoref!

Why nearly? Unfortunately, cleveref breaks some Springer journal document classes. The author also doesn't claim that it does or does not support item labels (he mentions that it may or may not, so it's uncertain). Finally, I don't like the default choices for some of the label formats. For example, you shouldn't ever start a sentence with an abbreviation, and the parentheses that go around equation numbers should be surrounded by \textup to keep them from looking silly in an italicized theorem environment. That's why I'm saying that by the 1.0 version (it was 0.6 since June of 2007), it should be a pretty awesome package... especially if the modifications above are built into the package.

Saturday, July 07, 2007

MacResearch - Online Community for OS X in Science

This might have potential...

MacResearch - Online Community and Research for Mac OS X in Science is an open and independent community for scientists using Mac OS X and related hardware in their research. It is the mission of this site to cultivate a knowledgeable and vibrant community of researchers to exchange ideas and information, build a community knowledge-base, and collectively escalate the prominence of Apple technologies in the scientific research community.

Breathing is carbon neutral, asshole

It's not uncommon to hear people say things like, "Carbon neutral? What's that? Wouldn't you have to stop breathing? <huh huh> <huh huh>"

The carbon in the carbon dioxide that you exhale is a product of cellular respiration inside your cells. It comes from breaking down sugar (a carbohydrate). The process liberates the carbon from the sugar so that it can bond with the oxygen that you inhale to form carbon dioxide and water (e.g., urine or "pee"), and this releases energy since carbon would much rather be a part of carbon dioxide than sugar. This energy is what you use to go about your day and say statements like the above.

So where does the sugar come from? It what is produced in the photosynthesis that goes on in plants. Photosynthesis uses energy from the sun to reshuffle water and carbon dioxide into oxygen and sugar.

That's right. The carbon you exhale comes from sugar that could not have been made without pulling carbon out of the air.

So that's why breathing is carbon neutral.

This is also why combustion, which is related to cellular respiration, of pure biofuels (hydrocarbons) is POTENTIALLY carbon neutral (see notes about sustainable yeilds); the carbon in those fuels was originally pulled out of the air by a plant somewhere, and hopefully more plants will pull it out of the air after combustion. Of course, there are lots of other things involved in combustion (e.g., processing and transporation of biofuels as well as the consumption that goes on in the process of burning those fuels) that are not carbon neutral (and, again, there's that issue of burning so many plants that you don't have any left to take the carbon out of the air; again, see sustainable yield).

You should consider these things when you think about livestock as well. Breathing does not prevent something from being carbon neutral.

So what isn't carbon neutral? If you are releasing carbon that did not (recently) come from a plant source, you are probably not being carbon neutral. Burning fossil fuels is liberating carbon that has been buried for (hundreds of) millions of years. This is why the word fossil is used. This carbon would have stayed buried if it was not for human intervention. This causes a stability problem on the surface of the earth. The carbon cycle gets out of whack because that extra carbon does not go back to its source. In fact, the only way to get that carbon back to where it came from is to have a mass extinction and then millions of years of geological processes.

So that's the scoop on carbon neutrality.

Aurora: Ribbit all grown up

I just found out that Ribbit, the program that gave LaTeX support to Microsoft® Word (on Microsoft® Windows), has changed its name to Aurora and has lots more features. From its web page:
  • No more mouse-hunting for symbols—enter great-looking math quickly and efficiently using the standard language of scientific typesetting.
  • Express any scientific concept from mathematics, computer science, chemistry, engineering, and many other areas.
  • Full integration with Microsoft® Word, PowerPoint®, Visio®, and Excel®.
  • Built-in LaTeX document converter.
  • Advanced support for equation numbering.
  • Works with any Windows application that has an “Insert Object...” function or lets you paste images.
In short, Aurora brings to Windows what a countless many applications (e.g., LaTeX Equation Editor) bring to OS X.

Auroa gives a LaTeX support to Windows applications.

There's a 30-day free trial. After that, Aurora is $45 for regular users and $35 for academic users. If you don't have MiKTeX (or some alternative) installed, it can install a free micro version for you.

Other notable examples of Windows applications with LaTeX integration include AbiWord, OpenOffice (see OOoLatex), and TeXmacs.

My LaTeX-using colleagues would want me to reminder the reader that if you know enough LaTeX to be entering equations using it, you probably should just be using LaTeX directly. Why fake it? Despite Aurora's claim that it is "even better than the real thing," it's a distant second at best. That being said, it is SO much better than the Microsoft® Equation Editor, which should absoultely never be used.

Friday, July 06, 2007

Script to open file in TeXniscope from command line

UPDATE 2: A much fancier version of this script is now available. It has options that make it easier to make TeXniscope update its file and position (via PDFSync or DVI source specials) in the background. The options are described briefly with the -h parameter.

UPDATE 1: A more mature version of this script is now available. It has a usage line. It checks for the existence of files. It tries to guess at a file name if the file does not exist. It's a little more convenient for the command-line user.

Here's a script to open a (PDF or PostScript) file in TeXniscope from the command line:

[ "`echo $*|cut -c 1`" == "/" ] || filename_prefix="`pwd`"

exec osascript \
-e "tell application \"TeXniscope\"" \
-e "activate" \
-e "open file ((POSIX file \"$filename_prefix/$*\") as string)" \
-e "refresh of the front document" \
-e "end tell";
or, alternatively,

[ "${arguments:0:1}" == "/" ] || filename_prefix="$PWD"

exec osascript \
-e "tell application \"TeXniscope\"" \
-e "activate" \
-e "open file ((POSIX file \"$filename_prefix/$*\") as string)" \
-e "refresh of the front document" \
-e "end tell";

Create an executable script called texniscope (e.g., /usr/local/bin/texniscope that is chmod'd 755) and try texniscope FILENAME where FILENAME is the name of the PDF or PostScript file that you want to open (be sure to include the file extension).

This allows you to use TeXniscope as a LaTeX document viewer in the VIM-LaTeX suite for Vim.

See also: Script to open file in Skim from command line

I use this for Vim/GVim; however, this script was inspired by code in an example in the TeXniscope help file for making TeXniscope work with iTeXMac. See the TeXniscope documentation for information on how to build a script that will let iTeXMac call TeXniscope from the command-line (and even make use of PDFSync [CTAN, iTM]).

Script to open file in Skim from command line

UPDATE 4: I have updated the script to accept command line options. A -h option gives help text describing the new usage. The options can prevent Skim from being activated or opening the file. This may be useful when trying to get Skim to update in the background.

UPDATE 3: I have updated the script to check for whether or not files exist, try to guess the right files if they don't, and bail if it fails. It also has support for PS and DVI files. Also fixed a problem with symlinked files.

UPDATE 2: I have generated a more mature version of this script that also has the ability to position Skim's PDF view at a position corresponding to a line of your TeX source (provided you built the PDF with pdfsync).

UPDATE 1: As discussed in this feature request and this Wiki entry, in iTeXMac, you can also try %line "%pdffile" "%texfile"
which lets you make use of Skim's PDFSync support. The Wiki page includes instructions on using this in Emacs and TextMate as well. If you just want to open the file, you might try 1 "%pdffile"
but this might break if the TEX file isn't available (so maybe you should still use the AppleScript below).

Here's a script to open a (PDF or PostScript) file in Skim from the command line:

[ "`echo $*|cut -c 1`" == "/" ] || filename_prefix="`pwd`"

exec osascript \
-e "tell application \"Skim\"" \
-e "activate" \
-e "open ((POSIX file \"$filename_prefix/$*\") as string)" \
-e "revert front document" \
-e "end tell";
or, alternatively,

[ "${arguments:0:1}" == "/" ] || filename_prefix="$PWD"

exec osascript \
-e "tell application \"Skim\"" \
-e "activate" \
-e "open ((POSIX file \"$filename_prefix/$*\") as string)" \
-e "revert front document" \
-e "end tell";

Create an executable script called skim (e.g., /usr/local/bin/skim that is chmod'd 755) and try skim FILENAME where FILENAME is the name of the PDF or PostScript file that you want to open (be sure to include the file extension).

This allows you to use Skim as a LaTeX document viewer in the VIM-LaTeX suite for Vim.

NOTE ABOUT revert: The line with revert in it requires Skim version 0.5 or higher. If you don't have that version of Skim (or you don't care about refreshing the document), then delete that line.

See also: Script to open file in TeXniscope from command line

I use this for Vim/GVim; however, this script was inspired by code in an example in the TeXniscope help file for making TeXniscope work with iTeXMac. See the TeXniscope documentation for information on how to build a script that will let iTeXMac call TeXniscope from the command-line (and even make use of PDFSync [CTAN, iTM]). It should be easy to modify the script they give there to call Skim instead of TeXniscope; use my script here as an example. Note that Skim's AppleScript also supports all of the goto line stuff of TeXniscope. However, the syntax is different; see the Skim AppleScript dictionary for more information.

Two small bugs in merlin.mbs

UPDATE: I've posted a patch file as well as a patched merlin.mbs that fixes this problem. If you prefer the patch option, execute
patch < merlin-fix-nm-rvvc.patch
in the same directory as your old merlin.mbs file. Be sure you're using the 4.20 (2007/04/24) version of merlin.mbs to start with (search through the file for the ProvidesFile line.

I just sent this to Patrick W. Daly. I think I've found two small bugs in merlin.mbs (from custom-bib), the master bibliography style used to generate many common BST files. They both involve adding an nm-rvvc near some existing nm-rvv lines.

I am referring to the 4.20 version of merlin.mbs. I think this is the latest version of the MBS file.
% \ProvidesFile{merlin.mbs}[2007/04/24 4.20 (PWD, AO, DPC)]
The bugs:
  • In FUNCTION {sort.format.names} (lines 8394--8401)
    %<!vonx> "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}"
    %<vonx> "{ll{ }}{ ff{ }}{ jj{ }}"
    %<!vonx> "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
    %<vonx> "{ll{ }}{ f{ }}{ jj{ }}"
    I think this should be:
    %<!vonx> "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}"
    %<vonx> "{ll{ }}{ ff{ }}{ jj{ }}"
    %<!vonx> "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}"
    %<vonx> "{ll{ }}{ f{ }}{ jj{ }}"
    Otherwise, I think this would cause problems sorting when authors might share last names and first initial.
  • In FUNCTION {format.names.ed} (lines 4908--4929)
    "{f{.}.}"$ duplicate$ empty$ 'skip$
    { bib.fname.font swap$ * }
    s nameptr
    "{vv~}{ll}"$ *
    s nameptr
    "{jj}"$ duplicate$ empty$ 'skip$
    { bib.fname.font " " swap$ * }
    "{ff}"$ duplicate$ empty$ 'skip$
    { bib.fname.font swap$ * }
    s nameptr
    "{vv~}{ll}"$ *
    s nameptr
    "{jj}"$ duplicate$ empty$ 'skip$
    { bib.fname.font ", " swap$ * }
    I think this should be:
    "{f{.}.}"$ duplicate$ empty$ 'skip$
    { bib.fname.font swap$ * }
    s nameptr
    "{vv~}{ll}"$ *
    s nameptr
    "{jj}"$ duplicate$ empty$ 'skip$
    { bib.fname.font " " swap$ * }
    "{ff}"$ duplicate$ empty$ 'skip$
    { bib.fname.font swap$ * }
    s nameptr
    "{vv~}{ll}"$ *
    s nameptr
    "{jj}"$ duplicate$ empty$ 'skip$
    { bib.fname.font ", " swap$ * }
    That actually looks like it will give a formatting error on output!
So hopefully those'll get fixed, right? Am I missing something? Am I wrong?

Thursday, July 05, 2007

These are my alli pants

I know I'm not the first one to point this out...

Some background information: alli is the first FDA approved diet pill. It works by blocking the absorption of fat. From their webpage: - what are treatment effects?
You may feel an urgent need to go to the bathroom. Until you have a sense of any treatment effects, it's probably a smart idea to wear dark pants, and bring a change of clothes with you to work

I shit you not.

There are some other good ones too.
You may not usually get gassy, but it's a possibility when you take alli. The bathroom is really the best place to go when that happens

Yummy! Time to get thin.

Bees and dumb Michigan people...

NPR : Mich. Home Becomes Beehive
Morning Edition, July 5, 2007 - In Michigan, Sarah Spitler and her husband noticed a few honey bees going in and out of a hole in their house. Given the bee shortage they decided to leave the hive alone. Now with tens of thousands of bees in the walls and an odor in their home, the Spitlers have called the exterminator. But here's the problem, once the bees are dead their waxy comb will melt and gallons of honey will leak from the walls.

My Honey Bee Poster

Tuesday, July 03, 2007

How you like them apples?

UPDATE (07/06/2008): Krapples are now $2.29/pound (compare to Giant Eagle with $1.99/pound). Milk is $3.49/gallon (compare to Giant Eagle with $3.19/gallon).
UPDATE: Meijer also $1.49 per pound apples. I think it's safe to shorten "Kroger apple" to "Krapple." I've e-mailed Kroger, and I've requested that the Attorney General investigate.

The Kroger grocery stores around me usually have red delicious apples (i.e., #4016) for $1.69 per pound. That's not too bad. However, for a long time (at least a month) they have been selling those apples for $2.29 per pound. I'm sure that this has something to do with the damage to the apple crop from the big frost over the winter. In fact, I think that the other types of apples have gone up in price too.

However, I don't think that I've seen prices THAT high at other big stores.

In fact, I know that Sunflower Market (SM), a certified organic store where prices are expected to be higher, has been selling organic red delicious apples (i.e., #94016) for $1.29 per pound! And the rest of their apples sell for around that price too (in fact, SM has pretty decent prices for the stuff they have there; it seems to be a quality store).

So what's going on at Kroger? Why the highway robbery?