← 返回
未分类

PPT Maker

saulxiong
未分类 community v1.0.2 3 版本 100000 Key: 无需
★ 0
Stars
📥 43
下载
💾 0
安装
3
版本
#latest

概述

Slidev Presentation Skill — bears-ppt-skill

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.


1. What This Skill Is For

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.

2. Expected Project Layout

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.

3. Common Commands

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

4. Editing Workflow

  1. Read 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).
  2. Rely on HMR. After editing 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.
  3. Keep edits minimal and surgical. Don't refactor untouched slides. Don't reformat unrelated markup.
  4. Verify visually. When the change is significant, suggest the user reload localhost:3030 and navigate to the affected pages. For text-only changes, no verification needed.
  5. For tone-related rewrites, after editing run python scripts/academic_tone.py (or the equivalent grep):

```

Grep pattern="恐怖|魔术|破局|无懈可击|完美|彻底|金贵|致命|惊人|爆炸|洗牌|掠影|!" path=slides.md

```

No matches expected.

5. Slidev Authoring Conventions (HARD RULES)

These rules were learned from real bugs. Violating them produces broken output.

5.1 Math inside HTML — never use KaTeX $…$ inside HTML tags

KaTeX $p$ / $$ … $$ does not render when nested inside

,

, , etc. — it stays as raw $ text on the slide.

✅ Use HTML tags + entities: AT, A1, ×, , (mod p), det(A).

❌ Don't write $A^T$ or $$c = A \times t$$ inside

.

KaTeX is fine in plain markdown paragraphs outside HTML blocks.

5.1a Rendering matrices and aligned formula lists — use CSS Grid, not
+  

Stacking formulas with
and trying to align columns with   always looks crooked because monospace and proportional widths drift. Use CSS Grid for two things:

(a) An inline 2×2 / m×n matrix with vertical bars:

<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>

Adjust repeat(N, …) for an N-column matrix. The two solid bars on the sides give the visual "matrix bracket" effect without needing actual brackets.

(b) A list of aligned formulas (e.g. 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>

Each formula sits in its own grid cell, so the = 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.

Style hygiene for inline math:

  • Use a real minus sign (U+2212), not the ASCII hyphen -
  • Use the middle dot · for multiplication when adjacent letters might run together (a·e not ae)
  • Color the multiplication operands (e.g., a·e) when you want the audience to count operations — turns "a wall of formulas" into a visually scannable diagram

5.2 Constrain overflow on long content

The slide canvas has a fixed height. Long lists or tall mermaid diagrams clip or bleed off-screen.

✅ Wrap with

.

✅ For mermaid blocks specifically, also append 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

Mermaid SVG renders flush with its container. mt-6 alone leaves it cramped against the heading; p-2 inside is too tight.

… mermaid …

5.4 No manual heading numbering

Slidev's TOC component auto-numbers. If you write ## 1. 研究背景, the TOC outputs 1. 1. 研究背景.

## 研究背景

## 1. 研究背景

5.5 HTML tables MUST wrap rows in

Vue's template compiler emits 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

Use a consistent scale across slides; ad-hoc values (mt-2, mt-4, mt-8, mt-12 mixed) look uneven.

RoleClass
------
Container directly below ## H2 titlemt-6
Bottom callout/summary

after a main block

mt-6 (or mt-2 only when preceding block is a tall scale-90 mermaid/animation)
Caption text under an icon/heading inside a cardmt-2
Avoidmt-0, mt-8, mt-12 unless visually justified

5.7 Vue animation components — recursive setTimeout, not setInterval

Step-by-step animations in components/*.vue must not use setInterval: it races with reset/clear timers when looping back to start, causing the first step to fire twice.

✅ Pattern:

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

The user does NOT want auto-loop animations. Both CryptoAnim.vue and ProtocolAnim.vue follow this pattern — copy it for any new animation:

  • Initial state: paused at first frame (CryptoAnim) or empty (ProtocolAnim)
  • Bottom-right control bar: play / pause / replay buttons + current/total step counter
  • Visually subtle: bg-black/20 baseline → bg-black/50 on hover, opacity-40opacity-100 on hover, ~20px button hit areas, w-3 h-3 SVG icons, text-[10px] counter
  • Wrap in backdrop-blur-sm rounded-full border border-gray-600/30 for a glass-pill look

6. Tone & Wording Standard (HARD RULE)

This is an academic paper-share, not a marketing pitch. The user explicitly required removing all promotional/emotional wording.

Words and patterns to avoid

BannedWhy
------
恐怖、惊人、爆炸、致命、金贵Emotional intensity
魔术、破局、洗牌、掠影Metaphorical / informal
完美、无懈可击、彻底Absolutist hype
巧妙、大幅、锐减、落地、危机Promotional verbs
Trailing (full-width exclamation)Tonal noise

Replace with

  • 提出 / 引入 / 构造 / 完成更新 / 形成闭环 / 节省率达到 / 难以承载 / 显著负担
  • Neutral declarative sentences. Passive/objective voice where appropriate.

Keep verbatim

  • All numerical results: 44.44%, 99.59%, 99.9%, n=18
  • All proper nouns: AM, SUEO, DBLTKM, Winograd, BAN, RFID
  • All formulas and code

Section cover subtitles

Describe content; don't advertise. ✅ 存储与计算复杂度对比惊人的存储优化率.

Emojis

Allowed only as small visual icons inside cards (❌ ⚠️ 💡 🔢 🔄 🔀 📉). Never in body prose, never as bullet decorations.

7. Quick Reference: Slidev Frontmatter & Layouts in This Deck

---
theme: seriph
background: /xdu.jpg
class: 'text-center'
lineNumbers: false
transition: fade-out
css: unocss
---

Per-slide frontmatter (between --- 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

  1. Add --- separator at the insertion point in slides.md.
  2. Start with ## Title (no manual number).
  3. Wrap structured content in UnoCSS grids (grid grid-cols-2 gap-4 mt-6).
  4. Apply §5.6 spacing.
  5. Use //HTML entities for math (§5.1).
  6. If long, wrap in overflow container (§5.2).
  7. Use academic tone (§6).

9. When Asked to Add a New Animation Component

  1. Create components/MyAnim.vue.
  2. Use