I reposted the question on stackexchange for tex and got an answer. I originally posted the question here, because I didn't know there is a stackoverflow for tex.
The link to the solution In case someone is interested in it.
LeoR
2010-10-08 21:31:47