Use math mode for diagram