Semantically sort subheadings