fix python auto group and tex auto group