slippens's blog

LaTeX: use \textnormal instead of \textrm (or \textsf) in math

14 December, 2005 - 14:17

If you you want to use normal text in a math environment (mathdisplay, equation,...) you should use \textnormal{} instead of \textrm{}. Apparently the latter is more popular: a google search for "latex textrm" delivers almost 25.000 hits, whereas google search for "latex textnormal" returns not more than 800 hits. The advantage of \textnormal is that the text will be typeset in the normal font of the body text. \textrm on the other hand activates a roman (serif) font. Most of the time the result of these two will be the same because the default font of the body text is a serif one in most cases. But sometimes it is not.

LaTeX: the order of \caption and \label matters in floats

13 December, 2005 - 18:14

The order of \caption and \label declarations matter in LaTeX floats (tables and figures). It is important to get references to the float right. The \label should come after the \caption or even inside the \caption environment. If you put the \label before the \caption you will get a reference to the (sub)section where float is declared instead of a reference to the float itself.

LaTeX: change the font and other properties of captions of floats

13 December, 2005 - 14:12

With the LaTeX package caption you can change the properties (such as font family) of the captions of floats (tables and figures). It's part of a default LaTeX installation, so probably you don't need installing something.

The floppy disk as symbol for saving

6 December, 2005 - 16:18

Why is the floppy disk still used as symbol/icon on widgets related to saving a document? Who uses floppy disks nowadays? People that worked with computers ten years ago will know what that icon stands for, but for the younger and future generation it is/will be probably an ugly squarisch thing. Maybe it's time to dump the floppy disk icon and think about an alternative representation of the save action?

Some people at agree on this:

Python: defining a class and pickling an instance in the same file

3 December, 2005 - 13:12

The python pickle module is an interesting and helpful module. It offers an easy way to save an load your own python datastructures (classes) without having to design your own file format and implement import and export procedures. This text is about what can happen if you try to pickle an instance of a class you defined in the same (script) file. A scenario in which this could happen: you have a module defining some classes with save and load functionality through the pickle module and beside being able to import that module in other python scripts, you also want to be able to run it as a standalone script. (As a sidenote it could be important to mention that python version 2.4.2 is used for these "experiments".)

Bash: the difference between $* and $@ and what that means for working with filenames containing spaces

29 November, 2005 - 19:39

Lets's start with a citation about the special parameters $* and $@ from the bash manual:

Easily accessible calculator in KDE

29 November, 2005 - 18:23

With the shortcut alt+F2 in KDE you invoke the "run command" dialog (also accessible from the start menu if it's not hidden of course). It is a fast and easy way to launch an application if you know its command line name (which is mostly the same as its normal name, except for things like

cat with rot13 encoding

27 November, 2005 - 17:46

If you're familiar with the Unix or Linux commandline you probably know cat for printing files to standard output. Rot13 is a simple text encryption/cyphering/obfuscation (or whatever you want to call it) technique. It replaces each letter with the letter 13 places further in the alphabet. For example: 'a' becomes 'n', 'z' becomes 'm' and 'n' becomes 'a' (which illustrates the fact that the rot13 operation and its inverse are the same).

R&B is boring

26 November, 2005 - 18:29

Just a little blog entry to say:

R&B is boring and pathetic! It's for memoryless beings unable to notice all those R&B songs (and videoclips) are (almost exactly) the same.

now I feel much better, thank you

shell redirection of standard output and standard error to the same file

22 November, 2005 - 11:49

Consider a program hello_and_error that writes to both stdout and to stderr. To redirect both to stdout:

hello_and_error 2>&1

If you want to redirect both to the same file hello.txt you can do in bash the following:

hello_and_error &> hello.txt

If you want to do this in a more obvious (but longer) way you should do

hello_and_error 1>hello.txt 2>&1

and not

hello_and_error 2>&1 1>hello.txt