Small fix for article class in plasTeX

I recently found a small error in plasTeX, the program I like to use to convert latex to html. Unfortunately, it looks like it is not being actively developed anymore, but since it is open-source, and it is written in python, which I know, I was able to figure out the issue in not too long. When running plasTeX, I was getting this error:

robert_felty$ plastex -c annualReport2012.cfg annualReport2012.tex
plasTeX version 0.9.1
ERROR: Could not load package "article": name 'Command' is not defined

I started googling around, and found
this post helpful. Basically it complains about not getting a proper stacktrace in the Base/LaTeX/ module. Indeed, I commented out the try/except clause in the PackageLoader class, and found that the problem was going all the way back to the Packages/ script.
I eventually figured out that article was importing stuff from report, which was importing stuff from book. I am not exactly sure why this wasn’t working, but importing directly from book, instead of vis-a-vis report seemed to do the trick.

 diff Packages/ Packages/
< from book import *
> from report import *
<     import book
<     book.ProcessOptions(options, document)
>     import report
>     report.ProcessOptions(options, document)

I haven’t encountered this issue before. I wonder if it has something to do with python 2.6 versus 2.7. I only use plasTeX about once a year to write my annual report, and I think I might have been on python 2.6 a year ago.

Posted in latex, python | Comments Off

Em dash in LaTeX

My friend Daniel Reeves was recently discussing different ways to typeset em dashes. Here is the way I like to do it in LaTeX.

%this sets up a new command \dash, which makes nice dashes
Let's test out several different variants on making an em dash using the
\LaTeX typesetting system --- this one uses \verb|---| with spaces around it

Let's test out several different variants on making an em dash using the
\LaTeX typesetting system---this one uses \verb|---| with no spaces around it

Let's test out several different variants on making an em dash using the
\LaTeX typesetting system \dash this one uses my \verb|\dash| command


Here is the resulting output:

Different ways to make em dashes in LaTeX

Different ways to make em dashes in LaTeX

Notice how using spaces around the --- can result in a dash at the end of a line, which is not desirable. And using no spaces around the --- doesn’t look nice, and can also result in problems when copying and pasting. The \dash command solves both of these issues. I did not come up with it myself, but I cannot remember where I found it.

Posted in latex | 1 Comment

Vetting vignetting

We recently got some family portraits taken at JCPenney. I think they turned out very nicely. They had a bunch of different effects that they could apply. While we were at the studio, I really liked the way that the vignetting effect brought out our faces. However, after investigating the full set (we bought the digital images), I decided I didn’t like the vignetting, because it was actually making my face a bit dark in one shot. Then I decided to play around with vignetting a bit more. I was disappointed to see that Picasa does not support vignetting. Fortunately I found a handy gimp script to do the job. At first I tried using it with a rectangular selection. Then I tried an oval one which I like best. Here are the various pictures:

Posted in linux, photography | 2 Comments

UNIX/Linux permissions and groups – getent

I keep forgetting this command, so I writing it here so I know where to find it. Getent will list information about users and groups on a UNIX/Linux system, including NIS and LDAP users, which is crucial networks with multiple nodes. For example to list information about a user named robert_felty, you can do:

$ getent passwd robert_felty
robert_felty:$1$iPJ.svD/$ce77I/wxh129FLt2Z7UOm.:5440:112:Robert Felty:/home/robert_felty:/bin/bash
Posted in linux | Comments Off

Cherry rhubarb pie

Slice of cherry rhubarb pie

Slice of cherry rhubarb pie

We joined a CSA this year, taking over Greg and Mekayla’s fruit share. This week we got 3 lbs of pie cherries and a huge bundle of rhubarb. That sounded like pie to me.
Cherry rhubarb pie

Cherry rhubarb pie

I have never made cherry rhubarb pie before, only strawberry rhubarb, but I found some recipes, and decided to give it a go, using mostly this recipe, with my mom’s crust recipe. I haven’t made pie in about 10 years, and I know that making the crust is tricky. I knew it wasn’t going well while I rolled it out. I kept adding more and more water. The fourth ball I rolled was finally about right. I need to get back in practice. In spite of the pie not being super well constructed, it still tasted very good.
Cherry rhubarb pies

Cherry rhubarb pies

Posted in wordpress | Comments Off