How the math editor works