add math mode fix to transformer