start encapsulation of math mode and text mode