unify how tex over json and directly rendered tex are handled