Use math mode toggle function when enabling via file variables