adapt abstract code to unescape latex stuff. math mode does not work