correct latex function