Saturday, April 18, 2009

Helvetica, the Swiss font.

I just watched Helvetica. It's a surprisingly interesting documentary. For some reason, I find typesetting more and more interesting as I write my dissertation. Once I put together my first LaTeX document, I was hooked.

Despite all of its quirks, LaTeX produces some pretty slick results. For virtually every problem, somebody has found a solution and posted a package for it. One really neat package is chemscheme. It works in conjunction with the chemcompounds (or bpchem) package to automatically number compounds in the text and schemes. The result is that I can draw a scheme in ChemDraw with temporary labels, include it in my document as an EPS file, and chemscheme will automatically replace the placeholders with the correct compound numbers. Neato!

Customarily, text is set in Times and figures are set in Helvetica while compound numbers are set in bold. In my document, numbers are set as text figures (old-style or lowercase numbers), while math and compound numbers are set as title figures (regular or lining numbers). This causes a problem. In order to switch between the two, I have to switch between the old-style and lining versions of the fonts. chemcompounds provides the \printcompound{} command, which can be redefined to change the formatting, and chemscheme provides the \schemerefformat{} command, which can also be redefined. However, \schemerefformat{} calls \printcompound{}. Therefore, if I change the font in \schemerefformat{} to get Helvetica, it is overridden by the font chosen in \printcompound{} to get lining figures.

Initially, I tried redefining the sans-serif math font to be Helvetica bold and switching to math mode within figures, but this produced strange results whenever the chemcompounds output was used. The final workaround, was to redefine \printcompound{} each time \chemrefformat is called, print the number in the figure and then set \printcompound{} back. It's a bit of a kludge, but it should work with other font combinations as well. The code for use with the kpfonts and helvet packages follows.


\renewcommand{\schemerefformat}[1]{
{\renewcommand{\printcompound}[1]{\textsf{\textbf{##1}}}%
{#1}%
{\renewcommand{\printcompound}[1]{\classicstylenums{\textbf{##1}}}}}}%

Sunday, February 08, 2009

Hackintosh

I'm certainly not the first person to do so, but I just set up my first Hackintosh. In the last few years I've become a fan of Apple's OS X, but really can't afford any more of their hardware on a grad-student's budget.
Fortunately, the folks at the OSx86 project have put a lot of effort into getting OS X working on non-Apple hardware. Notably, the MSi Wind netbook.
I had been poking around the Circuit City liquidation last week and spotted some Averatec rebranded Winds. I liked them quite a bit more than the Eee PC 701 that I use around the house and decided to pick up a Wind through Amazon (the liquidation wasn't all that great).
Using the MSIWindOSx86.iso distribution, handy instructions, and pointers from the MSi Wind forums, I've got everything working except for the built-in camera and the audio jacks. Also, probably due to the slipstreaming process, the Character Palette didn't work. However, I was able to resolve the issue by copying the Localization.prefPane and CharacterPalette.component from my iMac and clearing the system caches. Now I've got a little "Mac" for less than half the price of a refurbished Mac Air. Maybe, if I get a real job later this year, I can get the real deal... if I get a real job.

Saturday, January 10, 2009

Miscellaneous and Sundries

Finally, some real snow. I hear a lot of people complain about how cold it is in Pennsylvania, but I disagree. I think that the winters here are far too warm. When it's really cold, like in upstate New York, the only kind of precipitation that you see is snow. And when it's cold enough, the snow doesn't melt on top of your hat. Here I've seen rain, sleet, freezing rain, hail, and snow all within the last month. Of course, all of that stuff melted and refroze when it hit the ground making for treacherous roads and sidewalks. I need to get back up north.
I should have that opportunity soon enough. Yesterday, my boss has said that he wants me gone by the end of the semester. Sounds good to me. The only problem is that the job market is terrible right now. I think I've resigned myself to applying for post-doc positions, as if a million other people weren't going to be doing the same thing. Maybe the big oil companies have a few industrial post-docs open. They're the only ones with any money. On the bright side, the DOE will probably be well funded under the Obama administration.
Now for something completely different: I watched the end of The Office (US) season three last night and it was awesome. I had watched the UK version and loved it, but really been disappointed in the first season of the US remake. It had basically the same scripts as the UK version, but they didn't really fit the style of Steve Carell who had taken over for the brilliantly dry Ricky Gervais (who is now producing). However, I was persuaded to try the second season and it was far better. The writers seem to have taken it in their own direction, a little more slapstick, for US audiences and it works. I'm laughing my head off and still feeling the pathos of the characters. I've grown to like them all and I was totally stoked at the end of season three when Jim asked Pam out to dinner. Now I'm faced with a dilemma. I could go on and watch seasons four and five, which will be hilarious, or I could stop. If I stop now, I'll always believe that Jim and Pam lived happily ever after. Does anybody have any advice?