31/01/2011

Kile, KDE 4.6 and autocompletion

After installing KDE 4.6 (from Kubuntu backports), LaTeX autocompletion was gone in Kile 2.1 β4. It worked on β5, which can be downloaded as a source tarball from the Kile homepage.
I followed the README instructions, but used sudo checkinstall instead of sudo make install to get a .deb package (source ubuntuforums). The kile executable didn't end up in a PATH directory, so I linked it into /usr/bin via cd /usr/bin; sudo ln -s ~/kile-install/bin/kile 
The package system tried to 'update' to β4, so I had to protect the newer version with e.g. sudo aptitude hold kile.

Note on a second install: with just cmake . / make / sudo checkinstall instead of the README approach I ended up with the kile executable in /usr/local/bin. I prefer that to the version in /home, as kile is integrated into the package system via checkinstall anyway.

30/01/2011

Keynotifying PDF presentations

Update: (03/01/12) My version of pdf2odp.py now converts movies and Impress can actually play them. See this post for details.
Confession time: I did my defence on daWuzzzz's MacBook. The first reason was that I already had an Apple remote, the second was Keynote's excellent presenter console.
The downside was having to import my LaTeX/Beamer PDF presentation as images into Keynote and fiddling around with movie positioning afterwards.
You can do something like that purely on Linux - excluding the Apple remote :-) - so this post covers 3 topics:
  • the PDF presenter console
  • a harangue on crappy vector graphics import in OpenOffice and its presenter console
  • using python scripts to convert PDF into ODF with page images

29/01/2011

New bitch on the blog

To be precise, a partially wooden contraption charmingly christened Medusa (Asus U43JC-X1). Goodies include nVidia Optimus hybrid graphics, USB3 and an i5-450M processor with multithreading support.

28/01/2011

How to get ImageMagick to convert PDF to PNG with reasonable image quality

Without special effort, converting PDF to a series of PNG images produces images that look kind of corroded. The reason for this is related to ImageMagick's ghostscript backend, which sucks at antialiasing.
Thus, the only way to get better images would be to convert at an insanely high resolution (convert's density option) and resize afterwards. This can be done in one go by ImageMagick:
convert -density 1000x1000 <thepdf.pdf> -resize <xsize>x test%03d.png
However, I found that running ghostscript separately reduces the eventual image size by a factor of 2-3. I don't know why, it seems to be relatively device-independent (tested with both png16m and pngalpha).
gs -sDEVICE=png16m -sOutputFile=test%03d.png -r1000 -dNOPAUSE -dBATCH <mypdf.pdf>
for file in test???.png; do convert $file -resize <xsize>x $file; echo $file; done