name: mip-pdf description: Phase 7 of MIP pipeline - Generate final PDF document from the essay and appendix using pandoc. allowed-tools: Bash, Read
MIP PDF Generation Phase
Generate the final PDF document from the completed essay and appendix.
Your Task
Use pandoc to convert the markdown files into a professionally formatted PDF.
Prerequisites Check
Before generating, verify:
mip-analysis/essay/analysis.mdexists and is completemip-analysis/essay/appendix.mdexistsmip-analysis/essay/verification-report.mdconfirms all quotes verified- pandoc is installed (
which pandoc) - A LaTeX engine is available (xelatex preferred)
PDF Generation Command
pandoc mip-analysis/essay/analysis.md mip-analysis/essay/appendix.md \
-o mip-analysis/essay/analysis.pdf \
--pdf-engine=xelatex \
-V geometry:margin=1in \
-V fontsize=12pt \
-V linestretch=2 \
-V mainfont="Times New Roman" \
--toc \
--toc-depth=2 \
-V colorlinks=true \
-V linkcolor=blue
Fallback Options
If xelatex is not available:
# Try pdflatex
pandoc mip-analysis/essay/analysis.md mip-analysis/essay/appendix.md \
-o mip-analysis/essay/analysis.pdf \
--pdf-engine=pdflatex \
-V geometry:margin=1in \
-V fontsize=12pt
# Or use wkhtmltopdf via HTML
pandoc mip-analysis/essay/analysis.md mip-analysis/essay/appendix.md \
-o mip-analysis/essay/analysis.html && \
wkhtmltopdf mip-analysis/essay/analysis.html mip-analysis/essay/analysis.pdf
PDF Specifications
Target format:
- Margins: 1 inch all sides
- Font: 12pt, Times New Roman or similar serif
- Line spacing: Double-spaced
- Table of Contents: Yes, 2 levels deep
- Page numbers: Bottom center
- Header: Essay title
Process
- Check prerequisites
- Run pandoc command
- Verify PDF created successfully
- Check PDF page count (expect 12-16 pages)
- Open or display PDF location
Error Handling
If pandoc fails:
- Check for LaTeX errors in output
- Try alternative PDF engine
- Verify markdown syntax is valid
- Check for special characters that need escaping
Common fixes:
- Escape
$symbols:\$ - Ensure code blocks are properly fenced
- Check table formatting
Success Criteria
- PDF generated at
mip-analysis/essay/analysis.pdf - PDF opens without errors
- All content from both markdown files included
- Table of contents present
- Formatting professional and readable
- Pipeline complete!
Final Output Summary
After successful PDF generation, report:
MIP Pipeline Complete!
Output files:
├── mip-analysis/
│ ├── research-notes.md
│ ├── annotations/
│ │ └── chapter-01.json ... chapter-09.json
│ ├── cmt-systems.json
│ ├── cmt-summary.md
│ ├── outline.md
│ └── essay/
│ ├── analysis.md
│ ├── appendix.md
│ ├── verification-report.md
│ └── analysis.pdf ← FINAL OUTPUT
Total metaphors analyzed: [N]
CMT systems identified: 4
Essay word count: ~3250
PDF pages: [N]