A self-contained guide for any AI assistant or new contributor to immediately start authoring an academic paper-share Slidev deck without prior context. Read this once, then begin working on the target project's slides.md.
This skill was distilled from a real paper-share project. Its rules trace to concrete bugs and revisions, not theoretical best practices.
Building a Slidev presentation deck — a Vue-based framework that turns a single Markdown file into an interactive slide show — for academic paper-share use cases. The original deck on which this skill was authored shared:
> A Novel RFID Authentication Protocol Based on a Block-Order-Modulus Variable Matrix Encryption Algorithm (IEEE TIFS, 2025)
The tone is academic, not promotional. See §6.
The skill applies generally to any "convert an academic paper into a 30-slide deck" task.
This skill assumes a Slidev project with the following structure (paths used in scripts default to this layout):
your-slidev-project/
├── slides.md ← ★ MAIN EDIT TARGET ★
├── pdf_text.txt ← page-delimited PDF text (produced by extract_pdf.py)
├── components/ ← auto-imported Vue components
│ ├── *.vue
├── scripts/ ← batch helpers from this skill
│ ├── extract_pdf.py
│ ├── fix_math.py
│ ├── fix_headings.py
│ ├── fix_tables.py
│ ├── fix_anim_loop.py
│ ├── normalize_spacing.py
│ ├── academic_tone.py
│ └── replace_block.py
├── public/ ← static assets, e.g. /xdu.jpg
└── package.json
The deck being edited is slides.md at the project root. Scripts default to operating on ../slides.md relative to the scripts/ folder.
Run from inside the project root:
npm install # first-time setup
npm run dev # dev server at http://localhost:3030 with HMR
npm run build # static build
npm run export # PDF
npx slidev export --format pptx # PPTX
If the dev server reports Port 3030 is already in use:
lsof -ti:3030 | xargs kill -9
slides.md before editing. Use line-anchored Edit calls; never blindly rewrite. Slides are separated by --- lines, so you can locate a slide by its index (1-based, counting frontmatter as page 1).slides.md or any components/.vue, do not* restart Vite. HMR handles markdown, Vue SFC, and CSS changes cleanly. Only kill/restart on explicit user request or port conflict.localhost:3030 and navigate to the affected pages. For text-only changes, no verification needed.python scripts/academic_tone.py (or the equivalent grep):```
Grep pattern="恐怖|魔术|破局|无懈可击|完美|彻底|金贵|致命|惊人|爆炸|洗牌|掠影|!" path=slides.md
```
No matches expected.
These rules were learned from real bugs. Violating them produces broken output.
$…$ inside HTML tagsKaTeX ✅ Use HTML tags + entities: ❌ Don't write KaTeX is fine in plain markdown paragraphs outside HTML blocks. Stacking formulas with (a) An inline 2×2 / m×n matrix with vertical bars: Adjust (b) A list of aligned formulas (e.g. Each formula sits in its own grid cell, so the Style hygiene for inline math: The slide canvas has a fixed height. Long ✅ Wrap with ✅ For mermaid blocks specifically, also append Mermaid SVG renders flush with its container. ✅ Slidev's TOC component auto-numbers. If you write ✅ ❌ Vue's template compiler emits ✅ ❌ Use a consistent scale across slides; ad-hoc values ( Step-by-step animations in ✅ Pattern: The user does NOT want auto-loop animations. Both This is an academic paper-share, not a marketing pitch. The user explicitly required removing all promotional/emotional wording. Describe content; don't advertise. ✅ Allowed only as small visual icons inside cards (❌ ⚠️ 💡 🔢 🔄 🔀 📉). Never in body prose, never as bullet decorations. Per-slide frontmatter (between A typical paper-share deck goes through this pipeline: Produces a flat text file with If All scripts live under Replace a static mermaid diagram with a Vue component: Pre-commit sanity sweep: A clean run prints Keep each helper single-purpose. Do NOT create a "fix everything" mega-script — small composable tools are easier to reason about and debug than a monolith. When the user asks for "a script I can read aloud" / "30 分钟报告稿" / similar, the goal is a printable, page-by-page narration the speaker can read verbatim while clicking through the deck. Generate it as A relaxed academic delivery is ~200 Chinese characters per minute. Multiply target minutes × 200 to get the target word budget: Always tally roughly per section as you draft so the total lands within ±10% of the budget. Distribute time roughly proportional to information density: Each page in the script should follow this rhythm: Avoid summarizing the whole slide twice (once at the start, once at the end). Pick one place. Use the literal page numbers from the rendered Slidev deck (cover = page 1, section dividers count). This lets the speaker glance at the side display and cross-reference instantly. Other useful markers in the body: Some pages are harder to narrate than others. Plan for them: The last content page (the conclusions slide) deserves a structured close: Don't put all of these on the thank-you slide. The thank-you slide gets ~30 seconds: thank, invite questions, sit down. A good script reads like it was written by the speaker, not for an actor. When in doubt, read a paragraph aloud yourself — if it sounds like a press release, rewrite. You are now ready to edit 共 3 个版本$p$ / $$ … $$ does not render when nested inside , , etc. — it stays as raw $ text on the slide.AT, A1, ×, ≠, (mod p), det(A).$A^T$ or $$c = A \times t$$ inside 5.1a Rendering matrices and aligned formula lists — use CSS Grid, not
+ and trying to align columns with always looks crooked because monospace and proportional widths drift. Use CSS Grid for two things:<span class="matrix">
<span>a</span><span>b</span>
<span>c</span><span>d</span>
</span>
<style scoped>
.matrix {
display: inline-grid;
grid-template-columns: repeat(2, 1.4em);
grid-auto-rows: 1.4em;
align-items: center;
justify-items: center;
padding: 0 0.5em;
border-left: 2px solid currentColor;
border-right: 2px solid currentColor;
font-style: italic;
font-size: 1.1em;
}
</style>
repeat(N, …) for an N-column matrix. The two solid bars on the sides give the visual "matrix bracket" effect without needing actual brackets.P₁ = …, P₂ = …, … in two columns):<div class="font-mono p-grid">
<span>P<sub>1</sub> = (a+d)(e+h)</span>
<span>P<sub>2</sub> = (c+d) · e</span>
<span>P<sub>3</sub> = a · (f−h)</span>
<span>P<sub>4</sub> = d · (g−e)</span>
...
</div>
<style scoped>
.p-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 2px 12px;
}
</style>
= signs in column 1 align perfectly with the = signs in column 2 — no manual padding. If you have an odd number of formulas, add an empty to keep the grid balanced.− (U+2212), not the ASCII hyphen -· for multiplication when adjacent letters might run together (a·e not ae)a·e) when you want the audience to count operations — turns "a wall of formulas" into a visually scannable diagram5.2 Constrain overflow on long content
lists or tall mermaid diagrams clip or bleed off-screen.transform scale-90 origin-top to the wrapper:<div class="mt-6 text-sm max-h-[300px] overflow-y-auto pr-2 transform scale-90 origin-top">
5.3 Mermaid container needs both top margin AND inner padding
mt-6 alone leaves it cramped against the heading; p-2 inside is too tight.5.4 No manual heading numbering
## 1. 研究背景, the TOC outputs 1. 1. 研究背景.## 研究背景## 1. 研究背景5.5 HTML tables MUST wrap rows in
cannot be child of warnings and may cause hydration errors. Browsers auto-insert
at runtime, but Vue's compile-time parser does not.<table>
<tbody>
<tr><td>…</td></tr>
</tbody>
</table>
… 5.6 Vertical-rhythm spacing scale
mt-2, mt-4, mt-8, mt-12 mixed) look uneven.Role Class --- --- Container directly below ## H2 titlemt-6Bottom callout/summary after a main blockmt-6 (or mt-2 only when preceding block is a tall scale-90 mermaid/animation)Caption text under an icon/heading inside a card mt-2Avoid mt-0, mt-8, mt-12 unless visually justified5.7 Vue animation components — recursive
setTimeout, not setIntervalcomponents/*.vue must not use setInterval: it races with reset/clear timers when looping back to start, causing the first step to fire twice.let timerId = null
const playStep = () => {
if (activeStep.value < steps.length - 1) {
timerId = setTimeout(() => { activeStep.value++; playStep() }, 2000)
} else { /* end state */ }
}
onUnmounted(() => clearTimeout(timerId))
5.8 Animations are manual-play with subtle controls
CryptoAnim.vue and ProtocolAnim.vue follow this pattern — copy it for any new animation:current/total step counterbg-black/20 baseline → bg-black/50 on hover, opacity-40 → opacity-100 on hover, ~20px button hit areas, w-3 h-3 SVG icons, text-[10px] counterbackdrop-blur-sm rounded-full border border-gray-600/30 for a glass-pill look6. Tone & Wording Standard (HARD RULE)
Words and patterns to avoid
Banned Why --- --- 恐怖、惊人、爆炸、致命、金贵 Emotional intensity 魔术、破局、洗牌、掠影 Metaphorical / informal 完美、无懈可击、彻底 Absolutist hype 巧妙、大幅、锐减、落地、危机 Promotional verbs Trailing ! (full-width exclamation)Tonal noise Replace with
Keep verbatim
44.44%, 99.59%, 99.9%, n=18AM, SUEO, DBLTKM, Winograd, BAN, RFIDSection cover subtitles
存储与计算复杂度对比 ❌ 惊人的存储优化率.Emojis
7. Quick Reference: Slidev Frontmatter & Layouts in This Deck
---
theme: seriph
background: /xdu.jpg
class: 'text-center'
lineNumbers: false
transition: fade-out
css: unocss
---
--- separators):---
layout: center
class: text-center
---
layout: center is used for chapter cover slides. Default layout is used for content.8. When Asked to Add a New Slide
--- separator at the insertion point in slides.md.## Title (no manual number).grid grid-cols-2 gap-4 mt-6).//HTML entities for math (§5.1).9. When Asked to Add a New Animation Component
components/MyAnim.vue., recursive setTimeout (§5.7).CryptoAnim.vue).slides.md as — auto-imported, no import needed.10. Don't Touch (Without Explicit Request)
node_modules/package-lock.json11. Authoring Pipeline & Batch Helpers (
scripts/)PDF source ──► extract_pdf.py ──► pdf_text.txt ──► (human distills) ──► slides.md
│
▼
┌──────────────────────┐
│ Batch fix-up loop │
│ (run as needed) │
├──────────────────────┤
│ fix_math.py │ LaTeX → HTML entities
│ fix_headings.py │ strip manual numbers
│ fix_tables.py │ add <tbody>
│ fix_anim_loop.py │ flag setInterval
│ normalize_spacing │ unify mt-* values
└──────────────────────┘
│
▼
academic_tone.py (lint)
│
▼
npm run dev
11.1 PDF extraction
pip install pdfplumber
python scripts/extract_pdf.py path/to/paper.pdf pdf_text.txt
--- PAGE N --- markers. Use grep "term" pdf_text.txt or grep -A 5 "PAGE 7" pdf_text.txt to cite specific paper pages while drafting slides. See pdf_text.sample.txt (shipped with this skill) for an example output.pdfplumber mis-orders columns or drops equations, fall back to:pdftotext -layout source.pdf pdf_text.txt # macOS: brew install poppler
11.2 The fix-up scripts
scripts/ and operate on slides.md (or components/) by default. They are idempotent — safe to run multiple times.Script Purpose When to run --- --- --- fix_math.pyConvert A^T, \\times, $...$ to T, ×, plain textAfter pasting equations from the PDF fix_headings.pyStrip # 1. / ## ① prefixes that break TOCAfter importing an outline fix_tables.pyWrap in After authoring raw HTML tables fix_anim_loop.pyDetect setInterval in components/*.vue (manual rewrite hint)After adding a new animation normalize_spacing.pyRewrite mt-8/mt-12 → mt-6 on grid/flex containers; warn on mt-0Before review; use --apply to commitacademic_tone.pyLint for promotional words; exits 1 if any found As a pre-commit gate replace_block.pySwap a section delimited by two unique heading markers When replacing a static diagram with a Vue component 11.3 Quick recipes
python scripts/replace_block.py \
--start "## 协议流程图 (1/2):查询与上行认证" \
--end "## 协议流程图 (2/2)" \
--replacement-file new_section.md
python scripts/fix_math.py && \
python scripts/fix_headings.py && \
python scripts/fix_tables.py && \
python scripts/normalize_spacing.py --apply && \
python scripts/academic_tone.py
No changes. for each fixer and Tone check passed. at the end.11.4 Extending the helpers
(regex, reason) tuple to BANNED_PATTERNS in academic_tone.py.(pattern, replacement) tuple to REGEX_RULES in fix_math.py.TARGETS in normalize_spacing.py.12. Writing the Talk Script (
talk_script.md)talk_script.md at the project root.12.1 Time-to-words math (Mandarin Chinese)
Target Words Notes --- --- --- 15 min ~3,000 tight; cut every page to its core sentence 30 min ~6,000 comfortable; allows examples + one digression per algorithm 45 min ~9,000 room for Q&A asides and live equation walk-throughs 12.2 Per-slide budget
Slide kind Time Words --- --- --- Cover slide 1 min ~200 Section divider ( layout: center)15–20 sec ~50 Background / motivation page 1.5–2 min ~350 Algorithm explanation (the meat) 2–2.5 min ~450–500 Protocol step diagram 2 min ~400 Performance / results page 1.5–2 min ~350 Conclusion page 2 min ~400 Thank-you / Q&A page 30 sec ~80 12.3 Voice and register — read-aloud style
12.4 Per-page structure pattern
【翻页】 (or whatever symbol). Always end the page with one.12.5 Markup conventions for the script file
## 第 N 页 · <slide title>(约 X 分钟)
<narration in plain prose paragraphs>
`【翻页】`
(停顿) — explicit micro-pause, useful before a punchline number or after a complex equation.【可省略】 … 【/可省略】 — wrap optional asides that can be cut if running over time.> 备注:… — a sentence that's notes-only and should NOT be read aloud (e.g., "this is the page where you click the play button").12.6 Handle hard pages explicitly
S_traditional formula): do NOT read every term. Instead say "我们看它的形式:里面有一项是 X,再加上一项 Y,关键是它关于 N 是阶乘求和" — describe the shape of the equation, not the symbols., ): tell the speaker to click play and narrate over the animation. Reference the steps by number, not by reading every label.12.7 Closing the talk
12.8 Self-check before delivering the script
【翻页】?$...$ LaTeX in narration (the speaker can't pronounce those — write A 的 T 次方 or A 转置)?slides.md. Read the relevant slide section, apply the conventions above, and use HMR to ship changes incrementally.版本历史
🔗 相关推荐
Excel / XLSX
HTML Report