Skip to navigation

Firefox: How to make “Open all [bookmarks] in Tabs” append to existing tabs instead of replacing them

April 26th, 2008

This has been a major annoyance so far: While Firefox lets you conveniently save all currently open tabs in a bookmark folder, when you later open all the bookmarks in that folder using the “Open all in Tabs” functionality, it replaces all the other tabs you have open at that moment. How idiotic is that.

I found the solution here: Go to the URL about:config, search for browser.tabs.loadFolderAndReplace and set it to false.

Using the LaTeX landscape package for a plot/ figure in Sweave

April 15th, 2008

I’ve started using Sweave and immediately ran into a problem. I had a wide figure to include (actually, a plot that combined several plots in R using the layout command). I had used the lscape package in LaTeX and the corresponding landscape environment for that page, and before, it worked fine, but with Sweave, the figure got chopped off as if somehow LaTex was cropping it to the portrait-oriented “width”, i.e. the narrower side of the page. Turns out I had to follow my own advice and run dvips followed by ps2pdf instead of dvipdfm.

Since typing in all those commands including the now necessary Sweave gets quite tedious, I created a little shell script sweavetex:

#!/bin/bash

R CMD Sweave "$1".Rnw  || exit 1
latex "$1".tex || exit 1
dvips "$1".dvi || exit 1
ps2pdf -dAutoRotatePages=/None "$1".ps || exit 1

Emacs & weblogger.el

April 15th, 2008

Weblogger.el offers a nice way to post directly to a WordPress blog from Emacs; here’s a good description how to set it up.

In addition: When creating an entry, you can also set categories by adding a line “Keywords:” to the header, such as:

Keywords: Linux, Emacs, Noobs

I haven’t figured out how to do trackbacks yet, but I do that rarely enough. Even when I have to use the web interface, I can use Emacs via Mozex.

Converting Word documents to pdf via Google docs (& Gmail)

April 15th, 2008

If you receive a Word .doc file as an e-mail attachment to your Gmail
account, you can view it as a Google doc. From Google docs, you can
print it, and printing actually creates a pdf file for you to view or
download. Neat. (Obviously, it would be even neater not to receive .doc
files in the first place).

Screenshots with ImageMagick’s “import”

April 14th, 2008

For quick-and-dirty screenshots ImageMagick’s import command is unbeatable.

sudo aptitude install imagemagick

ImageMagick is worth getting for a lot of other reasons, too, just see man convert or man mogrify after installing.

Here are the most important options for import

import pic.jpg

This changes the cursor to a crosshair — draw around the region you want a screenshot of; no need to take a screenshot of the entire screen and then crop. Combined with a verve mini commandline in the Xfce panel, this is ideal for taking quick images of order confirmations, error messages that you need to google later, etc.

import -screen pic.jpg

This also changes the cursor to a crosshair, but instead of drawing a region, you point it at one of your windows and click, and you get a screenshot of that window only.

import -window root pic.jpg
import -pause 2 -window root pic.jpg

Screenshot of the entire screen, without or with a delay.

My only gripe with import is that it doesn’t do transparency, at least not by default (for example, transparent terminals are opaque black in the screenshot), and probably related is that it loses some of my window borders (I’m using Compiz & Emerald). With the gazillion options, I’m sure there’s some way to fix it, but I have no time to figure it out. For pretty screenshots of transparent windows, I did instead:

sudo aptitude install gnome-utils

and use gnome-screenshot (which instead has the advantage that you don’t necessarily have to save the screenshot — you can drag and drop the thumbnail preview from the save dialogues to apps that are capable of receiving drag and drop).