pdf = "data/nist/NIST.SP.800-207.pdf" line_df = fitz_pdf_to_line_df(pdf) span_df = build_span_df(pdf) enriched = enrich_line_df_with_style(line_df, span_df) # per-line font + bold candidates = detect_body_headings(enriched, threshold=3.0) page = 10 for _, row in candidates[candidates["page_num"] == page].iterrows(): print(row["text"], row["heading_score"], row["candidate_level"], row["font_size"], bool(row["is_bold"])) # 1 Introduction 4.28 1 12.0 True