Skip to content

Commit f7b1221

Browse files
committed
w
1 parent 1cce78f commit f7b1221

File tree

5 files changed

+382
-21
lines changed

5 files changed

+382
-21
lines changed

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

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ curl -X POST "https://api.mathpix.com/v3/pdf" \
2121
-H "app_id: $MATHPIX_APP_ID" \
2222
-H "app_key: $MATHPIX_API_KEY" \
2323
-F "file=@<PDF_PATH>" \
24-
-F 'options_json={"conversion_formats": {"html.zip": true, "mmd": true}}'
24+
-F 'options_json={"conversion_formats": {"html.zip": true, "tex.zip": true}}'
2525
```
2626

2727
Extract the `pdf_id` from the response.
@@ -36,18 +36,22 @@ curl -X GET "https://api.mathpix.com/v3/pdf/<PDF_ID>" \
3636

3737
Wait until `"status":"completed"`.
3838

39-
### Step 3: Download Mathpix Markdown
40-
Download the .mmd format (NOT .html, as it uses SVG):
39+
### Step 3: Download and Extract TeX Format
40+
Download the tex.zip format (NOT .html, as it uses SVG):
4141
```bash
42-
curl -X GET "https://api.mathpix.com/v3/pdf/<PDF_ID>.mmd" \
42+
curl -X GET "https://api.mathpix.com/v3/pdf/<PDF_ID>.tex.zip" \
4343
-H "app_id: $MATHPIX_APP_ID" \
4444
-H "app_key: $MATHPIX_API_KEY" \
45-
-o /tmp/output.mmd
45+
-o /tmp/output.tex.zip
46+
47+
cd /tmp && unzip -o output.tex.zip
4648
```
4749

50+
The extracted .tex file will be in a subdirectory named with the PDF_ID.
51+
4852
### Step 4: Convert to HTML with MathML using Pandoc
4953
```bash
50-
pandoc /tmp/output.mmd -f latex -t html --mathml --standalone -o /tmp/output_mathml.html
54+
pandoc /tmp/<PDF_ID>/<PDF_ID>.tex -f latex -t html --mathml --standalone -o /tmp/output_mathml.html
5155
```
5256

5357
### Step 5: Post-process to fix Unicode and improve accessibility
@@ -92,27 +96,38 @@ Use this entity mapping:
9296
### Step 6: Save to final location
9397
Save the processed HTML file next to the original PDF with the same name but .html extension.
9498

95-
### Step 7: Add HTML link to the generals page
96-
After saving the HTML file, you MUST add a link to it in `graduate/general_exams.md`:
99+
### Step 7: Add accessible HTML link to the generals page
100+
After saving the HTML file, you MUST update the link in `graduate/general_exams.md` to follow accessibility best practices:
97101

98102
1. Read the file `graduate/general_exams.md`
99103
2. Find the line that references the PDF you just processed
100-
3. Edit that line to add `&bull; [HTML]({{site.url}}/path/to/file.html)` after the PDF link
104+
3. Replace that line to make HTML the primary link and PDF secondary
101105

102-
**Example:**
106+
**IMPORTANT: HTML must be the PRIMARY link (accessible version), PDF must be SECONDARY (for printing only)**
107+
108+
**Link Format:**
103109
```markdown
104-
# Before:
110+
# Before (PDF only):
105111
- [08/2022, real]({{site.url}}/graduate/exams/analysis/2022Aug_real.pdf)
106112

