The appendix header defaults to level 1 (<h1> / #), making it a top-level section. Use appendix-level to adjust this from 1 to 6. Setting it to 2 or 3 makes the appendix a subsection, which is useful when your document has a specific structure or when integrating with Quarto books.
extensions:regurgitate:appendix-level:2
Main Analysis
Here we compute the correlation between two variables:
# Sample data: hours studied vs exam scorehours = [2, 3, 5, 7, 8, 10, 4, 6, 9, 5]scores = [65, 70, 78, 85, 88, 95, 72, 80, 90, 76]n =len(hours)mean_h =sum(hours) / nmean_s =sum(scores) / nnumerator =sum((h - mean_h) * (s - mean_s) for h, s inzip(hours, scores))denom_h =sum((h - mean_h)**2for h in hours) **0.5denom_s =sum((s - mean_s)**2for s in scores) **0.5r = numerator / (denom_h * denom_s)print(f"Correlation coefficient: r = {r:.3f}")
The appendix below uses an <h2> header (level 2), making it appear as a subsection rather than a major document section. Compare this with other demos where the appendix is level 1.
Code Appendix
extensions:regurgitate:appendix-level:2
# Sample data: hours studied vs exam scorehours = [2, 3, 5, 7, 8, 10, 4, 6, 9, 5]scores = [65, 70, 78, 85, 88, 95, 72, 80, 90, 76]n =len(hours)mean_h =sum(hours) / nmean_s =sum(scores) / nnumerator =sum((h - mean_h) * (s - mean_s) for h, s inzip(hours, scores))denom_h =sum((h - mean_h)**2for h in hours) **0.5denom_s =sum((s - mean_s)**2for s in scores) **0.5r = numerator / (denom_h * denom_s)print(f"Correlation coefficient: r = {r:.3f}")print("Interpretation: Strong positive relationship")