I’ve been playing around with the Sphinx Documentation Generator for a project at work. So far I’ve been really impressed. Although I can’t speak to its technical qualities, I can say that it’s a really neat piece of software. It makes me want to write all kinds of documentation, tutorials, books, whatever…just for the sheer pleasure of using it.
I ran into trouble, however, when attempting to generate .pdfs with it. Although I installed the texlive, texlive-basic, texlive-latexrecommended and probably a couple of other packages, I kept running into an error.
! LaTeX Error: File `titlesec.sty' not found.
I got some help reading James Gardner’s Sphinx PDF Generation with Latex, which came with the recommendation that you must install texlive-full in order to correct this error. Well, Gentoo doesn’t have that package in Portage. The article then mentions that texlive-latex-extra will bridge the gap. Another package not in Portage, but texlive-latexextra was, so I attempted to emerge it, hoping it would be the cure for all that ailed my latex pdf creation. However, it wanted to compile ruby-1.8_p247. For hours and hours. It’d get to ‘Creating Ri..’ and hang. Repeatedly.
Finally, I took another look around and found a package at CTAN, the Comprehensive LaTex Archive Network. They’ve got a fix. Here’s what I did.
Download the Titlesec package to /usr/share/texmf-dist/tex/latex/base.
Unzipped it. Ran texhash 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 rescue. I downloaded the Wrapfig package to the same location as titlesec, unzipped it, ran texhash, and it ran beautifully.
Many thanks to James Gardner and CTAN for the help and files. Finally getting that damn .pdf generated was a highlight of my day.