Made prepare-for-export-to-latex in mode_customizations more intelligent.