| name | dev-slides |
| description | Generate a Google Slides presentation from a paper PDF URL using gws CLI. |
Paper-to-Slides Generator
Usage
/dev-slides <arxiv PDF URL or paper URL>
Prerequisites
gws CLI authenticated with Slides and Drive APIs
- Python packages:
pymupdf, Pillow, numpy
Presentation Style
- Title slide: 個人進度報告 / 電機所碩一 邱冠銘
- Section headers: TITLE layout (CENTERED_TITLE), left-aligned
- Content slides: TITLE_AND_BODY layout (single column, not two columns)
- Fonts: theme defaults (no overrides)
- Body: bullet points with lineSpacing 150, indent 36pt (level 0), 72pt (level 1)
- Sub-items use level 1 indentation for hierarchy
- Keep each slide concise, 3-5 bullet points max per slide
Slide Structure
- Title slide (TITLE layout): 個人進度報告 + 電機所碩一 邱冠銘
- Paper info slide (TITLE_AND_BODY): paper title as slide title, body lists authors, affiliation, conference/year, arXiv ID. Paper titles are often long and wrap to multiple lines, so always move body translateY down to ~1600000 EMU on this slide.
- Section: Intro
- Motivation & Problem (content slide)
- Paper Goal (content slide)
- Section: Design
- Method slides (2-4 slides depending on paper complexity)
- Figure slides (from paper, with captions)
- Section: Eval
- Experimental setup (content slide)
- Results (content slide)
- Table/figure slides (from paper, with captions)
- Section: Conclusion
- Limitations & Key Takeaways (content slide)
- Thanks slide
Instructions
-
Fetch paper content:
- Use
WebFetch on the arxiv abstract page to get title, authors, abstract
- Use
WebFetch on the PDF URL for detailed methodology, results, contributions
-
Create presentation:
gws slides presentations create --json '{"title": "<paper title>"}'
Save the presentationId from the response.
-
Get layout IDs from the create response:
- TITLE layout (for section headers + title slide)
- TITLE_AND_BODY layout (for content slides)
- TITLE_ONLY layout (for figure/table slides)
-
Build slides via batchUpdate:
- Delete the default empty slide first
- Create ALL slides listed in the Slide Structure section, do not skip any (especially the paper info slide)
- Create all slides with
createSlide, mapping placeholders by type
- Object IDs must be at least 5 characters
- Insert text with
insertText
- Apply bullets with
createParagraphBullets (preset: BULLET_DISC_CIRCLE_SQUARE)
- Set paragraph styles: lineSpacing 150, indent 36pt/72pt for level 0/1
- Alignment enum: use
START not LEFT, use CENTER not CENTER
- Send all requests in a single
batchUpdate call
-
Extract figures from PDF:
- Download PDF:
curl -sL "<url>" -o /tmp/paper.pdf
- Use
pymupdf to analyze exact figure boundaries: call page.get_text("dict") for text blocks and page.get_drawings() for drawing bounds
- Define precise
fitz.Rect clip regions based on analyzed coordinates, not rough guesses
- Auto-crop remaining whitespace with PIL + numpy (threshold gray < 248)
- Target key figures: overview diagram, method diagram, result tables
-
Upload images to a public host:
curl -s -X POST "https://freeimage.host/api/1/upload" \
-F "key=6d207e02198a847aa98d0a2a901485a5" \
-F "source=@/tmp/paper_figs/fig.png" \
-F "format=json"
Extract URL from response: .image.url
-
Insert images into slides via batchUpdate:
- Use TITLE_ONLY layout for figure slides
createImage with the hosted URL
- Position: centered horizontally, image top at ~1250000 EMU (0.25" below title bottom)
- Add caption text box below image: 12pt, gray (#666), centered
- Caption top = image bottom + 150000 EMU gap
- Scale images to fit: max image bottom at ~4400000 EMU, keep aspect ratio
-
Verify layout after building all slides:
- Programmatically check every slide for overflow: compute each element's bounding box (size * scale + translate) and verify it stays within slide bounds (9144000 x 5143500 EMU)
- Verify title-to-image gap >= 228600 EMU (0.25") on figure/table slides
- Verify title-to-body gap on TITLE_AND_BODY slides: if title text is long (>50 chars), move body translateY down to avoid overlap
- Verify image-to-caption gap ~150000 EMU, consistent across slides
- Verify caption bottom < 5000000 EMU
- Fix any violations in a single batchUpdate pass
-
Output the presentation URL:
https://docs.google.com/presentation/d/<presentationId>/edit