Changed Tabname to latexlabel

also improved the code style