updated latex output to document form.