Wednesday, February 25, 2009

Sumatra PDF Viewer for LaTeX users on Windows

If you use LaTeX on Windows, or in particular pdflatex, you must have noticed that viewing the resulting PDF file is not as easy as you would think.

Sure, Adobe Reader displays it fine. But apart from being bloatware and slow as hell, it also locks the PDF file it is displaying. Thus you cannot rerun pdflatex until you close the file in Reader, because the output file cannot be overwritten. This is a pain in the arse.

Foxit Reader seems like a decent alternative; it is much faster and less bloated than Adobe Reader (even though the installer tries to get you hooked on several other pieces of software that you probably don't want). Foxit does not lock the currently viewed file; however, it offers no reload option, and if you overwrite the output file, it will only display blank pages for what's not currently cached.

Enter Sumatra PDF. A very lightweight and very simple program, contained in a single executable file, written by a single developer, but it has the one killer feature that LaTeX authors need. It automatically reloads the PDF file whenever it changes. And it stays on the same place in the document while it does this.

There is currently a bug that causes the window to demaximize when it reloads, but you can work around that simply by not maximizing the window in the first place. This little viewer will definitely make my life easier.

Tuesday, February 3, 2009

Sunday, February 1, 2009

USB: the right direction

USB plugs are annoying, because it's hard to see how to plug them in, and you have only a 50% chance of getting it right on the first try. But I recently noticed what seems to be a little-known feature that increases your odds. There is a little USB logo on one side of nearly all plugs. It seems that manufacturers mount their ports in such a way that the logo should face upwards.

I haven't figured out the case of side-facing ports yet, but maybe there is a pattern there as well. If your computer has such ports, let me know in the comments which way the logo should face on those!