Latex table generation with templates