107-
# After:
108-
- [08/2022, real]({{site.url}}/graduate/exams/analysis/2022Aug_real.pdf) &bull; [HTML]({{site.url}}/graduate/exams/analysis/2022Aug_real.html)
113+
# After (HTML primary, PDF secondary):
114+
- [08/2022, real]({{site.url}}/graduate/exams/analysis/2022Aug_real.html) &bull; <a href="{{site.url}}/graduate/exams/analysis/2022Aug_real.pdf" aria-label="PDF version for printing">PDF</a>
109115
```
110116

111-
**Important**: The `&bull;` (bullet point) must be used as the separator between PDF and HTML links.
117+
**Key requirements:**
118+
- Primary link text (e.g., "08/2022, real") links to the HTML version
119+
- Use `&bull;` as separator
120+
- PDF link must have `aria-label="PDF version for printing"`
121+
- PDF link text is simply "PDF"
122+
123+
**Rationale:** This follows WCAG 2.1 Level AA guidelines by:
124+
- Making the accessible format (HTML) primary and most prominent
125+
- Clearly labeling the PDF as "for printing" to indicate its purpose
126+
- Using ARIA labels to communicate that PDFs may have accessibility limitations
112127

113128
## Important Notes
114129
- Do NOT use the direct .html download from Mathpix - it uses MathJax SVG rendering
115-
- Always use the .mmd → pandoc → post-processing pipeline
130+
- Always use the tex.zip → pandoc → post-processing pipeline
116131
- Verify that NO Unicode mathematical characters remain in the final output
117132
- Verify proper heading hierarchy (use grep or check a sample)
118133
- The final HTML should be fully accessible with screen readers
@@ -130,4 +145,4 @@ The output HTML must have:
130145
✓ Main content wrapped in <main> landmark element
131146
✓ Valid, well-formed HTML5 document with proper semantic structure
132147
✓ HTML file saved next to the PDF with .html extension
133-
✓ Link added to graduate/general_exams.md with &bull; separator
148+
✓ Link in graduate/general_exams.md updated with HTML as primary, PDF as secondary with aria-label

_includes/grad_general_exams.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Students are expected to attempt two different general examinations before the b
1313
Syllabi for the Algebra, Analysis, and Topology General Examinations:
1414
<ul>
1515
<li>
16-
<a href="{{ site.url }}/graduate/docs/Syllabus for Algebra General Exam 1 - update 2023.pdf">Syllabus for Algebra General Exam</a> &bull; <a href="{{ site.url }}/graduate/docs/algebra-general-exam-syllabus/">HTML version</a><br>
16+
<a href="{{ site.url }}/graduate/docs/algebra-general-exam-syllabus/">Syllabus for Algebra General Exam</a> &bull; <a href="{{ site.url }}/graduate/docs/Syllabus for Algebra General Exam 1 - update 2023.pdf" aria-label="PDF version for printing">PDF</a><br>
1717
</li>
1818
<li>
19-
<a href="{{ site.url }}/graduate/docs/Syllabus for Analysis General Exam 2.pdf">Syllabus for Analysis General Exam</a> &bull; <a href="{{ site.url }}/graduate/docs/analysis-general-exam-syllabus/">HTML version</a><br>
19+
<a href="{{ site.url }}/graduate/docs/analysis-general-exam-syllabus/">Syllabus for Analysis General Exam</a> &bull; <a href="{{ site.url }}/graduate/docs/Syllabus for Analysis General Exam 2.pdf" aria-label="PDF version for printing">PDF</a><br>
2020
</li>
2121
<li>
22-
<a href="{{ site.url }}/graduate/docs/Syllabus for Topology General Exam 3.pdf">Syllabus for Topology General Exam</a> &bull; <a href="{{ site.url }}/graduate/docs/topology-general-exam-syllabus/">HTML version</a><br>
22+
<a href="{{ site.url }}/graduate/docs/topology-general-exam-syllabus/">Syllabus for Topology General Exam</a> &bull; <a href="{{ site.url }}/graduate/docs/Syllabus for Topology General Exam 3.pdf" aria-label="PDF version for printing">PDF</a><br>
2323
</li>
2424
</ul>

graduate/degree-programs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ nav_weight: 8
1717

1818
---
1919

20+
<div class="alert alert-info" role="note" markdown="1">
21+
**Accessibility Note:** This page links to syllabi and exams with HTML versions that are screen-reader accessible and recommended for all users. PDF versions are provided for printing only and may not be fully accessible. External links to the Graduate Record are maintained by the University Registrar.
22+
</div>
23+
2024
## PhD Requirements
2125

2226
### Course Requirements

0 commit comments

Comments
 (0)