Skip to navigation

LaTeX and Beamer — steps to produce a .pdf slide presentation

May 29th, 2007

It will work if you use pdflatex:

pdflatex file.tex

However, using that method, you cannot include .eps graphics, and bitmap graphics often look bad in your presentation. As an alternative, run:

latex file.tex

followed by

divps file.dvi

and then

ps2pdf file.ps

Note that going directly “dvipdfm file.dvi” does not work for me (does not handle overlays correctly). Sometimes, ps2pdf tries to rotate individual pages wrong. In that case, say:

ps2pdf -dAutoRotatePages=/None file.ps

You can, of course, combine the above commands into a shell script.

XEmacs and umlauts — setting the character encoding to UTF-8

May 29th, 2007

XEmacs didn’t display umlauts correctly. I guessed this has something to do with the file encoding (the file displayed correctly in a terminal window with nano or “xemacs -nw”). The grey horizontal bar that separates the main buffer from the minibuffer shows the encoding of the current buffer at the very left. The text in question, with umlauts, showed “raw”. It had to be set to UTF-8. I found this out by saying

env

in a terminal window (where the file displayed correctly). This gives a list of all environment variables that are set, and one of them was:

LANG=en_GB.UTF-8

I was able to fix this by adding the following three lines to the file ~/.xemacs/init.el (then you have to load that file with M-x load-file or restart XEmacs):

(require 'un-define)
(set-coding-priority-list '(utf-8))
(set-coding-category-system 'utf-8 'utf-8)

Read the rest of this entry »

Firefox smart keywords

May 25th, 2007

A really neat feature, probably unknown to many Firefox users: You can create “smart keywords”. For example, I have defined a smart keyword for a Wikipedia search, so now, when I type into the location bar:

wiki: cycle path

it searches Wikipedia for that term (and I end up on the Wikpedia entry for segregated cycle facilities).

John Bokma has a good explanation on how to define these, both manually and somewhat automatically. As usual, the manual way to do this lets you implement more customized searches.

A few examples of searches I have defined:

Keyword Location Description
wiki: http://en.wikipedia.org/wiki/Special:Search?search=%s Searches the English Wikpedia site
imdb: http://imdb.com/find?q=%s Searches imdb.com
lx: http://www.google.com/linux?q=%s Google Linux search
urc: http://groups.google.com/groups?as_q=%s&as_ugroup=uk.rec.cycling Searches Google Groups for posts made to the uk.rec.cycling newsgroup

How to manually mount a USB stick

May 20th, 2007

So far, all USB sticks I plugged into the laptop just automatically got mounted. That is, they just show up on the Xubuntu desktop. Today, for the first time one didn’t. The following line solved this problem:

sudo mount -t vfat /dev/sdb1 /mnt

(The /dev/sdb1 may be different for your system.) The drive is then accessible under /mnt. Don’t forget to

sudo umount /dev/sdb1

Sed example 1

May 1st, 2007

Many things are easiest to learn by looking at examples. I find this to be especially true for sed. Sed stands for “stream editor”, and it is very handy to perform bulk editing of text files. To get started, I refer you to this very nice tutorial. I’m planning to archive some of the small editing tasks I did with sed on this blog, both for my own reference and in case anyone wants to look at sed examples. These examples worked when I used them to edit the files I wanted to edit — but of course no guarantee that there isn’t a glitch. Always make a backup.

So here’s the first example. I have a file containing assignments done by students, 100 of them, all one after another in a single text file. I’ve graded them and want to e-mail them back. I’ll use sed and mutt to do this conveniently from the commandline.

Read the rest of this entry »