Writing thesis with latex