Getting Sphinx and Latex to Play Nice on Gentoo

I’ve been play­ing around with the Sphinx Doc­u­men­ta­tion Gen­er­a­tor for a project at work. So far I’ve been really impressed. Although I can’t speak to its tech­ni­cal qual­i­ties, I can say that it’s a really neat piece of soft­ware. It makes me want to write all kinds of doc­u­men­ta­tion, tuto­ri­als, books, whatever…just for the sheer plea­sure of using it.

I ran into trou­ble, how­ever, when attempt­ing to gen­er­ate .pdfs with it. Although I installed the texlive, texlive-basic, texlive-latexrecommended and prob­a­bly a cou­ple of other pack­ages, I kept run­ning into an error.

! LaTeX Error: File `titlesec.sty' not found.

I got some help read­ing James Gardner’s Sphinx PDF Gen­er­a­tion with Latex, which came with the rec­om­men­da­tion that you must install texlive-full in order to cor­rect this error. Well, Gen­too doesn’t have that pack­age in Portage. The arti­cle then men­tions that texlive-latex-extra will bridge the gap. Another pack­age not in Portage, but texlive-latexextra was, so I attempted to emerge it, hop­ing it would be the cure for all that ailed my latex pdf cre­ation. How­ever, it wanted to com­pile ruby-1.8_p247. For hours and hours. It’d get to ‘Cre­at­ing Ri..’ and hang. Repeatedly.

Finally, I took another look around and found a pack­age at CTAN, the Com­pre­hen­sive LaTex Archive Net­work. They’ve got a fix. Here’s what I did.

Down­load the Titlesec pack­age to /usr/share/texmf-dist/tex/latex/base.
Unzipped it. Ran tex­hash to update the LaTex packages.

I then attempted to make all-pdf in Sphinx again. I got another error! This one was >! LaTeX Error: File `wrapfig.sty' not found.. DAMN. But CTAN again came to my res­cue. I down­loaded the Wrap­fig pack­age to the same loca­tion as titlesec, unzipped it, ran tex­hash, and it ran beautifully.

Many thanks to James Gard­ner and CTAN for the help and files. Finally get­ting that damn .pdf gen­er­ated was a high­light of my day.

How to Design Programs: Goals/Notes

I expended some effort last year get­ting Shri­ram Krish­na­murthi to allow me access to the solu­tions man­ual, so get on this!  This is the year I go through How to Design Programs.

Goals:

  1. Read entire book.
  2. Work through all exercises.
  3. I may be math-weak in some areas.  Get up to speed if necessary.
  4. Write up exer­cise solu­tions, thoughts, and sum­maries.  This is unlikely to be inter­est­ing to any­one else, but is use­ful to me.
  5. Do it!

Inspi­ra­tion:

Eli Bendersky’s year with SICP.

I’ve seen a few peo­ple online with exer­cises solu­tions to HtDP, but not really blog­ging their expe­ri­ences. Be the first!

Dear Self: You’re tempted to attempt this in Ruby (rather than Scheme) due to new job. That may be way too much going on for now, and it’s not really the point of HtDP to teach Scheme, per se. Stay away from try­ing to learn Emacs while you do this, too.