LaTeX trick: putting the subversion revision number on every page

8 February, 2008 - 18:40
Categories:

I mostly use LaTeX for writing documents (LyX actually, but that doesn't matter here) and use Subversion for the version control. For managing the revision info of a source code file I use Subversion's built in feature Keyword Substitution which expands some special keyword (like $Date$ or $Revision$) in the source code to their current values.

Now two questions arise here:

  1. How to get the Subversion keywords nicely into LaTeX? Note that the $ character used for the Subversion keywords is already a reserved LaTeX control character and make things messy.
  2. How to get the version info on every page (e.g. as a footer)?
Read more...

LaTeX trick: customizing captions

29 January, 2008 - 16:34
Categories:

Captions of floats (figures and tables) in LaTeX are by default typeset the same way as the body text. For better readability it could be appropriate to use a different font, font size or margin for the captions. This is possible with the LaTeX package caption.

Read more...

Drupal wallpaper

28 January, 2008 - 11:50
Categories:

Because Drupal wallpapers are considered rare species I decided to jump in and spend some spare time on modeling the druplicon in Blender.

Here are some first shiny renders:

drupal wallpaper

drupal wallpaper


Creative Commons License

This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Extract images from a PDF document

27 January, 2008 - 20:06

When you want to extract a bitmap image from a PDF document, it is tempting to do the "print screen" trick. The drawback of this approach is that you'll inevitably lose quality: the image pixels will typically not map to your screen's pixels in a one to one fashion because of the decimation/resampling/scaling (or even rotation) when viewing the PDF document.

There are probably a lot of tools extract the bitmap image correctly out there. I guess this functionality is built in in Adobe Acrobat reader. But if you're in my situation (no desire to use Adobe's bloat) or you just need a small handy command line tool for linux (or other "unixes"): try pdfimages. It's part of the xpdf package, which is probably available for all major linux distributions.

Usage is very straightforward:

pdfimages -j foo.pdf  bar

This will extract all images from foo.pdf and save them in JPEG format (option -j) to bar-000.jpg, bar-001.jpg, bar-002.jpg, etc.

Inspired by http://www.boekhoff.info/?pid=linux&tip=extract-images-from-pdf-files

wwww wwww wwww

21 November, 2007 - 19:26

Today I committed revision 1830 to my work's subversion repository.
1830 might seem like a boring number, but given the current political crisis in Belgium, it is a bit special.

(about the title: hint)

PS: I know this is a crap blog entry, but this blog has been "unalive" too long and needed some reanimation.

svnversion and Kdevelop

8 June, 2007 - 14:26

Subversion keyword substitution is a nice concept, but the revision number refers to the revision the file was last changed, not the current version of the file. If you have for example a project with several files (e.g. main.c, pol.c, mol.s) and in main.c you have code that should render the current version of the program (like printf("Revision: $Revision$");). That revision keyword in main.c will not be expanded if you change and commit pol.c or mol.c, so the rendered revision will be wrong in that case.

Read more...

Completion for Gnuplot under Ubuntu(/Debian) with rlwrap

20 April, 2007 - 14:46

The default install of gnuplot in Ubuntu/Debian does offer a crippled form of word completion, when compared to other distribution (Mandrake, Suse). For example, filenames can not be completed with pressing tab, which can be really annoying if you're used to have this sort of completion. The reason for this is some licensing issue with the readline library. A workaround is to compile Gnuplot with the right tweaks, but this is to much hassle for what it's worth for me.

Another solution, which can also be applied to other applications, is rlwrap. It's just a simple sudo apt-get install rlwrap away (with uni/multiverse repositories enabled).

Now I have filename completion in gnuplot with:

rlwrap -a -c gnuplot

And if you're not so keen on remembering this, just add the following alias to your .bashrc:

alias gnuplot='rlwrap -a -c gnuplot'

Nice.

In-place string changing in files from the command line with "perl pie"

18 April, 2007 - 13:22

The standard unix/linux tools for filtering/changing strings (or patterns) in files from the commandline are sed and awk. But what if you want to change strings in-place in the files without the burden of creating new files and replacing the old ones afterwards?

The "perl pie" is a handy one-liner for these occasions:

perl -p -i -e 's/Jesus/Elvis/g' bible.txt

This will replace in file bible.txt all occurences of 'Jesus' with 'Elvis' in-place.

More info:

VRT internetradio beluisteren zonder dat flashgedoe

13 March, 2007 - 16:50
Categories:

Het heeft me wat tijd gekost, maar eindelijk vond ik een lijst van rechtstreekse links naar de VRT internetradio streams. Nu kan ik eindelijk (vanuit Linux) naar de VRT-radio luisteren zonder dat dat flashgedoe in als zijn "trendyness" zinloos cpu staat te verbruiken en eigenlijk niets doet behalve foutmeldingen spuwen.

Awaken the post-lunch PhD that lives inside you.

2 March, 2007 - 12:13
Categories:

Awaken the post-lunch PhD that lives inside you.

now back to work