/che-latex-mcp:latex-precompilefrom che-latex-mcp
LaTeX source 編譯前的 static check — punct_check(半形/全形標點)+ fonts_check(字型缺字,需既有 .log)+ source-level pattern audit。當用戶說「precompile check」「編譯前檢查」「跑 make check」「source audit」「掃半形標點」「掃缺字」時使用。對應暑期班 typesetting-checklist 的
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.
編譯之前先跑 source-level static check,把「編譯出來才會發現」的 bug 提前抓出來。比 make check 工作流更省事的單一 skill。
用戶說:
/latex-precompile或 implicit:
punct_check(source_path)
source_path 可以是單一 .tex 或目錄(會遞迴掃所有 .tex,自動跳 _archive),;:?!()\foo(x) 這類 LaTeX 語法$...$ math mode% 開頭整行 commentfonts_check(project_path, main_file?)
.log 抽 Missing character: There is no X in font Y! warnings前置條件:必須已編譯過一次(.log 存在)。如果沒,先 call compile_latex 跑一次(缺字字型 fallback 不會 abort 編譯)。
box_warnings(project_path, main_file?, severity_min?)
.log 抽 box warningsseverity_min 過濾低分(如「10000」只看 badness ≥ 10000)整理三個 check 結果成 audit 報告:
## LaTeX precompile check 報告
### ⚠️ 標點符號(punct_check)
共 N 處:
- 02_暑期班/.../ch04.tex:L432:C18 ',' → ',' 「⋯⋯」
- ...
建議:batch 修這 N 處或跑 autofix_punct.py
### ⚠️ 字型缺字(fonts_check)
共 M 個 unique:
| 字元 | Unicode | 字型 |
|------|---------|------|
| ⋯ | U+22EF | Times New Roman |
建議:⋯ → \dots / \cdots,→ → $\to$
### ⚠️ box 警告(box_warnings, badness ≥ 10000)
共 K 個:
- Overfull \hbox (15.23pt too wide) at line N
- ⋯
建議:手動檢查指定行,調整 \hyphenpenalty 或加 \\\\ break
如果 project 已有 Makefile 含 check/check-punct/check-fonts target(如 educator 暑期班的 setup),這 skill 提供更 unified 的 audit — 結果可以 cross-reference 既有 script,但不取代它們(script 跑得快,CI 用 script;互動 audit 用 skill)。
.log:如果 .log 不存在會 error。提示用戶先 compile_latex 一次99_archive 之類不會。如果 user 專案用不同 archive 命名,要明說What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub psychquant/psychquant-claude-plugins --plugin che-latex-mcp6 skills in this plugin
/latex-page-locate查出一段文字印在 PDF 的第幾頁,或反過來驗證「某段文字是不是真的在第 N 頁」。當用戶說「這段在第幾頁」「頁碼是多少」「頁碼對不對」「幫我查頁碼」「勘誤要填 location」「errata 的頁碼」「這條勘誤指到哪一頁」「核一下頁碼」時使用。也用於寫 errata.yaml / release.yaml 的 `location:` 欄位之前,以及批次稽核既有頁碼是否仍然正確(改版重排之後頁碼會整批位移)。/latex-preview-chunk預覽單一 LaTeX 片段(vocabbox / tikz 圖 / 數學公式)不必編整本 PDF — 用 compile_chunk 把片段包進 standalone class 編譯 → 單頁 PNG。當用戶說「預覽這個 vocabbox」「看一下這個 tikz 長怎樣」「試試這個公式」「快速看片段」「不要編整本」時使用。/latex-validate編譯 LaTeX 專案後跑完整 layout 驗證流程 — detect_layout_issues + find_overlaps + fonts_check + box_warnings。當用戶說「驗證 LaTeX」「檢查排版」「掃 layout 問題」「LaTeX 編完看看有沒有 bug」「latex audit」或在 LaTeX 專案目錄編譯後想自動 audit 時使用。也適用於 commit 前驗證、release 前 audit、暑校稿 batch 修完想知道剩餘 issue。/latex-visual-diff改動 LaTeX source 後做視覺 diff,知道改動影響哪幾頁 — 用 compile_diff(git_ref) 自動 checkout + compile + compare,或用 compare_pdfs 比兩個既存 PDF。當用戶說「視覺 diff」「比較改動前後」「我改了 X 影響哪幾頁」「跟上一版比」「visual regression」時使用。也適用於 batch 修完想驗證、release 前 ripple 檢查。/typesetting-rules中文(繁體)文件的通用排版規則,跨專案、跨媒材:中文句子裡的標點用全形、括號與引號以一對為單位判斷全形或半形、 列舉用頓號、不用字型缺的字元、正文段落首行縮兩字、標題不留在頁底、孤行寡行、引言冒號行與下方內容同頁、 內容不超出版心與欄框、圖表標籤不重疊。每條寫判準,再分別寫 LaTeX 與 Word 怎麼做、用什麼檢查,以及工具查不到的地方。 用於:寫或審中文講義、論文、計畫書、報告的版面,或校稿時判斷某處算不算排版錯誤。 觸發語句:「排版規則」「孤行寡行」「標題卡在頁底」「半形標點」「全形標點」「首行縮排」「段落開頭空兩格」「缺字變方框」「標點超出邊界」「校稿」。 跑檢查的步驟見 latex-precompile(編譯前)與 latex-validate(編譯後);專案自己的排版規則(題號、框、填空線)不在這裡。