Add math grammar to contents