corrected code for latex macro