Skip to content

Commit 22dec9f

Browse files
committed
w
1 parent 13071b1 commit 22dec9f

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

.claude/commands/mathml-general-exam.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,41 @@ Use this entity mapping:
102102
- Greek letters: α (α), β (β), γ (γ), δ (δ), ε (ε), η (η), θ (θ), λ (λ), μ (μ), ν (ν), π (π), σ (σ), τ (τ), φ (φ), ω (ω), Γ (Γ), Δ (Δ), Θ (Θ), Λ (Λ), Σ (Σ), Φ (Φ), Ω (Ω)
103103
- Other: ∞ (∞), × (×), ⋅ (⋅), ± (±), ∠ (∠), ⊕ (⊕), ⊗ (⊗)
104104

105-
### Step 6: Save to final location
105+
### Step 6: Add H2 Problem Headings
106+
**CRITICAL**: After post-processing, you MUST manually add H2 headings for each problem.
107+
108+
1. Read the processed HTML file
109+
2. Identify each problem in the exam (usually numbered 1, 2, 3, etc.)
110+
3. For each problem, add an H2 heading immediately before the problem content:
111+
```html
112+
<h2 class="unnumbered" id="problem-N">Problem N</h2>
113+
```
114+
115+
**Why this matters:**
116+
- H2 headings provide semantic structure for screen readers
117+
- Users can navigate between problems using heading navigation
118+
- WCAG 2.1 requires proper heading hierarchy for accessibility
119+
120+
**Example transformation:**
121+
```html
122+
<!-- Before: Problem without heading -->
123+
<p><span class="problem-number">(1)</span> Let f: R → R be a continuous function...</p>
124+
125+
<!-- After: Problem with proper H2 heading -->
126+
<h2 class="unnumbered" id="problem-1">Problem 1</h2>
127+
<p>Let f: R → R be a continuous function...</p>
128+
```
129+
130+
**Important notes:**
131+
- Each problem MUST have its own H2 heading
132+
- Remove any inline problem numbering like `<span class="problem-number">(1)</span>` or `<br /><br />(1)` when adding the H2
133+
- Use the pattern: `<h2 class="unnumbered" id="problem-N">Problem N</h2>`
134+
- The ID should match the problem number for anchor linking
135+
136+
### Step 7: Save to final location
106137
Save the processed HTML file next to the original PDF with the same name but .html extension.
107138

108-
### Step 7: Add accessible HTML link to the generals page
139+
### Step 8: Add accessible HTML link to the generals page
109140
After saving the HTML file, you MUST update the link in `graduate/general_exams.md` to follow accessibility best practices:
110141

111142
1. Read the file `graduate/general_exams.md`
@@ -134,7 +165,7 @@ After saving the HTML file, you MUST update the link in `graduate/general_exams.
134165
- Clearly labeling the PDF as "for printing" to indicate its purpose
135166
- Using ARIA labels to communicate that PDFs may have accessibility limitations
136167

137-
### Step 8: Final Review - Read Both Files
168+
### Step 9: Final Review - Read Both Files
138169
After completing all processing steps, you MUST read both the original PDF and the generated HTML file to provide a final quality assessment:
139170

140171
```bash
@@ -148,13 +179,15 @@ Read <PATH_TO_HTML>
148179
2. **MathML Quality**: Confirm that math expressions render correctly as MathML (not SVG or Unicode)
149180
3. **Accessibility**: Check that all accessibility features are present and correct:
150181
- Proper title and H1 heading
182+
- **H2 headings for EVERY problem** (e.g., "Problem 1", "Problem 2", etc.)
151183
- Breadcrumb and back button navigation
152184
- ARIA labels on math elements
153185
- Semantic HTML structure
154186
4. **Formatting and Spacing**: Ensure the HTML preserves the PDF's visual structure:
155187
- Proper vertical spacing between main problems
156188
- Problem structure is clear and readable
157189
5. **Completeness**: Verify nothing was lost or corrupted during conversion
190+
- Count problems in PDF and verify matching H2 headings in HTML
158191

159192
**Provide a concise summary stating:**
160193
- ✓ What looks correct
@@ -174,7 +207,8 @@ This final human-in-the-loop check ensures quality before the files go live.
174207
The output HTML must have:
175208
✓ Actual MathML elements (<math>, <mrow>, <mi>, <mo>, etc.)
176209
✓ NO Unicode characters - all replaced with HTML/MathML entities
177-
✓ Proper heading hierarchy (H1 for title, H2 for problems/sections)
210+
✓ Proper heading hierarchy (H1 for title, H2 for EVERY problem)
211+
**H2 heading for each problem** (e.g., `<h2 class="unnumbered" id="problem-1">Problem 1</h2>`)
178212
✓ ARIA attributes on all math elements (role="math", aria-label)
179213
✓ lang="en" attribute on <html> element
180214
✓ Descriptive page title derived from H1 content (e.g., "TITLE - UVA Mathematics")

0 commit comments

Comments
 (0)