improved mathlex automatching behavior