Recognizing high-level document structure