LaTex test added and doc

Hi Tomas,

I've added tests (actually there is bug fixing). I also updated the side by side doc. Please check.

Regards,
Xiang.