/che-latex-mcp:latex-validatefrom che-latex-mcp
編譯 LaTeX 專案後跑完整 layout 驗證流程 — detect_layout_issues + find_overlaps + fonts_check + box_warnings。當用戶說「驗證 LaTeX」「檢查排版」「掃 layout 問題」「LaTeX 編完看看有沒有 bug」「latex audit」或在 LaTeX 專案目錄編譯後想自動 audit 時使用。也適用於 commit 前驗證、release 前 audit、暑校稿 batch 修完想知道剩餘 issue。
Ships in che-latex-mcp. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
編譯後完整 layout 驗證流程:把 6 個 detector tool 串成一條 audit pipeline,產生整理過的 issue 報告。
用戶說:
/latex-validate或 implicit 場景:
依序執行(用 mcp__plugin_che-latex-mcp_che-latex-mcp__<tool> 命名空間):
如果用戶沒指定 project_path + main_file,問清楚或從 cwd 推斷。確認 PDF 已編譯出來,沒有的話先 compile_latex 一次。
fonts_check(project_path, main_file) # .log 字型缺字
box_warnings(project_path, main_file) # overfull/underfull box
這兩個從 .log 抓,速度極快(< 100ms),先跑。
detect_layout_issues(pdf_path, page_range?)
# → widow heading / empty page / bottom gap / overlap 一次抓完
這是主力 detector。報告會分四類列出問題 page 跟原因。
find_overlaps(pdf_path, problematic_pages, threshold=4.0)
# → 對問題頁面逐 block 列出重疊位置 + 文字 excerpt
只對 Step 3 報的 overlap pages 跑,不必整本。
收到 4 個 tool report 後,不要直接 dump 給用戶。整理成:
## LaTeX 排版 audit 報告(main.pdf,N 頁)
### ⚠️ Critical(必須修)
- p.X: widow heading「⋯⋯」← 加 \needspace 或 \clearpage
- p.Y: block overlap 12.4 pt² ← tikz layout 衝突或字型 ghost
### ⚠️ Warning(建議修)
- p.Z: 留白 65% ← 可能過度 \clearpage,檢查 line N
- 字型缺字 ⋯ 3 個(U+22EF / Times New Roman)← 改 \dots
### ✅ Pass
- 標點符號(如果跑了 punct_check)
- overfull box(如果 box_warnings 通過)
對每個 issue 給 具體 修法建議(哪個 LaTeX 指令 / 哪行加 needspace),不要泛泛說「請調整」。
find_overlaps 預設 threshold=4 pt²,數學環境會有偽陽性。如果偽陽性多,調 threshold=50 只看明顯重疊。What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/latex-page-locate查出一段文字印在 PDF 的第幾頁,或反過來驗證「某段文字是不是真的在第 N 頁」。當用戶說「這段在第幾頁」「頁碼是多少」「頁碼對不對」「幫我查頁碼」「勘誤要填 location」「errata 的頁碼」「這條勘誤指到哪一頁」「核一下頁碼」時使用。也用於寫 errata.yaml / release.yaml 的 `location:` 欄位之前,以及批次稽核既有頁碼是否仍然正確(改版重排之後頁碼會整批位移)。/latex-precompileLaTeX source 編譯前的 static check — punct_check(半形/全形標點)+ fonts_check(字型缺字,需既有 .log)+ source-level pattern audit。當用戶說「precompile check」「編譯前檢查」「跑 make check」「source audit」「掃半形標點」「掃缺字」時使用。對應暑期班 typesetting-checklist 的/latex-preview-chunk預覽單一 LaTeX 片段(vocabbox / tikz 圖 / 數學公式)不必編整本 PDF — 用 compile_chunk 把片段包進 standalone class 編譯 → 單頁 PNG。當用戶說「預覽這個 vocabbox」「看一下這個 tikz 長怎樣」「試試這個公式」「快速看片段」「不要編整本」時使用。Other plugins' skills for the same job
npx claudepluginhub psychquant/psychquant-claude-plugins --plugin che-latex-mcp